uk.org.ogsadai.engine
Class DataStoreActivity
java.lang.Object
|
+--uk.org.ogsadai.engine.Activity
|
+--uk.org.ogsadai.engine.DataStoreActivity
- public class DataStoreActivity
- extends Activity
The DataStoreActivity acts as a cache of data from which other
activities can retrieve blocks at their own convenience. There are 2
different modes of operation:
-
one input - the activity reads all the data from the input as soon
as possible. Other activities can then read this data from the output.
-
no input - data is hard-coded into the perform document in blocks.
Other activities can read this data from the output.
The DataStoreActivity is particularly useful for requests
containing a database query connected to an asynchronous delivery activity
such as deliverToStream. Under normal circumstances the database query will
not be evaluated until the consumer of the asynchronous delivery begins
consumption. A DataStoreActivity can be connected between the
database query and asynchrnonous delivery activity to ensure that the
database query is evaluated immediately, rather than waiting the consumer of
the asynchronous delivery begins consumption.
Note that at the moment the actual cache implementation is simply an
ArrayList accessed through an iterator. For large amounts of
data this is likely to generate an OutOfMemoryError. In the
future this could be modified to use some kind of semi-persistent storage.
- Author:
- The OGSA-DAI Project Team
|
Constructor Summary |
DataStoreActivity(org.w3c.dom.Element element)
Constructs the DataStoreActivity activity using the
specified activity element. |
|
Method Summary |
void |
initialise()
This method can be overridden by subclasses to perform any initialisation
they require before the process method iterations begin. |
protected void |
processBlock()
Performs an iteration of the processing of an activity. |
| Methods inherited from class uk.org.ogsadai.engine.Activity |
cleanUp, connectsTo, getActivityConfiguration, getName, getObservableStatus, getProperties, getStatus, hasActivityConfiguration, hasProperties, processFirst, setCompleted, setError |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DataStoreActivity
public DataStoreActivity(org.w3c.dom.Element element)
throws ActivitySystemException,
ActivityUserException
- Constructs the
DataStoreActivity activity using the
specified activity element. This may contain a sequence of hard-coded
items or may reference the output of another activity.
- Parameters:
element - the element to configure the activity with
processBlock
protected void processBlock()
- Description copied from class:
Activity
- Performs an iteration of the processing of an activity. This may involve
reading a block of input data and writing a block of output data, or may
involve some other kind of processing. When an activity is processed by
the OGSA-DAI engine, this method will be invoked repeatedly until the
activity either completes or stops due to an error or termination call.
An implementation of this method should invoke the
setCompleted method to indicate that processing is complete,
or the setError method if an error occurs that will prevent
the processing from completing.
- Specified by:
processBlock in class Activity
initialise
public void initialise()
throws ActivityUserException
- Description copied from class:
Activity
- This method can be overridden by subclasses to perform any initialisation
they require before the
process method iterations begin.
This might be used for setting up convenient fields to reference objects
contained in the context. It shouldn't be used for opening resources.
That should be done in processFirst.
- Overrides:
initialise in class Activity
- Throws:
ActivityUserException - If a user problem prevents the activity from
initialising.