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

Command interface example application

ModifyCheckingAccountCmd command interface

This example uses an entity bean with container-managed persistence (CMP), called CheckingAccountBean, which enables a client to deposit money, withdraw money, set a balance, get a balance, and retrieve the name on the account. This entity bean also accepts commands from the client. The code examples illustrate the command-related programming. For a servlet-based example, see Example: Writing a command target (client-side adapter)

This command is both targetable and compensable, so the interface extends both TargetableCommand and CompensableCommand interfaces.

...
import com.ibm.websphere.exception.*;
import com.ibm.websphere.command.*;
public interface ModifyCheckingAccountCmd
extends TargetableCommand, CompensableCommand {
float getAmount();
float getBalance();
float getOldBalance(); // Used for compensating
float setBalance(float amount);
float setBalance(int amount);
CheckingAccount getCheckingAccount();
void setCheckingAccount(CheckingAccount newCheckingAccount);
TargetPolicy getCmdTargetPolicy();
...
}



Related tasks
Writing command interfaces
Related reference
TargetableCommand interface
CompensableCommand interface
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_exampleapp.html