org.globus.exec.service.exec
Class PersistentManagedExecutableJobResource

java.lang.Object
  extended byorg.globus.wsrf.impl.ReflectionResource
      extended byorg.globus.rendezvous.service.RendezvousResourceImpl
          extended byorg.globus.exec.service.job.ManagedJobResourceImpl
              extended byorg.globus.exec.service.exec.ManagedExecutableJobResource
                  extended byorg.globus.exec.service.exec.PersistentManagedExecutableJobResource
All Implemented Interfaces:
DirtyFlagHolder, ManagedJobResource, PersistenceCallback, PersistentManagedJobResource, PersistentResource, RemoveCallback, org.globus.rendezvous.service.RendezvousResource, Resource, ResourceIdentifier, ResourceLifetime, ResourceProperties, SecureResource, TopicListAccessor

public class PersistentManagedExecutableJobResource
extends ManagedExecutableJobResource
implements PersistentManagedJobResource


Field Summary
private  boolean dirty
          The dirty flag is set to true at instanciation time, so that the initial creator of the resource just needs to call store in order to actually persist the new resource for the first time.
private  java.lang.Object dirtyCond
           
private static org.globus.util.I18n i18n
           
private static org.apache.commons.logging.Log logger
           
private  PersistenceHelper persistenceHelper
           
private static javax.xml.namespace.QName WHOLE_STATE_ELEMENT
           
 
Fields inherited from class org.globus.exec.service.exec.ManagedExecutableJobResource
jobMonitor
 
Fields inherited from class org.globus.exec.service.job.ManagedJobResourceImpl
 
Fields inherited from class org.globus.rendezvous.service.RendezvousResourceImpl
 
Fields inherited from class org.globus.wsrf.impl.ReflectionResource
 
Constructor Summary
PersistentManagedExecutableJobResource()
           
 
Method Summary
protected  ResourceProperty createNewResourceProperty(javax.xml.namespace.QName rpQName, java.lang.Object resourceBean)
           
 boolean getDirty()
           
private  PersistenceHelper getPersistenceHelper()
           
 javax.xml.namespace.QName getResourcePropertiesQName()
           
 java.lang.Object getWholeState()
          Called by PersistenceHelper when store() is called
 javax.xml.namespace.QName getWholeStateQName()
           
 java.lang.Class getWholeStateType()
           
 void initializeWholeState(java.lang.Object wholeResourceState, javax.xml.namespace.QName resourceElementQName, java.lang.Object key)
          Initialize the whole state of the resource.
 void load(ResourceKey key)
           If the resource was successfully loaded, its dirty flag is set to false.
 void remove()
           
 void setDirty(boolean changed)
          Sets the dirty flag on this persistent object.
 void setFault(FaultType fault)
           
 void setInternalState(InternalStateEnumeration internalState)
           
 void setResourceDatum(java.lang.String name, java.lang.Object value)
           
 void setResourceProperty(javax.xml.namespace.QName name, java.lang.Object value)
           
 void setState(StateEnumeration state)
           
 void store()
           If the resource was successfully stored, its dirty flag is set to false.
 
Methods inherited from class org.globus.exec.service.exec.ManagedExecutableJobResource
envVarAlreadySet, getFileSystemMapping, getInternalState, getJobDirectory, getJobStateMonitor, getLogger, getPerlJobDescription, getReliableFileTransferFactoryEndpoint, getScript, getScriptEnvironment, getSecurityDescriptor, getStateTransitionMutex, getUserGlobusDirectory, initialize, initializeTopics, initSecurity, resolveVariables, setPerlJobDescription, setScript, setScriptEnvironment, start
 
Methods inherited from class org.globus.exec.service.job.ManagedJobResourceImpl
getFault, getJobCredential, getJobDescription, getResourceData, getResourceDatum, getResourceProperty, getStagingCredential, getState, setJobDescription, setResourceData, setResourceDatum, setResourceDatum, setResourceProperty
 
Methods inherited from class org.globus.rendezvous.service.RendezvousResourceImpl
createNewResourceProperty, getInternalRendezvousState, getTopicList, isFull, register, setInternalRendezvousState
 
Methods inherited from class org.globus.wsrf.impl.ReflectionResource
getCurrentTime, getID, getResourceBean, getResourcePropertySet, getTerminationTime, setTerminationTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.globus.exec.service.job.ManagedJobResource
getResourceData, getResourceDatum, getState, setResourceData, start
 
Methods inherited from interface org.globus.wsrf.ResourceProperties
getResourcePropertySet
 
Methods inherited from interface org.globus.wsrf.ResourceIdentifier
getID
 
Methods inherited from interface org.globus.wsrf.TopicListAccessor
getTopicList
 

Field Detail

logger

private static org.apache.commons.logging.Log logger

i18n

private static org.globus.util.I18n i18n

dirty

private boolean dirty
The dirty flag is set to true at instanciation time, so that the initial creator of the resource just needs to call store in order to actually persist the new resource for the first time.


dirtyCond

private java.lang.Object dirtyCond

WHOLE_STATE_ELEMENT

private static final javax.xml.namespace.QName WHOLE_STATE_ELEMENT

persistenceHelper

private PersistenceHelper persistenceHelper
Constructor Detail

PersistentManagedExecutableJobResource

public PersistentManagedExecutableJobResource()
Method Detail

setResourceProperty

public void setResourceProperty(javax.xml.namespace.QName name,
                                java.lang.Object value)
Overrides:
setResourceProperty in class ManagedJobResourceImpl

setResourceDatum

public void setResourceDatum(java.lang.String name,
                             java.lang.Object value)
Specified by:
setResourceDatum in interface ManagedJobResource
Overrides:
setResourceDatum in class ManagedJobResourceImpl

initializeWholeState

public void initializeWholeState(java.lang.Object wholeResourceState,
                                 javax.xml.namespace.QName resourceElementQName,
                                 java.lang.Object key)
                          throws ResourceException
Description copied from interface: ManagedJobResource
Initialize the whole state of the resource. Called by the Home or the persistence layer.

The implementation must call initialize().

Specified by:
initializeWholeState in interface ManagedJobResource
Overrides:
initializeWholeState in class ManagedExecutableJobResource
Throws:
ResourceException

setFault

public void setFault(FaultType fault)
Overrides:
setFault in class ManagedJobResourceImpl

setState

public void setState(StateEnumeration state)
              throws java.lang.Exception
Specified by:
setState in interface ManagedJobResource
Overrides:
setState in class ManagedExecutableJobResource
Throws:
java.lang.Exception

getWholeStateType

public java.lang.Class getWholeStateType()
Specified by:
getWholeStateType in interface PersistentManagedJobResource

getWholeStateQName

public javax.xml.namespace.QName getWholeStateQName()
Specified by:
getWholeStateQName in interface PersistentManagedJobResource

getResourcePropertiesQName

public javax.xml.namespace.QName getResourcePropertiesQName()
Specified by:
getResourcePropertiesQName in interface PersistentManagedJobResource

getWholeState

public java.lang.Object getWholeState()
Called by PersistenceHelper when store() is called

Specified by:
getWholeState in interface PersistentManagedJobResource
Returns:
Object the whole serializable state of the resource

store

public void store()
           throws ResourceException

If the resource was successfully stored, its dirty flag is set to false.

Postcondition getDirty() == false

Specified by:
store in interface PersistenceCallback
Throws:
ResourceException - if the resource could not be stored
See Also:
setDirty()

load

public void load(ResourceKey key)
          throws ResourceException

If the resource was successfully loaded, its dirty flag is set to false.

Postcondition getDirty() == false

Specified by:
load in interface PersistenceCallback
Throws:
ResourceException
See Also:
setDirty()

remove

public void remove()
            throws ResourceException
Specified by:
remove in interface RemoveCallback
Overrides:
remove in class ManagedExecutableJobResource
Throws:
ResourceException

getPersistenceHelper

private PersistenceHelper getPersistenceHelper()
                                        throws ResourceException
Throws:
ResourceException

createNewResourceProperty

protected ResourceProperty createNewResourceProperty(javax.xml.namespace.QName rpQName,
                                                     java.lang.Object resourceBean)
                                              throws java.lang.Exception
Throws:
java.lang.Exception

setDirty

public void setDirty(boolean changed)
Sets the dirty flag on this persistent object. The resource will not be persisted unless it the firty flag is true.

Specified by:
setDirty in interface DirtyFlagHolder
Parameters:
changed - boolean To flag the resource as changed i.e. "dirty" and have it persisted by the next invocation of store

getDirty

public boolean getDirty()
Specified by:
getDirty in interface DirtyFlagHolder

setInternalState

public void setInternalState(InternalStateEnumeration internalState)
                      throws ResourceException
Overrides:
setInternalState in class ManagedExecutableJobResource
Throws:
ResourceException