|
IBM WebSphere Application ServerTM Release 7 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.websphere.management.cmdframework.provider.CommandProvider
com.ibm.websphere.management.cmdframework.provider.SimpleCommandProvider
public abstract class SimpleCommandProvider
The class provides a mechanism for command providers to implement multiple admin commands easily.
This command provider always creates SimpleAdminCommand instance for any commands.
The execute
method always delegates the execution
logic to a method with the same name of the command defined on this class. For instance,
if the command name is "mySimpleCmd", then the SimpleAdminCommand delegates the execution
logic of the command to a method Object mySimpleCmd(AdminCommand cmd);
This method may return any object type and throw some exceptions.
Therefore, command providers only needs to implement a method on this class for
each admin command it provides.
The limitation of this approach is that command provider can not override the
validate
and getChoices
methods.
Field Summary | |
---|---|
protected java.util.HashMap |
methodTable
|
Constructor Summary | |
---|---|
protected |
SimpleCommandProvider()
|
Method Summary | |
---|---|
AbstractAdminCommand |
createCommand(com.ibm.websphere.management.cmdframework.commandmetadata.CommandMetadata metadata)
Create an instance of an admin command based on the specified metadata. |
protected void |
execute(SimpleAdminCommand cmd)
Delegates the execution logic to the method with the same name as the command name. |
protected void |
executeReal(SimpleAdminCommand cmd)
|
AbstractAdminCommand |
loadCommand(com.ibm.websphere.management.cmdframework.commanddata.CommandData cmdData)
Create an instance of an admin command based on the specified command data. |
Methods inherited from class com.ibm.websphere.management.cmdframework.provider.CommandProvider |
---|
commandStepPosition, createCommandStep, getCommandProviderHelper, getStepMetadata, initCommandMetadata, loadCommandStep |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.HashMap methodTable
Constructor Detail |
---|
protected SimpleCommandProvider()
Method Detail |
---|
public AbstractAdminCommand createCommand(com.ibm.websphere.management.cmdframework.commandmetadata.CommandMetadata metadata) throws CommandNotFoundException
CommandProvider
createCommand
in class CommandProvider
metadata
- the metadata of an admin command.
CommandNotFoundException
- if the
specified command is not found.public AbstractAdminCommand loadCommand(com.ibm.websphere.management.cmdframework.commanddata.CommandData cmdData) throws CommandNotFoundException, CommandLoadException
CommandProvider
loadCommand
in class CommandProvider
cmdData
- the command data of the admin command.
CommandNotFoundException
- if the
specified command is not found.
CommandLoadException
- if the command data is failed to load into an
admin command instance.protected void execute(SimpleAdminCommand cmd)
cmd
- the command object.protected void executeReal(SimpleAdminCommand cmd)
|
IBM WebSphere Application ServerTM Release 7 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |