|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.org.ogsadai.engine.controlflow.CompositeRequestComponent | +--uk.org.ogsadai.engine.controlflow.FlowRequestComponent
A composite RequestComponent
that contains a number of
child components which will be processed concurrently when
the process
method is invoked.
Field Summary | |
private static java.lang.String |
COPYRIGHT_NOTICE
Copyright statement. |
private static DAILogger |
LOG
Logger object for logging in this class. |
private java.lang.Exception |
mCause
The exception that caused the processing to fail. |
private java.lang.String |
mName
Unique name of this flow request component. |
private java.util.List |
mThreads
The additional threads spawned to process child 2 to n. |
Fields inherited from class uk.org.ogsadai.engine.controlflow.CompositeRequestComponent |
|
Constructor Summary | |
FlowRequestComponent(java.lang.String name)
Constructor |
Method Summary | |
private boolean |
hasException()
Was there an exception raised during processing? |
private void |
joinThreads()
Joins any additional threads that were spawned. |
void |
process(ActivityContext context,
ResponseBuilder responseBuilder)
Processes the component. |
private void |
raiseException()
If an exception was raised during processing then throw it now. |
private void |
reportException(java.lang.Exception cause,
ResponseBuilder responseBuilder)
Invoked when an exception is raised by one of the processing threads. |
private void |
spawnThreads(java.util.List children,
ActivityContext context,
ResponseBuilder responseBuilder)
This will spawn any additional processing threads that are needed. |
void |
terminate()
Terminates the processing of the request component. |
Methods inherited from class uk.org.ogsadai.engine.controlflow.CompositeRequestComponent |
add, children, generatesResultData, initialise |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface uk.org.ogsadai.engine.controlflow.RequestComponent |
add, children, generatesResultData, initialise |
Field Detail |
private static final java.lang.String COPYRIGHT_NOTICE
private static final DAILogger LOG
private java.util.List mThreads
private java.lang.Exception mCause
private final java.lang.String mName
Constructor Detail |
public FlowRequestComponent(java.lang.String name)
name
- Unique name of this flow request component.Method Detail |
public void process(ActivityContext context, ResponseBuilder responseBuilder) throws RequestSpecificationException, RequestExecutionException
RequestComponent
terminate
method by another thread. Hence,
when this method returns processing will be either complete or
terminated.
process
in interface RequestComponent
context
- The context for the requestresponseBuilder
- The response builder for assembling the response document
during processing
RequestExecutionException
- If a problem occurs during processing that is not
caused by incorrect information in the request.
RequestSpecificationException
- If there is a processing problem caused by incorrect
information in the request.private void spawnThreads(java.util.List children, ActivityContext context, ResponseBuilder responseBuilder)
mThreads
attribute
will be populated.
children
- Child components of the flow request component.context
- Execution context for activity execution.responseBuilder
- Response document builder - used to handle insertion of
information about processing results and exceptions.private void joinThreads()
private void reportException(java.lang.Exception cause, ResponseBuilder responseBuilder)
cause
- Exception raised by processing thread.responseBuilder
- Response document builder - used to handle insertion of
information about the exception.private boolean hasException()
true
if an exception was raised,
false
otherwise.private void raiseException() throws RequestSpecificationException, RequestExecutionException
RequestExecutionException
- if that was the exception raised during processing.
RequestSpecificationException
- if that was the exception raised during processing.public void terminate()
RequestComponent
terminate
in interface RequestComponent
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |