|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--org.apache.avalon.framework.logger.AbstractLogEnabled
|
+--tweed.invocation.Command
The base class for implementing Command objects, which
represent a server-side processing.
This is the typical lifecycle of a Command object:
Context
as input parameter. The Context object must be available
in the application.
MyConcreteCommand command = new MyConcreteCommand( context ) ;
All fields are set to default values.
command.setCustomerId( theId ) ;
command.execute() ;
The command "magically" appears on the server, with input
(and in-out) parameters set to the same values as client-side.
Output-only parameters have been cleaned up (reset to their
default value).
The command executes the body of its execute() method.
This may set the value of output parameters.
Customer result = command.getCustomer() ;
Command object may be reused as many times as needed,
but special care should be taken to not pollute one call with input
parameter values remaining from a previous call.
Tagging fields used as input or output parameters:
Serialization
A concrete Command does not need to be serializable, since
fields will be extracted in another object for travelling between
client and server.
All fields used as input/output parameters MUST be serializable.
Use of Command as Model:
"Model" is used in the bindings.
A concrete Command may be used as a Model.
Declaring a Command as nested class:
This is strictly forbidden.
| Field Summary | |
static java.lang.String |
PARAM_IN_PREFIX
"in_" is the prefix for tagging input parameters. |
static java.lang.String |
PARAM_INOUT_PREFIX
"in_out_" is the prefix for tagging input parameters. |
static java.lang.String |
PARAM_OUT_PREFIX
"out_" is the prefix for tagging output parameters. |
static java.lang.String |
SERVERSIDE_CLASSNAME_PREFIX
|
| Constructor Summary | |
protected |
Command(Context context)
|
| Method Summary | |
protected void |
doExecute()
Override this method for the processings which should occur server-side. |
void |
execute()
|
Context |
getContext()
|
java.lang.Exception |
getFunctionalException()
|
java.lang.String |
getServerSideClassName()
|
boolean |
wasSuccess()
|
| Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String SERVERSIDE_CLASSNAME_PREFIX
public static final java.lang.String PARAM_IN_PREFIX
"in_" is the prefix for tagging input parameters.
public static final java.lang.String PARAM_OUT_PREFIX
"out_" is the prefix for tagging output parameters.
public static final java.lang.String PARAM_INOUT_PREFIX
"in_out_" is the prefix for tagging input parameters.
| Constructor Detail |
protected Command(Context context)
| Method Detail |
public final Context getContext()
public java.lang.String getServerSideClassName()
protected void doExecute()
throws FunctionalException
FunctionalExceptionpublic final java.lang.Exception getFunctionalException()
public final boolean wasSuccess()
public final void execute()
throws FunctionalException
FunctionalException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||