uk.org.ogsadai.activity.sql
Class SQLQueryMultipleActivity

java.lang.Object
  |
  +--uk.org.ogsadai.activity.Activity
        |
        +--uk.org.ogsadai.activity.sql.SQLQueryMultipleActivity
Direct Known Subclasses:
SQLBagActivity, SQLResilientQueryActivity

public abstract class SQLQueryMultipleActivity
extends Activity

This is abstract class for activities which query multiple relational resources e.g. SQLResilientQueryActivity and SQLBagActivity.

The activity's perform document is defined by schema/ogsadai/xsd/activities/sql_query_multiple.xsd.

The activity calls multiple data service resources each one being executed in its own thread.

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.
protected  long mClientTimeout
          Timeout in millisecond set by client: 0 for unlimited, -1 for n/a else a long.
protected  DataServiceInfo[] mMultipleDS
          Information about each data service and data service resource
protected  BlockWriter mOutput
          Activity output - WebRowSet containing result
protected  java.lang.String mOutputString
          The merged query result
protected  java.lang.String mSqlStatement
          SQL query statement from request
protected  boolean mTimeoutStatus
          Indicator of whether a thread has timed out or not
protected  java.util.Timer mTimer
          The timer that will be used by the threads to check the timout.
 
Fields inherited from class uk.org.ogsadai.activity.Activity
mContext, mExternalInputs, mExternalOutputs, mInternalInputs, mInternalOutputs
 
Constructor Summary
SQLQueryMultipleActivity(org.w3c.dom.Element element)
           
 
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.
 void initialise()
          This method should be overridden by subclasses to perform any initialisation they require before the process method invocations begin.
(package private)  boolean isTimeout()
          Check if the thread of each of the data service resources has timed out.
(package private)  void setTimeout(boolean status)
          Set the time out of each of the data service resources has timed out.
 
Methods inherited from class uk.org.ogsadai.activity.Activity
connectsTo, createOutputPipe, getActivityConfiguration, getActivityName, getCause, getName, getObservableStatus, getProperties, getSession, getStatus, hasActivityConfiguration, hasProperties, process, processBlock, processFirst, setActivityName, setCompleted, setError
 
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.


mOutput

protected BlockWriter mOutput
Activity output - WebRowSet containing result


mSqlStatement

protected java.lang.String mSqlStatement
SQL query statement from request


mOutputString

protected java.lang.String mOutputString
The merged query result


mMultipleDS

protected DataServiceInfo[] mMultipleDS
Information about each data service and data service resource


mClientTimeout

protected long mClientTimeout
Timeout in millisecond set by client: 0 for unlimited, -1 for n/a else a long.


mTimer

protected java.util.Timer mTimer
The timer that will be used by the threads to check the timout.


mTimeoutStatus

protected boolean mTimeoutStatus
Indicator of whether a thread has timed out or not

Constructor Detail

SQLQueryMultipleActivity

public SQLQueryMultipleActivity(org.w3c.dom.Element element)
                         throws ActivitySpecificationException,
                                ActivityCreationException
Method Detail

isTimeout

boolean isTimeout()
Check if the thread of each of the data service resources has timed out.

Returns:
true if so, false if not.

setTimeout

void setTimeout(boolean status)
Set the time out of each of the data service resources has timed out.

Parameters:
status - true if so, false if not.

initialise

public void initialise()
                throws ActivitySpecificationException,
                       ActivityExecutionException
Description copied from class: Activity
This method should be overridden by subclasses to perform any initialisation they require before the process method invocations 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:
ActivityExecutionException - If some system problem prevents the activity from initialising.
ActivitySpecificationException - If a problem with settings provided by a client prevents the activity from initialising.

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