Package com.bank.service

Examples of com.bank.service.TransferService


    Properties props = new Properties();
    props.load(TransferScript.class.getClassLoader()
        .getResourceAsStream("com/bank/config/app.properties"));

    TransferService transferService = new DefaultTransferService(
        new JdbcAccountRepository(dataSource),
        new FlatFeePolicy(Double.valueOf(props.getProperty("flatfee.amount"))));

    transferService.setMinimumTransferAmount(
        Double.valueOf(props.getProperty("minimum.transfer.amount")));

    // generate a random amount between 10.00 and 90.00 dollars
    double amount = (new Random().nextInt(8) + 1) * 10;

    TransferReceipt reciept = transferService.transfer(amount, "A123", "C456");

    System.out.println(reciept);
  }
View Full Code Here


    ApplicationContext ctx =
      new AnnotationConfigApplicationContext(AppConfig.class);


    TransferService transferService = ctx.getBean(TransferService.class);

    // generate a random amount between 10.00 and 90.00 dollars
    double amount = (new Random().nextInt(8) + 1) * 10;

    TransferReceipt receipt = transferService.transfer(amount, "A123", "C456");

    System.out.println(receipt);

  }
View Full Code Here

    ApplicationContext ctx =
      new GenericXmlApplicationContext("com/bank/config/app-config.xml");


    TransferService transferService = ctx.getBean(TransferService.class);

    // generate a random amount between 10.00 and 90.00 dollars
    double amount = (new Random().nextInt(8) + 1) * 10;

    TransferReceipt receipt = transferService.transfer(amount, "A123", "C456");

    System.out.println(receipt);

  }
View Full Code Here

TOP

Related Classes of com.bank.service.TransferService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.