|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.danet.an.workflow.api.MethodInvocationBatch
This class provides a
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".
Batch
Nested Class Summary | |
class |
MethodInvocationBatch.Result
The result of an execution of this kind of batch. |
Nested classes inherited from class de.danet.an.workflow.api.Batch |
Batch.Context |
Constructor Summary | |
MethodInvocationBatch()
Create a new empty method invocation batch. |
|
MethodInvocationBatch(boolean stopOnException)
Create a new empty method invocation batch. |
Method Summary | |
void |
addInvocation(int result,
java.lang.String method,
java.lang.String[] argTypes,
java.lang.Object[] args,
boolean discard)
Adds a method invocation on a previous result to the batch. |
void |
addInvocation(java.lang.Object obj,
java.lang.String method,
java.lang.String[] argTypes,
java.lang.Object[] args)
Adds a method invocation to the batch. |
java.lang.Object |
execute(Batch.Context ctx)
Executes the registered method invocations one by one in a single transaction. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MethodInvocationBatch()
MethodInvocationBatch(false)
.
public MethodInvocationBatch(boolean stopOnException)
stopOnException
- if true
execution is
interrupted on the first encountered exceptionMethod Detail |
public void addInvocation(java.lang.Object obj, java.lang.String method, java.lang.String[] argTypes, java.lang.Object[] args)
obj
- the objects whose method is to be invoked.method
- the method name.argTypes
- the argument types as strings suitable for
ClassLoader.loadClass
. May be null
which is interpreted as "no parameters".args
- the actual arguments. May be null
which is interpreted as "no parameters".public void addInvocation(int result, java.lang.String method, java.lang.String[] argTypes, java.lang.Object[] args, boolean discard)
result
- relative index of the result to be used
for method invovation, i.e. -1
is the previous result.method
- the method name.argTypes
- the argument types as strings suitable for
ClassLoader.loadClass
. May be null
which is interpreted as "no parameters".args
- the actual arguments. May be null
which is interpreted as "no parameters".discard
- if true
the referenced result will
be removed from the result list.public java.lang.Object execute(Batch.Context ctx)
execute
in interface Batch
ctx
- the execution context.
Result
.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |