uk.org.ogsadai.activity.indexedfiles
Class FileReadingActivity
java.lang.Object
|
+--uk.org.ogsadai.engine.Activity
|
+--uk.org.ogsadai.activity.files.AbstractFileActivity
|
+--uk.org.ogsadai.activity.indexedfiles.FileReadingActivity
- public class FileReadingActivity
- extends AbstractFileActivity
This activity reads bytes from a RandomAccessFile or lines from a
text file. The file name and the bytes/lines to be read can be
specified in the perform document or read from an input stream.
The output can be connected to another activity e.g. a delivery
activity.
- Author:
- The OGSA-DAI Project Team
|
Method Summary |
protected void |
cleanUp()
This method can be overridden by any Activity
implementations that need to free up resources in the event of an error
or intermediate termination of the activity processing. |
protected void |
initialise()
Perform some checks on the connection managers's configuration,
including whether the connection manager is a
FileSystemConnectionManager and the top-level
directory exists and really is a directory. |
protected void |
processBlock()
Performs an iteration of the processing of an activity. |
protected void |
processFirst()
This method is called during the first iteration of processing an
activity. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileReadingActivity
public FileReadingActivity(org.w3c.dom.Element element)
throws ActivitySystemException,
ActivityUserException
initialise
protected void initialise()
throws ActivitySystemException,
ActivityUserException
- Description copied from class:
AbstractFileActivity
- Perform some checks on the connection managers's configuration,
including whether the connection manager is a
FileSystemConnectionManager and the top-level
directory exists and really is a directory. It exposes this directory
in the protected field mTopDir which sub-classes should
use in order to obtain the context within which their file access
may occur.
Sub-classes may override this method if they want to perform
additional initialisation, but should call super.initialise()
to ensure that the checks contained here are executed.
- Overrides:
initialise in class AbstractFileActivity
- Throws:
ActivityUserException - If there is a user problem intialising the activity, like
the top-level directory specified in the connection
configuration does not exist.
ActivitySystemException - If there is a problem intialising the activity, like not
using the FileSystemConnectionManager
connection manager.
processFirst
protected void processFirst()
- Description copied from class:
Activity
- This method is called during the first iteration of processing an
activity. It can be overridden by subclasses to define some processing
that should be done only once during the first iteration of the activity
processing, for example evaluating a database query.
- Overrides:
processFirst in class Activity
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
cleanUp
protected void cleanUp()
- Description copied from class:
Activity
- This method can be overridden by any
Activity
implementations that need to free up resources in the event of an error
or intermediate termination of the activity processing.
- Overrides:
cleanUp in class Activity