|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.perfectjpattern.core.behavioral.command.Invoker<P,R>
P
- Command Parameter context-specific.R
- Command Result context-specific.public class Invoker<P,R>
Base core implementation of IInvoker
interface.
IInvoker
Constructor Summary | |
---|---|
Invoker()
|
Method Summary | |
---|---|
R |
getResult()
Returns the result of the execution of the ICommand . |
void |
invoke()
Starts the appropriate ICommand . |
void |
setCommand(ICommand<P,R> aCommand)
Sets the ICommand to start as result of executing the
invoke method. |
void |
setParameter(P aParameter)
Sets the parameter required for the execution of the target ICommand . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Invoker()
Method Detail |
---|
public R getResult() throws IllegalStateException
ICommand
.
getResult
in interface IInvoker<P,R>
ICommand
.
IllegalStateException
- 'ICommand was not set'public void invoke() throws IllegalStateException
ICommand
.
invoke
in interface IInvoker<P,R>
IllegalStateException
- 'ICommand was not set'public void setCommand(ICommand<P,R> aCommand)
ICommand
to start as result of executing the
invoke method.
setCommand
in interface IInvoker<P,R>
aCommand
- ICommand
to set.public void setParameter(P aParameter) throws IllegalArgumentException
ICommand
.
setParameter
in interface IInvoker<P,R>
aParameter
- Parameter required for the execution of the target
ICommand
.
IllegalArgumentException
- Underlying implementations will
impose different preconditions on the aParameter argument
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |