Package org.springframework.integration.samples.loanbroker.domain

Examples of org.springframework.integration.samples.loanbroker.domain.LoanQuote


   * @param loanRequest the loan request
   * @return a LoanQuote for the given request
   */
  public LoanQuote quote(LoanRequest loanRequest) {
    Calendar calendar = Calendar.getInstance();
    LoanQuote loanQuote = new LoanQuote();
    Random random = new Random();
    loanQuote.setQuoteDate(calendar.getTime());
    calendar.add(Calendar.DAY_OF_YEAR, random.nextInt(25));
    loanQuote.setExpirationDate(calendar.getTime());
    loanQuote.setRate(random.nextFloat() + this.baseRate);
    loanQuote.setTerm(10 + random.nextInt(10));
    loanQuote.setAmount(250000 + random.nextInt(40000));
    loanQuote.setLender(this.name);
    return loanQuote;
  }
View Full Code Here


  public void runDemo() {
    ApplicationContext context =  new ClassPathXmlApplicationContext("META-INF/spring/integration/bootstrap-config/stubbed-loan-broker.xml");
    LoanBrokerGateway broker = context.getBean("loanBrokerGateway", LoanBrokerGateway.class);
    LoanRequest loanRequest = new LoanRequest();
    loanRequest.setCustomer(new Customer());
    LoanQuote loan = broker.getBestLoanQuote(loanRequest);
    logger.info("********* Best Quote *********\n" + loan);
    System.out.println("==============================");
    List<LoanQuote> loanQuotes = broker.getAllLoanQuotes(loanRequest);
    logger.info("********* All Quotes *********");
    for (LoanQuote loanQuote : loanQuotes) {
View Full Code Here

    ConfigurableApplicationContext context =
        new ClassPathXmlApplicationContext("META-INF/spring/integration/bootstrap-config/stubbed-loan-broker-multicast.xml");
    LoanBrokerGateway broker = context.getBean("loanBrokerGateway", LoanBrokerGateway.class);
    LoanRequest loanRequest = new LoanRequest();
    loanRequest.setCustomer(new Customer());
    LoanQuote loan = broker.getBestLoanQuote(loanRequest);
    logger.info("\n********* Best Quote: " + loan);
    List<LoanQuote> loanQuotes = broker.getAllLoanQuotes(loanRequest);
    logger.info("\n********* All Quotes: ");
    for (LoanQuote loanQuote : loanQuotes) {
      logger.info(loanQuote);
View Full Code Here

TOP

Related Classes of org.springframework.integration.samples.loanbroker.domain.LoanQuote

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.