|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.enterprise.communications.command.server.MultipleCommandService.CommandTypeExecutor
protected class MultipleCommandService.CommandTypeExecutor
An inner class used only by the MultipleCommandService that encasulates a supported command type and the
executor that should be used to execute commands of that type. Note the two constructors - one takes a
java.lang.Class and one an instance of CommandExecutor. If the java.lang.Class
constructor is used, then for each command request that is issued to this command service, a new instance should
be created to handle each command. If the CommandExecutor constructor is used, that means each command
that comes in should be handed off to that specific instance. In that case, the executor instance must
ensure thread-safety, since commands may come in concurrently.
Subclasses create instances of these objects and return them in
MultipleCommandService.getSupportedCommandTypeExecutors().
| Field Summary | |
|---|---|
Class |
m_executorClass
the executor's class - this must implement CommandExecutor |
CommandType |
m_type
the type of command this executor will handle |
| Constructor Summary | |
|---|---|
MultipleCommandService.CommandTypeExecutor(CommandType type,
Class executorClass)
Creates a new object that defines what class to instantiate for each new command to execute. |
|
MultipleCommandService.CommandTypeExecutor(CommandType type,
CommandExecutor executorInstance)
Creates a new object that defines what executor instance to use to execute all commands of the given
type. |
|
| Method Summary | |
|---|---|
CommandExecutor |
getExecutor()
Returns the executor instance that should be used to execute the next command. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final CommandType m_type
public final Class m_executorClass
CommandExecutor
| Constructor Detail |
|---|
public MultipleCommandService.CommandTypeExecutor(CommandType type,
Class executorClass)
type - the type of command to be handed off to new instances of the given executor classexecutorClass - class of the executor to instantiate when new commands are to be executed
IllegalArgumentException - if the given class is an interface, an abstract class or not assignable to
CommandExecutor; also if any parameter is null. Note
that this is also thrown if the class is a MultipleCommandService
object, since that would result in an infinite recursive loop.
public MultipleCommandService.CommandTypeExecutor(CommandType type,
CommandExecutor executorInstance)
type. Because all commands will be handed off to the given executor instance, that instance must
ensure thread-safety.
type - the type of command that will be handled by the given executor instanceexecutorInstance - the executor that will handle all commands of the given type
IllegalArgumentException - if any parameter is null or if the instance is a
MultipleCommandService object, since that would result in an
infinite recursive loop.| Method Detail |
|---|
public CommandExecutor getExecutor()
RuntimeException - failed to create the executor instance (should rarely, if ever, occur)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||