org.globus.exec.service.exec
Class ManagedExecutableJobHome

java.lang.Object
  extended byorg.globus.wsrf.impl.ResourceHomeImpl
      extended byorg.globus.exec.service.exec.ManagedExecutableJobHome
All Implemented Interfaces:
Initializable, JobStateChangeListener, ManagedJobHome, ResourceHome

public class ManagedExecutableJobHome
extends ResourceHomeImpl
implements JobStateChangeListener, ManagedJobHome


Nested Class Summary
 
Nested classes inherited from class org.globus.wsrf.impl.ResourceHomeImpl
 
Field Summary
private  org.apache.axis.MessageContext cachedContext
           
private static org.apache.axis.types.PositiveInteger DEFAULT_PROCESS_COUNT
           
(package private) static org.globus.util.I18n i18n
           
private  boolean initialized
           
private static ManagedExecutableJobHome INSTANCE
           
private static org.apache.commons.logging.Log logger
           
private static NotificationConsumerManager NOTIFICATION_CONSUMER_MANAGER
           
private static PerformanceLog performanceLogger
           
private  boolean recovered
           
private static java.util.Map userHomeMap
           
private static org.apache.axis.components.uuid.UUIDGen uuidGen
           
 
Fields inherited from class org.globus.wsrf.impl.ResourceHomeImpl
keyTypeClass, keyTypeName, lockManager, resourceClass, resources
 
Constructor Summary
ManagedExecutableJobHome()
           
 
Method Summary
 ResourceKey create(java.util.Calendar initialTerminationTime, java.util.Calendar currentTime, java.lang.String localResourceManager, JobDescriptionType jobDescription, java.lang.String userSubject, java.lang.String localUserId, java.lang.String jobID, java.lang.String serviceURL)
          If the messageID is not null, it is used as the resource ID.
private static ManagedExecutableJobResourcePropertiesType createResourcePropertiesBean(java.util.Calendar initialTerminationTime, java.util.Calendar currentTime, JobDescriptionType jobDescription, java.lang.String userSubject, java.lang.String localUserId)
           
private static ManagedExecutableJobResourceStateType createResourceState(java.util.Calendar initialTerminationTime, java.util.Calendar currentTime, java.lang.String localResourceManager, JobDescriptionType jobDescription, java.lang.String userSubject, java.lang.String localUserId, java.lang.String handle)
          Creates entire initial state of the resource, including internal (non-published) data.
 void enableLocalTransport(javax.xml.rpc.Stub stub)
           
static ManagedExecutableJobHome getHome()
           
static NotificationConsumerManager getNotificationConsumerManager()
           
 int getResourceCount()
          This function returns the number of resources created by the particular home instance.
static java.lang.String getUserHomeDirectory(java.lang.String localUserId)
           
 void initialize()
           
 boolean isInitialized()
           
 boolean isResourcePersistent()
          This function is useful in order to determine if the resource should be stored.
 void jobStateChanged(ResourceKey resourceKey, java.lang.String localJobId, java.util.Date timestamp, StateEnumeration state, int exitCode)
           
 void recover()
          This method assures that any jobs which were being processed by the state machine can continue to do so after container recovery.
(package private)  ManagedExecutableJobResource unsyncFind(ResourceKey key)
           
 
Methods inherited from class org.globus.wsrf.impl.ResourceHomeImpl
add, createNewInstance, createNewInstanceAndLoad, find, getCacheLocation, getKeyTypeClass, getKeyTypeName, getResourceClass, getSweeperDelay, remove, setCacheLocation, setResourceClass, setResourceKeyName, setResourceKeyType, setSweeperDelay
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.globus.wsrf.ResourceHome
find, getKeyTypeClass, getKeyTypeName, remove
 

Field Detail

logger

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

i18n

static org.globus.util.I18n i18n

INSTANCE

private static ManagedExecutableJobHome INSTANCE

userHomeMap

private static java.util.Map userHomeMap

performanceLogger

private static PerformanceLog performanceLogger

recovered

private boolean recovered

initialized

private boolean initialized

cachedContext

private org.apache.axis.MessageContext cachedContext

NOTIFICATION_CONSUMER_MANAGER

private static NotificationConsumerManager NOTIFICATION_CONSUMER_MANAGER

DEFAULT_PROCESS_COUNT

private static final org.apache.axis.types.PositiveInteger DEFAULT_PROCESS_COUNT

uuidGen

private static org.apache.axis.components.uuid.UUIDGen uuidGen
Constructor Detail

ManagedExecutableJobHome

public ManagedExecutableJobHome()
Method Detail

initialize

public void initialize()
                throws java.lang.Exception
Specified by:
initialize in interface Initializable
Throws:
java.lang.Exception

isInitialized

public boolean isInitialized()

recover

public void recover()
             throws ResourceException
This method assures that any jobs which were being processed by the state machine can continue to do so after container recovery. Subscriptions to the JobStateMonitor are also restored. It is intended to be called by ManagedJobFactoryResource after starting the JobStateMonitor.

Precondition: isResourcePersistent()

Throws:
ResourceException

create

public ResourceKey create(java.util.Calendar initialTerminationTime,
                          java.util.Calendar currentTime,
                          java.lang.String localResourceManager,
                          JobDescriptionType jobDescription,
                          java.lang.String userSubject,
                          java.lang.String localUserId,
                          java.lang.String jobID,
                          java.lang.String serviceURL)
                   throws java.lang.Exception
If the messageID is not null, it is used as the resource ID. If the messageID is null, the key value is computed automatically as a UUID.

Specified by:
create in interface ManagedJobHome
Returns:
EndpointReferenceType
Throws:
java.lang.Exception

getNotificationConsumerManager

public static NotificationConsumerManager getNotificationConsumerManager()

isResourcePersistent

public boolean isResourcePersistent()
Description copied from interface: ManagedJobHome
This function is useful in order to determine if the resource should be stored.

Specified by:
isResourcePersistent in interface ManagedJobHome
Returns:
boolean

createResourceState

private static ManagedExecutableJobResourceStateType createResourceState(java.util.Calendar initialTerminationTime,
                                                                         java.util.Calendar currentTime,
                                                                         java.lang.String localResourceManager,
                                                                         JobDescriptionType jobDescription,
                                                                         java.lang.String userSubject,
                                                                         java.lang.String localUserId,
                                                                         java.lang.String handle)
Creates entire initial state of the resource, including internal (non-published) data.

Returns:
ManagedExecutableJobResourceStateType state object, serializable to XML by Axis

createResourcePropertiesBean

private static ManagedExecutableJobResourcePropertiesType createResourcePropertiesBean(java.util.Calendar initialTerminationTime,
                                                                                       java.util.Calendar currentTime,
                                                                                       JobDescriptionType jobDescription,
                                                                                       java.lang.String userSubject,
                                                                                       java.lang.String localUserId)

jobStateChanged

public void jobStateChanged(ResourceKey resourceKey,
                            java.lang.String localJobId,
                            java.util.Date timestamp,
                            StateEnumeration state,
                            int exitCode)
Specified by:
jobStateChanged in interface JobStateChangeListener

getHome

public static ManagedExecutableJobHome getHome()
                                        throws ResourceException
Throws:
ResourceException

getUserHomeDirectory

public static java.lang.String getUserHomeDirectory(java.lang.String localUserId)

getResourceCount

public int getResourceCount()
Description copied from interface: ManagedJobHome
This function returns the number of resources created by the particular home instance.

Specified by:
getResourceCount in interface ManagedJobHome

unsyncFind

ManagedExecutableJobResource unsyncFind(ResourceKey key)
                                  throws ResourceException
Throws:
ResourceException

enableLocalTransport

public void enableLocalTransport(javax.xml.rpc.Stub stub)