WebSphere Application Server Version 6.1 Feature Pack for Web Services
             Operating Systems: AIX, HP-UX, i5/OS, Linux, Solaris, Windows, z/OS

             Personalize the table of contents and search results

Setting the command target name

If a client needs to set the target of the command by name, it can use the setCommandTargetName method for the command.

Identifying a target with CommandTargetName

This example compares with the example in Using a command as follows:
  • Both explicitly set the command target in the constructor to null.
  • Both use the setCheckingAccount method to indicate the account on which the command should operate.
  • This example sets the target name explicitly by using the setCommandTargetName method. When the default target policy traverses its choices, it finds a null for the first choice and a name for the second.
{
...
CheckingAccount checkingAccount
....
try {
ModifyCheckingAccountCmd cmd =
new ModifyCheckingAccountCmdImpl(null, 1000);
cmd.setCheckingAccount(checkingAccount);
cmd.setCommandTargetName("com.ibm.sfc.cmd.test.CheckingAccountBean");
cmd.execute();
}
catch (Exception e) {
System.out.println(e.getMessage());
}
...
}



Related concepts
Targets and target policies
Related tasks
Using a command
Reference topic    

Terms of Use | Feedback

Last updated: Nov 25, 2008 2:35:59 AM CST
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.wsfep.multiplatform.doc/info/ae/ae/rcmd_setcmdtargname.html