org.edg.info
Class OnDemandProducerInstance

java.lang.Object
  extended byorg.edg.info.InstanceBase
      extended byorg.edg.info.DeclarableInstance
          extended byorg.edg.info.OnDemandProducerInstance

public class OnDemandProducerInstance
extends DeclarableInstance

OnDemandProducer.


Nested Class Summary
 class OnDemandProducerInstance.ExecuteThread
          Thread used to execute a single one-time query on this producer.
 
Field Summary
 
Fields inherited from class org.edg.info.InstanceBase
DEFAULT_TERMINATION_INTERVAL_MS, s_maxTerminationInterval, s_minTerminationInterval
 
Constructor Summary
OnDemandProducerInstance(org.edg.info.system.Registry registry, org.edg.info.system.Schema schema, int port, java.lang.String hostName, org.edg.info.system.ServletConnection connection, int terminationIntervalSec)
          Creates a new OnDemandProducer instance with the specified attributes.
 
Method Summary
 void abort(org.glite.rgma.system.ResourceEndpoint consumer)
          Aborts streaming to the specified consumer.
 void destroy()
           
 java.lang.String execute(java.lang.String select, int timeoutSec)
          Executes an SQL SELECT query on the user code and returns a result String.
 java.lang.String getHostname()
           
 int getPortNumber()
           
 void start(java.lang.String select, org.glite.rgma.system.QueryProperties queryProps, int timeoutSec, org.glite.rgma.system.ResourceEndpoint consumer, org.glite.rgma.system.StreamingProperties streamingProps, java.lang.String qosAttrib)
          Starts streaming data from the user code to the specified consumer.
 
Methods inherited from class org.edg.info.DeclarableInstance
declareTable, getProducerType, undeclareTable, updateRegistry
 
Methods inherited from class org.edg.info.InstanceBase
canDestroy, disconnect, getLastRegistryUpdateTimeMillis, getRegistryUpdateIntervalMillis, getResourceId, getStatus, getTerminationInterval, getTerminationIntervalMillis, getUserLastContactTimeMillis, isDestroyed, isTupleCheckingEnabled, notifyRegistrationThread, reconnect, setCloseCalled, setDestroyed, setRegistrationThread, setTerminationInterval, showSignOfLife, updateLastContactTime, wasCloseCalled
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OnDemandProducerInstance

public OnDemandProducerInstance(org.edg.info.system.Registry registry,
                                org.edg.info.system.Schema schema,
                                int port,
                                java.lang.String hostName,
                                org.edg.info.system.ServletConnection connection,
                                int terminationIntervalSec)
                         throws org.glite.rgma.system.RGMAInternalException,
                                org.glite.rgma.system.RGMAUserException
Creates a new OnDemandProducer instance with the specified attributes.

Parameters:
registry - API to access Registry.
schema - API to access Schema.
port - Port for user code.
hostName - Host name for user code.
connection - This producer's servlet connection.
terminationIntervalSec - Termination interval (in seconds).
Throws:
org.glite.rgma.system.RGMAInternalException
org.glite.rgma.system.RGMAUserException
Method Detail

destroy

public void destroy()
Overrides:
destroy in class DeclarableInstance

execute

public java.lang.String execute(java.lang.String select,
                                int timeoutSec)
                         throws org.glite.rgma.system.RGMAInternalException
Executes an SQL SELECT query on the user code and returns a result String.

Parameters:
select - SQL query.
timeoutSec - Query timeout in seconds.
Returns:
The result String returned by the user code.
Throws:
org.glite.rgma.system.RGMAInternalException

start

public void start(java.lang.String select,
                  org.glite.rgma.system.QueryProperties queryProps,
                  int timeoutSec,
                  org.glite.rgma.system.ResourceEndpoint consumer,
                  org.glite.rgma.system.StreamingProperties streamingProps,
                  java.lang.String qosAttrib)
           throws org.glite.rgma.system.RGMAInternalException
Starts streaming data from the user code to the specified consumer.

Parameters:
select - SQL SELECT statement.
queryProps - Query properties.
timeoutSec - Query timeout in seconds.
consumer - Consumer making query.
streamingProps - Streaming server to stream to.
qosAttrib - Quality of service attribute.
Throws:
org.glite.rgma.system.RGMAException - If the data can not be written to the consumer streaming server.
org.glite.rgma.system.RGMAInternalException

abort

public void abort(org.glite.rgma.system.ResourceEndpoint consumer)
Aborts streaming to the specified consumer.

Parameters:
consumer - Consumer to stop streaming to.

getPortNumber

public int getPortNumber()
Returns:
The port number of the ODP.

getHostname

public java.lang.String getHostname()
Returns:
The hostname of the ODP.