org.edg.info
Class DeclarableInstance

java.lang.Object
  extended byorg.edg.info.InstanceBase
      extended byorg.edg.info.DeclarableInstance
Direct Known Subclasses:
InsertableInstance, OnDemandProducerInstance

public abstract class DeclarableInstance
extends InstanceBase

Supports "Declarable" behaviour: declaring and registering tables.


Field Summary
 
Fields inherited from class org.edg.info.InstanceBase
DEFAULT_TERMINATION_INTERVAL_MS, s_maxTerminationInterval, s_minTerminationInterval
 
Method Summary
 void declareTable(java.lang.String tableName, java.lang.String predicate)
          Declares the table in the Schema.
 void destroy()
           
 org.glite.rgma.system.ProducerType getProducerType()
           
 void undeclareTable(java.lang.String tableName)
          Contacts registry to undeclare given table.
 boolean updateRegistry(long currentTime, boolean isRegistryDown)
          Attempts to update the termination interval for a producer resource.
 
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
 

Method Detail

destroy

public void destroy()

declareTable

public void declareTable(java.lang.String tableName,
                         java.lang.String predicate)
                  throws org.glite.rgma.system.RGMAUserException,
                         org.glite.rgma.system.RGMAInternalException
Declares the table in the Schema. If the table does not exist, the table is declared as normal. If the table exists in the Schema a check is made with the provided table description.

Parameters:
tableName - the table name to be declared.
predicate - the predicate to be used.
Throws:
org.glite.rgma.system.RGMAException - If unable to declare the table.
org.glite.rgma.system.RGMAUserException
org.glite.rgma.system.RGMAInternalException

undeclareTable

public void undeclareTable(java.lang.String tableName)
                    throws org.glite.rgma.system.RGMAException
Contacts registry to undeclare given table.

Parameters:
tableName - Name of table to undeclare
Throws:
org.glite.rgma.system.RGMAException

updateRegistry

public boolean updateRegistry(long currentTime,
                              boolean isRegistryDown)
                       throws org.glite.rgma.system.RGMAException,
                              org.glite.rgma.system.RemoteException
Attempts to update the termination interval for a producer resource. If no registries can be contacted, a flag is set and a retry update is sent at shorter intervals. When the registry returns the tables are re-registered if necessary.

Overrides:
updateRegistry in class InstanceBase
Parameters:
currentTime - Current time in millis.
isRegistryDown - Flag indicating if the Registry was down on the last call.
Returns:
Flag indicating if the Registry could not be contacted on this call.
Throws:
org.glite.rgma.system.RemoteException
org.glite.rgma.system.RGMAException

getProducerType

public org.glite.rgma.system.ProducerType getProducerType()
Returns:
Returns the producer type of the insertable.