uk.org.ogsadai.activity
Class ResultActivity

java.lang.Object
  |
  +--uk.org.ogsadai.activity.Activity
        |
        +--uk.org.ogsadai.activity.ResultActivity

class ResultActivity
extends Activity

This is a special kind of activity used internally for processing any dangling outputs. A dangling output contained in a request that is that is not connected to the input of another activity in the request. The data processed by into these outputs is the data that is returned to the user in the response document.

Author:
The OGSA-DAI Project Team

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.StringBuffer mBuffer
          Data written into here if it is strings.
private  java.io.ByteArrayOutputStream mByteArrayOutputStream
          Data written into here if it is bytes.
private  BlockReader mInput
          Data is read from here.
 
Fields inherited from class uk.org.ogsadai.activity.Activity
mContext, mExternalInputs, mExternalOutputs, mInternalInputs, mInternalOutputs
 
Constructor Summary
(package private) ResultActivity(java.lang.String name, BlockReader input)
          Constructs an activity for a dangling output that will generate the data to be contained in the response.
 
Method Summary
 byte[] getResultData()
          Gets the result data that has been generated by up-stream activities.
 void processBlock()
          Performs an iteration of the processing of an activity.
 
Methods inherited from class uk.org.ogsadai.activity.Activity
cleanUp, configureContext, connectsTo, createOutputPipe, getActivityConfiguration, getActivityName, getAllOutputs, getCause, getExternalInputs, getExternalOutputs, getInputs, getName, getObservableStatus, getOutputs, getProperties, getSession, getStatus, hasActivityConfiguration, hasProperties, initialise, process, processFirst, setActivityConfiguration, setActivityName, setCompleted, setError, setProperties, terminate
 
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

LOG

private static final DAILogger LOG
Logger object for logging in this class


mInput

private final BlockReader mInput
Data is read from here.


mBuffer

private final java.lang.StringBuffer mBuffer
Data written into here if it is strings.


mByteArrayOutputStream

private final java.io.ByteArrayOutputStream mByteArrayOutputStream
Data written into here if it is bytes.

Constructor Detail

ResultActivity

ResultActivity(java.lang.String name,
               BlockReader input)
Constructs an activity for a dangling output that will generate the data to be contained in the response.

Parameters:
name - Activity name.
input - A BlockReader for a dangling output. This must contain only blocks of String, org.w3c.dom.Node or byte[] data.
Method Detail

processBlock

public 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

getResultData

public final byte[] getResultData()
Gets the result data that has been generated by up-stream activities. This should be called after processing for the activity has completed.

Returns:
a StringBuffer containing the result data.