ALBPM Process API (PAPI)

fuego.papi
Interface Invocation

All Superinterfaces:
Serializable

public interface Invocation
extends Serializable

Represents a mandatory client-side invocation.


Method Summary
 Object doInvoke(Object[] args)
          Invokes the actual method.
 Object[] doPostInvoke(Object[] methodArgs, Object retVal)
          Does all post invocation processing (calling getters and processing output arguments)
 Object[] doPreInvoke()
          Performs pre-invocation argument processing.
 Object[] getInputArgs()
          Returns an array containing the signatures of the input arguments (in even positions) and the values (in odd positions).
 Object[] getOutputArgs()
          Returns an array containing all the signatures of the output arguments that were requested in this invocation.
 String getSignature()
          Returns the signature of the method this invocation references.
 Object[] invoke()
          Performs a default execution of this invocation, returning an Object[] suitable to be passed to fuego.component.CustomExecution.setInvocationResult(Object[]).
 boolean isOutOfOrder()
          Returns true if this invocation can be executed out-of-order
 boolean isSynchronous()
          Returns true if this method execution is synchronous.
 

Method Detail

getInputArgs

public Object[] getInputArgs()
Returns an array containing the signatures of the input arguments (in even positions) and the values (in odd positions).
Signatures begining with '#' reference the method's input arguments, see getOutputArgs().
All other signatures reference attributes of the target component, and should be passed to Invokable.setAttribute().
All setters must be executed before the method execution.

Returns:
An array containing input argument signatures and its values.

isOutOfOrder

public boolean isOutOfOrder()
Returns true if this invocation can be executed out-of-order

Returns:
true if this invocation can be executed out-of-order

getOutputArgs

public Object[] getOutputArgs()
Returns an array containing all the signatures of the output arguments that were requested in this invocation.
Signatures begining with the '#' character are references to arguments of the method, they are followed by a number indicating the index of that argument, or with an 'R' signaling that the return value from the method is expected.
This are all valid output argument signatures:
   #1
   #R
   #24
 
All other signatures reference attributes of the target component, and should be passed to Invokeable.getAttribute() to obtain the actual value.
The array is an Object[] , although it only contains Strings, so the signatures can be replaced by the actual values.
All getters must be executed after the method execution.

Returns:
An array containing output argument signatures

getSignature

public String getSignature()
Returns the signature of the method this invocation references.

Returns:
the signature of the method this invocation references

isSynchronous

public boolean isSynchronous()
Returns true if this method execution is synchronous.

Returns:
true if this method execution is synchronous.

doInvoke

public Object doInvoke(Object[] args)
                throws ComponentExecutionException
Invokes the actual method.

Parameters:
args - arguments as returned by doPreInvoke().
Returns:
the return value of the method.
Throws:
fuego.lang.ComponentExecutionException - if the method does so.
ComponentExecutionException

doPostInvoke

public Object[] doPostInvoke(Object[] methodArgs,
                             Object retVal)
Does all post invocation processing (calling getters and processing output arguments)

Parameters:
methodArgs - method arguments after being passed to Invokeable.invoke(signature, arguments)
retVal - return value of Invokeable.invoke(signature, arguments)
Returns:
An Object[] suitable to be passed to Execution.setInvocationResult(Object[]).

doPreInvoke

public Object[] doPreInvoke()
Performs pre-invocation argument processing. This includes sorting arguments, leaving space for output arguments in the argument array.

Returns:
an object array suitable to be passed to Invokeable.invoke(signature, arguments)

invoke

public Object[] invoke()
                throws Exception
Performs a default execution of this invocation, returning an Object[] suitable to be passed to fuego.component.CustomExecution.setInvocationResult(Object[]).
 InvocationImpl inv;
 ...
 //Calling
 Object[] result = inv.invoke();
 //Is the same than:
 Object[] args = inv.doPreInvoke();
 Object retval = inv.doInvoke(args);
 Object[] result = inv.doPostInvoke(args, retval);
 

Returns:
result of the method invocation to be passed to fuego.component.CustomExecution.setInvocationResult(Object[]).
Throws:
Exception - if the invocation failed (it should be passed to fuego.component.CustomExecution.setException(Throwable)).

ALBPM Process API (PAPI)

© Copyright 1996/2005 Fuego Inc. All Rights Reserved