public abstract class Operation
extends java.lang.Object
java.lang.reflect.Method
instances.
A note about the convention on how parameters to the operation
are described: each parameter is described by a name, a type
and a mask field. These data are stored in arrays of equal length,
corresponding indexes describing the same parameter. Only
parameters with mask set to true should be processed by the GUI,
others are used by the engine to hold "context" parameters, such
as callbacks, parameters passed by reference (pointers) to the remote
objects, parameters declared as OUT in CORBA etc. GUI implementations
must not modify any parameter values that declare false
in the mask.| Constructor and Description |
|---|
Operation(java.lang.String name,
SimpleIntrospectable introspectable,
DataType returnType,
java.lang.String[] parameterNames,
DataType[] parameterTypes,
boolean[] mask,
boolean invocation,
boolean special)
Constructs a new instance of an operation.
|
| Modifier and Type | Method and Description |
|---|---|
SimpleIntrospectable |
getIntrospectable()
Returns the introspectable instance that declares this method.
|
boolean[] |
getMask()
Returns the mask value for each argument / parameter to this
method.
|
java.lang.String |
getName()
Returns the name of this operation, as it should be displayed
to the user.
|
java.lang.String[] |
getParameterNames()
Returns the parameter names array.
|
DataType[] |
getParameterTypes()
Returns the array of parameter types for each parameter
to this operation.
|
DataType |
getReturnType()
Returns the array of parameter types for each parameter
to this operation.
|
abstract RemoteCall |
invoke(java.lang.Object[] data)
Invokes this operation.
|
abstract Invocation |
invokeAsync(java.lang.Object[] data,
RemoteResponseCallback cb)
Invokes an asynchronous operation on the introspectable instane.
|
boolean |
isInvocation()
Returns
true if this object represents an
operation, that is asynchronous. |
boolean |
isSpecial()
Returns
true if this operation is "special". |
java.lang.String |
toString()
Returns the display name of this operation with its
parameter types in brackets.
|
public Operation(java.lang.String name,
SimpleIntrospectable introspectable,
DataType returnType,
java.lang.String[] parameterNames,
DataType[] parameterTypes,
boolean[] mask,
boolean invocation,
boolean special)
name - the name of the operation to be displayed in GUIintrospectable - the remote object that declares this operationparameterNames - an array of string names of all parameters
that the operation declaresparameterTypes - an array of DataType objects identifying
the parameter types in the same sequence as in the names
arraymask - an array of booleans that indicates which parameters should
be requested by the GUI to be supplied by the user, when the
method is invoked. The GUI should only ask for parameters that
have true flag set in this array. The sequence is
the same as in types and names arrays.invocation - true iff this method is an asynchronous
method. If so, it must be invoked with invokeAsync() method
and will, as a response return an invocation object.special - true iff the operation should be treated as
special in the GUI (ie. displayable only if certain checkbox is checked)public SimpleIntrospectable getIntrospectable()
public boolean[] getMask()
true. Other
parameters should be left unmodified.public java.lang.String getName()
public java.lang.String[] getParameterNames()
public DataType[] getParameterTypes()
public DataType getReturnType()
public abstract RemoteCall invoke(java.lang.Object[] data)
Invocations as a side-effect..
The method must block for the duration of the call,
although it can terminate with a timeout, if this
condition can be detected.data - parameters to be passed to the remote call. It is
the responsibility of the GUI to initialize this array
in accordance to the guidelines set forth in the documentation
of this classpublic abstract Invocation invokeAsync(java.lang.Object[] data, RemoteResponseCallback cb)
data - parameters to be passed to the remote call. It is
the responsibility of the GUI to initialize this array
in accordance to the guidelines set forth in the documentation
of this classcb - the callback that will receive the async notifications. Must
not be null.public boolean isInvocation()
true if this object represents an
operation, that is asynchronous. If so, an invocation of
such operation will produce an invocation object as a side
effect. Asynchronous operations must be invoked with
invokeAsync() method. Therefore the GUI should
always check first the return value of this call and decide
which mode of invocation (sync or async) to use.true if the method should be invoked
through the invokeAsync() method.public boolean isSpecial()
true if this operation is "special". GUI
decides how to handle special operations. The preferred way
is not to display them until the user has checked a special
checkbox allowing the GUI to display "advanced" or "dangerous"
features.true if this operation is specialpublic java.lang.String toString()
toString in class java.lang.Objectthis.