WebSphere Application Server Network Deployment for i5/OS, Version 6.1   
             オペレーティング・システム: i5/OS

             目次と検索結果のパーソナライズ化

補正コマンドの例

補正コマンドを使用するには、基本コマンドに関連付けられている補正器を 検索し、その execute メソッドを呼び出す必要があります。

ModifyCheckingAccountCompensator コマンド

以下のコード例は、元のコマンドを実行したり、補正コマンドの実行によって 作業を元に戻すオプションをユーザーに与えたりするために使用されるコードを示します。

{
...
CheckingAccount checkingAccount
....
try {
ModifyCheckingAccountCmd cmd =
new ModifyCheckingAccountCmdImpl(null, 1000);
cmd.setCheckingAccount(checkingAccount);
cmd.execute();
...
System.out.println("Would you like to undo this work? Enter Y or N");
try {
// Retrieve and validate user's response
...
}
...
if (answer.equalsIgnoreCase(Y)) {
Command compensatingCommand = cmd.getCompensatingCommand();
compensatingCommand.execute();
}
}
catch (Exception e) {
System.out.println(e.getMessage());
}
...
}



関連タスク
コマンドの使用
参照トピック    

ご利用条件 | フィードバック

最終更新: Jan 21, 2008 8:28:52 PM EST
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.nd.iseries.doc/info/iseriesnd/ae/rcmd_usecompensatingcmd.html