uk.org.ogsadai.activity
Class RequestProcessor

java.lang.Object
  |
  +--uk.org.ogsadai.activity.RequestProcessor

class RequestProcessor
extends java.lang.Object

Processes the end-point activities of a request, driving the execution of any chained activities. If there is only one end-point activity, then the execution is performed using the same thread that invokes the process method, otherwise a new thread is spawned to process each end-point activity.

Author:
The OGSA-DAI Project Team

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
          Copyright statement.
private  java.util.List mEndPoints
          A list of the end-point activities.
 
Constructor Summary
(package private) RequestProcessor(java.util.List endPoints)
          Constructor.
 
Method Summary
 void process()
          Processes the end-point activity or activities, driving the execution of the request.
private static void processActivity(Activity activity)
          Processes the specified activity until it is finished.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
Copyright statement.

See Also:
Constant Field Values

mEndPoints

private final java.util.List mEndPoints
A list of the end-point activities.

Constructor Detail

RequestProcessor

RequestProcessor(java.util.List endPoints)
Constructor.

Parameters:
endPoints - List of end point Activity objects.
Method Detail

process

public void process()
Processes the end-point activity or activities, driving the execution of the request. Note that this method returns when the end-point activity is finished (i.e. COMPLETED, ERROR, TERMINATED) and in certain error conditions, chained activities may not have completed. These activities will have to have their error status set manually.


processActivity

private static void processActivity(Activity activity)
Processes the specified activity until it is finished.

If a Throwable should inadvertently occur during the activity's process method, catch it, wrap it in an ActivityExecutionException and instruct the activity to save a reference using its setError method.

Parameters:
activity - activity to process.