InfoCenter Home > 6.6.0.11: Execute commands using EJB CommandTarget supportStarting with Version 3.5.3, IBM WebSphere Application Server Advanced Edition provides an EJBCommandTarget class by the WebSphere Command function to allow administrators to utilize this EJB CommandTarget to execute a command in a designated server without providing their own CommandTarget implementation. EJBCommandTarget is a Java object that serves as a wrapper of an EJB CommandTarget. CommandServerEntityBean is the WebSphere implementation of this EJB CommandTarget. It is a stateless Bean Managed Persistent (BMP) bean, so there is no database table associated with this bean. Command developer can set this EJBCommandTarget object into the Command and has the administrator to deploy the CommandServerEntityBean into the application server where the command is going to be executed. An example of a client code is ... EJBCommandTarget target = new EJBCommandTarget(); MyCommand cmd = new MyCommandImpl(Arguments...) cmd.setCommandTarget(target); cmd.execute(); In the above code example, the command(MyCommand) is created and executed in the application server. When the execute() method is performed on the MyCommand, the target(EJBCommandTarget) will lookup the CommandServerEntityBeanHome from the InitialContext and performs the executeCommand() method on the CommandServerEntityBean. The EJBCommandTarget object ensures that there is only one CommandServerEntityBean per server to avoid extra naming lookup. If a command developer implements the TargetPolicy to map the Command name and the CommandTarget name, then he can register the CommandServerEntityBean into the customer TargetPolicy. |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|