| java.lang.Object de.danet.an.workflow.api.MethodInvocationBatch
MethodInvocationBatch | public class MethodInvocationBatch implements Batch,Serializable(Code) | | This class provides a
Batch Batch implementation that executes several invocations of remote objects
on the server in a single transaction and returns the results. This
class can be thought of as a "generic DTO".
author: version: $Revision: 1.5 $ |
Method Summary | |
public void | addInvocation(Object obj, String method, String[] argTypes, Object[] args) Adds a method invocation to the batch.
Parameters: obj - the objects whose method is to be invoked. Parameters: method - the method name. Parameters: argTypes - the argument types as strings suitable forClassLoader.loadClass . | public void | addInvocation(int result, String method, String[] argTypes, Object[] args, boolean discard) Adds a method invocation on a previous result to the batch. | public Object | execute(Context ctx) Executes the registered method invocations one by one in a
single transaction. |
MethodInvocationBatch | public MethodInvocationBatch()(Code) | | Create a new empty method invocation batch. Equivalent to
MethodInvocationBatch(false) .
|
MethodInvocationBatch | public MethodInvocationBatch(boolean stopOnException)(Code) | | Create a new empty method invocation batch. The flag passed as
parameter controls if an exception stops the batch execution.
Parameters: stopOnException - if true execution isinterrupted on the first encountered exception |
addInvocation | public void addInvocation(Object obj, String method, String[] argTypes, Object[] args)(Code) | | Adds a method invocation to the batch.
Parameters: obj - the objects whose method is to be invoked. Parameters: method - the method name. Parameters: argTypes - the argument types as strings suitable forClassLoader.loadClass . May be null which is interpreted as "no parameters". Parameters: args - the actual arguments. May be null which is interpreted as "no parameters". |
addInvocation | public void addInvocation(int result, String method, String[] argTypes, Object[] args, boolean discard)(Code) | | Adds a method invocation on a previous result to the batch.
Parameters: result - relative index of the result to be usedfor method invovation, i.e. -1 is the previous result. Parameters: method - the method name. Parameters: argTypes - the argument types as strings suitable forClassLoader.loadClass . May be null which is interpreted as "no parameters". Parameters: args - the actual arguments. May be null which is interpreted as "no parameters". Parameters: discard - if true the referenced result willbe removed from the result list. |
execute | public Object execute(Context ctx)(Code) | | Executes the registered method invocations one by one in a
single transaction. Note that execution is terminated if an
invoked method sets rollback only.
Parameters: ctx - the execution context. the execution result, which is of type ResultResult . |
|
|