TestClient.java
资源名称:某公司的java培训教材 [点击查看]
上传用户:dinglihq
上传日期:2013-02-04
资源大小:99958k
文件大小:1k
源码类别:
Java编程
开发平台:
Java
- package examples.command;
- import javax.ejb.*;
- import javax.naming.*;
- import java.rmi.*;
- import javax.rmi.*;
- import java.util.*;
- /**
- * Sample client code which manipulates a Bank Account Entity Bean.
- */
- public class TestClient {
- public static void main(String[] args) throws Exception {
- try {
- TransferFundsCommand transferCommand = new TransferFundsCommand();
- transferCommand.setDepositAccountID("1");
- transferCommand.setWithdrawAccountID("2");
- transferCommand.setTransferAmount(50);
- System.out.println("before "+ transferCommand.hashCode());
- transferCommand = (TransferFundsCommand) CommandExecutor.execute(transferCommand);
- System.out.println("after " +transferCommand.hashCode());
- System.out.println(transferCommand.getDepositAccountBalance());
- System.out.println(transferCommand.getWithdrawAccountBalance());
- }
- catch (CommandException e) {
- System.out.println(e.getWrappedException().getMessage());
- e.printStackTrace();
- }
- }
- }