org.globus.ogsa.impl.ogsi
Class FactoryProvider

java.lang.Object
  extended byorg.globus.ogsa.impl.ogsi.FactoryProvider
All Implemented Interfaces:
DestroyListener, GridServiceCallback, OperationProvider

public class FactoryProvider
extends java.lang.Object
implements OperationProvider, DestroyListener, GridServiceCallback

Implementation of the Factory PortType. It is implemenented as an OperationProvider which can be linked in with any Grid service using configuration in order to provide factory functionallity. The provider makes callbacks to a FactoryCallback object in order to create the correct Grid service object.

See Also:
OperationProvider, FactoryCallback

Field Summary
protected  GridServiceBase base
           
protected  FactoryCallback factoryCallback
           
static javax.xml.namespace.QName[] operations
           
 
Constructor Summary
FactoryProvider()
           
 
Method Summary
 void activate(GridContext context)
          Called when a service becomes active after having been deactivated.
 GridServiceBase activateService(java.util.Calendar dateTime, java.lang.String instanceID)
           
 void cancelSweeper()
           
 void createPersistentService(TerminationTimeType terminationTime, ExtensibilityType creationParameters, LocatorTypeHolder locator, TerminationTimeTypeHolder currentTerminationTime, ExtensibilityTypeHolder extensibilityOutput)
           
 void createService(TerminationTimeType terminationTime, ExtensibilityType creationParameters, LocatorTypeHolder locator, TerminationTimeTypeHolder currentTerminationTime, ExtensibilityTypeHolder extensibilityOutput)
           
 void deactivate(GridContext context)
          Called just before a service gets deactivated.
 void deactivateInstance(java.lang.String service)
           
 javax.xml.namespace.QName[] getOperations()
          Called during initialization when the Grid service needs to find out what operations are supported by this provider.
 void initialize(GridServiceBase base)
          Called when the operation provider is added to a grid service.
 HandleType lazyCreate()
           
 void notifyDestroy(java.lang.String service)
          Callback to be implemented by listeners to recieve notification that an instance has been destroyed.
 void postCreate(GridContext context)
          Called when a service has been created and all of its configuration has been set up.
 void preCreate(GridServiceBase base)
          Called when a service object is created.
 void preDestroy(GridContext context)
          Called just before a service gets destroyed.
 void setCallback(FactoryCallback callback)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

operations

public static final javax.xml.namespace.QName[] operations

base

protected GridServiceBase base

factoryCallback

protected FactoryCallback factoryCallback
Constructor Detail

FactoryProvider

public FactoryProvider()
Method Detail

getOperations

public javax.xml.namespace.QName[] getOperations()
Description copied from interface: OperationProvider
Called during initialization when the Grid service needs to find out what operations are supported by this provider.

Specified by:
getOperations in interface OperationProvider
Returns:
an array of operation qnames as defined in WSDL. An OperationProvider can use the empty string "" to denote that all operations with a certain local name are implemented. Similarly the wildcard "*" can be used in the local part of the qname to denote that all operations within a certain namespace are implemented. Combining these two approaches and returning: new QName[] {new QName("","*")}, will result in all incoming operations being redirected to this provider (apart from the OGSI defined GridService interface operations provided by the GridServiceBase implementation. Note that individual operations in the OGSI namespace could still be overridded with this approach, but not using the 'all namespaces and all operation' wildcard.

initialize

public void initialize(GridServiceBase base)
                throws GridServiceException
Description copied from interface: OperationProvider
Called when the operation provider is added to a grid service.

Specified by:
initialize in interface OperationProvider
Parameters:
base - the service this provider is being associated with
Throws:
GridServiceException - if the initialization (and service creation is to be aborted)

cancelSweeper

public void cancelSweeper()

activateService

public GridServiceBase activateService(java.util.Calendar dateTime,
                                       java.lang.String instanceID)
                                throws GridServiceException
Throws:
GridServiceException

createService

public void createService(TerminationTimeType terminationTime,
                          ExtensibilityType creationParameters,
                          LocatorTypeHolder locator,
                          TerminationTimeTypeHolder currentTerminationTime,
                          ExtensibilityTypeHolder extensibilityOutput)
                   throws java.rmi.RemoteException,
                          FaultType,
                          ServiceAlreadyExistsFaultType,
                          ExtensibilityNotSupportedFaultType,
                          ExtensibilityTypeFaultType
Throws:
java.rmi.RemoteException
FaultType
ServiceAlreadyExistsFaultType
ExtensibilityNotSupportedFaultType
ExtensibilityTypeFaultType

createPersistentService

public void createPersistentService(TerminationTimeType terminationTime,
                                    ExtensibilityType creationParameters,
                                    LocatorTypeHolder locator,
                                    TerminationTimeTypeHolder currentTerminationTime,
                                    ExtensibilityTypeHolder extensibilityOutput)
                             throws java.rmi.RemoteException,
                                    FaultType,
                                    ServiceAlreadyExistsFaultType,
                                    ExtensibilityNotSupportedFaultType,
                                    ExtensibilityTypeFaultType
Throws:
java.rmi.RemoteException
FaultType
ServiceAlreadyExistsFaultType
ExtensibilityNotSupportedFaultType
ExtensibilityTypeFaultType

lazyCreate

public HandleType lazyCreate()

setCallback

public void setCallback(FactoryCallback callback)

notifyDestroy

public void notifyDestroy(java.lang.String service)
                   throws GridServiceException
Description copied from interface: DestroyListener
Callback to be implemented by listeners to recieve notification that an instance has been destroyed. This callback is typically implemented by factory providers.

Specified by:
notifyDestroy in interface DestroyListener
Parameters:
service - path, in the internal registry, to service instance that was destroyed, for example "myFactory/myService"
Throws:
GridServiceException - if the destruction should not be performed

deactivateInstance

public void deactivateInstance(java.lang.String service)
                        throws GridServiceException
Throws:
GridServiceException

preCreate

public void preCreate(GridServiceBase base)
               throws GridServiceException
Description copied from interface: GridServiceCallback
Called when a service object is created.

Specified by:
preCreate in interface GridServiceCallback
Parameters:
base - the Grid service that is in the process of creating this service object, or if this is a persistent Grid service it points to the service to be created.
Throws:
GridServiceException - if the service should not be created

postCreate

public void postCreate(GridContext context)
                throws GridServiceException
Description copied from interface: GridServiceCallback
Called when a service has been created and all of its configuration has been set up.

Specified by:
postCreate in interface GridServiceCallback
Parameters:
context - state information currently associated with the service that was created.
Throws:
GridServiceException - if the service creation should be aborted

activate

public void activate(GridContext context)
              throws GridServiceException
Description copied from interface: GridServiceCallback
Called when a service becomes active after having been deactivated. A service is always activated before any methods can be called on it.

Specified by:
activate in interface GridServiceCallback
Parameters:
context - state information currently associated with the service
Throws:
GridServiceException - if the service activation should be aborted

deactivate

public void deactivate(GridContext context)
                throws GridServiceException
Description copied from interface: GridServiceCallback
Called just before a service gets deactivated. When a service is deactivated it is subject to garbage collection, so if state is to be survive deactivation it has to be checkpointed into persistent storage. A deactivated service is however still discoverable by clients.

Specified by:
deactivate in interface GridServiceCallback
Parameters:
context - state information currently associated with the service
Throws:
GridServiceException - if the service deactivation failed

preDestroy

public void preDestroy(GridContext context)
                throws GridServiceException
Description copied from interface: GridServiceCallback
Called just before a service gets destroyed. After this call is made the framework removes all knowledge about the service, so it is a good place to clean up service resources. Note that this call can be triggered both by a client initiated destroy call, as well as a framework initiated softstate timeout.

Specified by:
preDestroy in interface GridServiceCallback
Parameters:
context - state information currently associated with the service
Throws:
GridServiceException - if the destruction failed (will be reported to clients in the case of explicit destroy calls)


Copyright ? 1999 University of Chicago and The University of Southern California. All Rights Reserved.