⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testclient.java

📁 100多M的J2EE培训内容
💻 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();
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -