Package cxf.common

Examples of cxf.common.Bank


    public static void main(String args[]) throws Exception {
       
        LOG.log(Level.INFO, "Resolving the bank object");
        BankCORBAService service = new BankCORBAService();
        Bank port = service.getBankCORBAPort();

        // Test the method Bank.createAccount()
        System.out.println("Creating account called \"Account1\"");
        W3CEndpointReference epr1 = port.createAccount("Account1");
        Account account1 = getAccountFromEPR(epr1);
        System.out.println("Depositing 100.00 into account \'Account1\"");
        account1.deposit(100.00f);
        System.out.println("Current balance of account \"Account1\" is " + account1.getBalance());
        System.out.println();

        /* Re-enable when we have a utility to manipulate the meta data stored
           within the EPR.
        // Test the method Bank.createEprAccount()
        System.out.println("Creating account called \"Account2\"");
        W3CEndpointReference epr2 = port.createEprAccount("Account2");
        Account account2 = getAccountFromEPR(epr2);
        System.out.println("Depositing 5.00 into account \'Account2\"");
        account2.deposit(5.00f);
        System.out.println("Current balance of account \"Account2\" is " + account2.getBalance());
        System.out.println();
        */

        // create two more accounts to use with the getAccount calls
        Account acc3 = getAccountFromEPR(port.createAccount("Account3"));
        acc3.deposit(200.00f);
        Account acc4 = getAccountFromEPR(port.createAccount("Account4"));
        acc4.deposit(400.00f);
       
        // Test the method Bank.getAccount()
        System.out.println("Retrieving account called \"Account3\"");
        W3CEndpointReference epr3 = port.getAccount("Account3");
        Account account3 = getAccountFromEPR(epr3);
        System.out.println("Current balance for \"Account3\" is " + account3.getBalance());
        System.out.println("Depositing 10.00 into account \"Account3\"");
        account3.deposit(10.00f);
        System.out.println("New balance for account \"Account3\" is " + account3.getBalance());
        System.out.println();

        /* Re-enable when we have a utility to manipulate the meta data stored
           within the EPR.
        // Test the method Bank.getEprAccount()
        System.out.println("Retrieving account called \"Account4\"");
        EndpointReferenceType epr4 = port.getEprAccount("Account4");
        Account account4 = getAccountFromEPR(epr4);
        System.out.println("Current balance for account \"Account4\" is " + account4.getBalance());
        System.out.println("Withdrawing 150.00 into account \"Account4\"");
        account4.deposit(-150.00f);
        System.out.println("New balance for account \"Account4\" is " + account4.getBalance());
        System.out.println();
        */

        port.removeAccount("Account1");
        port.removeAccount("Account3");
        port.removeAccount("Account4");

        System.exit(0);
    }
View Full Code Here

TOP

Related Classes of cxf.common.Bank

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.