org.globus.exec.service.multi
Class PersistentManagedMultiJobResource

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.multi.ManagedMultiJobResource
                  extended byorg.globus.exec.service.multi.PersistentManagedMultiJobResource
All Implemented Interfaces:
DirtyFlagHolder, ManagedJobResource, NotifyCallback, PersistenceCallback, PersistentManagedJobResource, PersistentResource, RemoveCallback, org.globus.rendezvous.service.RendezvousResource, Resource, ResourceIdentifier, ResourceLifetime, ResourceProperties, java.lang.Runnable, SecureResource, TopicListAccessor

public class PersistentManagedMultiJobResource
extends ManagedMultiJobResource
implements PersistentManagedJobResource


Field Summary
private static org.globus.util.I18n coreI18n
           
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.multi.ManagedMultiJobResource
 
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
PersistentManagedMultiJobResource()
           
 
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()
           
 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 processStateNotification(StateEnumeration state, boolean holding, FaultResourcePropertyType fault)
           
 void remove()
           
 void run()
           
 void setDirty(boolean changed)
          Sets the dirty flag on this persistent object.
 void setFault(FaultType fault)
           
 void setResourceDatum(java.lang.String name, java.lang.Object value)
           
 void setResourceDatumWithoutStoring(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.multi.ManagedMultiJobResource
deliver, getCallback, getSecurityDescriptor, initialize, initializeTopics, initSecurity, registerCallback, releaseSubJobs, 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

dirtyCond

private java.lang.Object dirtyCond

WHOLE_STATE_ELEMENT

private static final javax.xml.namespace.QName WHOLE_STATE_ELEMENT

persistenceHelper

private PersistenceHelper persistenceHelper

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.


logger

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

i18n

private static org.globus.util.I18n i18n

coreI18n

private static org.globus.util.I18n coreI18n
Constructor Detail

PersistentManagedMultiJobResource

public PersistentManagedMultiJobResource()
Method Detail

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 ManagedMultiJobResource
Throws:
ResourceException

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class ManagedMultiJobResource

processStateNotification

public void processStateNotification(StateEnumeration state,
                                     boolean holding,
                                     FaultResourcePropertyType fault)
                              throws java.lang.Exception
Overrides:
processStateNotification in class ManagedMultiJobResource
Throws:
java.lang.Exception

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 ManagedMultiJobResource
Throws:
java.lang.Exception

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

setResourceDatumWithoutStoring

public void setResourceDatumWithoutStoring(java.lang.String name,
                                           java.lang.Object value)

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()
Specified by:
getWholeState in interface PersistentManagedJobResource

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 ManagedMultiJobResource
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