org.globus.ogsa.impl.base.servicegroup.service
Class ServiceGroupRegistrationProvider

java.lang.Object
  extended byorg.globus.ogsa.impl.base.servicegroup.service.ServiceGroupRegistrationProvider
All Implemented Interfaces:
GridServiceCallback, LazyCreationCallback, OperationProvider, ServiceDataValueCallback

public class ServiceGroupRegistrationProvider
extends java.lang.Object
implements OperationProvider, GridServiceCallback, LazyCreationCallback, ServiceDataValueCallback

Implements the port-type operations for ServiceGroup and ServiceGroupRegistration; and the semantics for grid service, lazy-create, and service data value callback operations.


Field Summary
static QName ADD_EXTENSIBILITY
          QName for the addExtensibility Service Data.
static QName ENTRY_CONTENT_TYPE_ELEMENT
          QName for the EntryContentType Service Data.
static QName HANDLE_ELEMENT_QNAME
          QName for the handle Element.
static QName LOCATOR_ELEMENT_QNAME
          QName for the locator Element.
static java.lang.String PERSISTANCE_HANDLER_OBJECT
           
static QName REFERENCE_ELEMENT_QNAME
           
static QName REMOVE_EXTENSIBILITY
          QName for the removeExtensibility Service Data.
static QName REMOVE_EXTENSIBILITY_INPUT_ELEMENT
          QName for the matchByLocatorEquivalence Service Data.
 
Constructor Summary
ServiceGroupRegistrationProvider()
           
 
Method Summary
 void activate(GridContext context)
          Called when a service becomes active after having been deactivated.
 TerminationTimeType add(LocatorTypeHolder serviceLocator, ExtensibilityType memberContents, TerminationTimeType terminationTime)
          Adds a member service to this service group.
 void deactivate(GridContext context)
          Called just before a service gets deactivated.
 FactoryProvider getFactoryProvider(GridServiceBase serviceBase)
          Returns the FactoryProvider for the base service instance.
 QName[] getOperations()
          Retrieves a list of operations implemented by this provider.
 java.util.Collection getServiceDataValues(QName qname)
          Retrieves the Entry service data for the given QName.
 void initialize(GridServiceBase serviceBase)
          Initializes the ServiceGroupRegistration service.
 boolean lazyCreate(HandleType handle)
          Creates a ServiceGroupEntry service for the given Handle.
 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 remove(ExtensibilityType matchExpression)
          Removes service group entries whose handles satisfy the given match expression.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PERSISTANCE_HANDLER_OBJECT

public static final java.lang.String PERSISTANCE_HANDLER_OBJECT
See Also:
Constant Field Values

ADD_EXTENSIBILITY

public static final QName ADD_EXTENSIBILITY
QName for the addExtensibility Service Data.


REMOVE_EXTENSIBILITY

public static final QName REMOVE_EXTENSIBILITY
QName for the removeExtensibility Service Data.


ENTRY_CONTENT_TYPE_ELEMENT

public static final QName ENTRY_CONTENT_TYPE_ELEMENT
QName for the EntryContentType Service Data.


REMOVE_EXTENSIBILITY_INPUT_ELEMENT

public static final QName REMOVE_EXTENSIBILITY_INPUT_ELEMENT
QName for the matchByLocatorEquivalence Service Data.


LOCATOR_ELEMENT_QNAME

public static final QName LOCATOR_ELEMENT_QNAME
QName for the locator Element.


HANDLE_ELEMENT_QNAME

public static final QName HANDLE_ELEMENT_QNAME
QName for the handle Element.


REFERENCE_ELEMENT_QNAME

public static final QName REFERENCE_ELEMENT_QNAME
Constructor Detail

ServiceGroupRegistrationProvider

public ServiceGroupRegistrationProvider()
Method Detail

initialize

public void initialize(GridServiceBase serviceBase)
                throws GridServiceException
Initializes the ServiceGroupRegistration service.

Specified by:
initialize in interface OperationProvider
Parameters:
serviceBase - - the service base.
Throws:
GridServiceException - if the service could not be initialized

getFactoryProvider

public FactoryProvider getFactoryProvider(GridServiceBase serviceBase)
                                   throws GridServiceException,
                                          ConfigException
Returns the FactoryProvider for the base service instance.

Parameters:
serviceBase - - the service instance
Returns:
the factory provider
Throws:
GridServiceException
ConfigException

getOperations

public QName[] getOperations()
Retrieves a list of operations implemented 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.

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)

lazyCreate

public boolean lazyCreate(HandleType handle)
                   throws java.rmi.RemoteException,
                          FaultType
Creates a ServiceGroupEntry service for the given Handle.

Specified by:
lazyCreate in interface LazyCreationCallback
Parameters:
handle - - handle used to create a service group entry.
Returns:
true if the service was successfully created, false otherwise
Throws:
java.rmi.RemoteException
FaultType

getServiceDataValues

public java.util.Collection getServiceDataValues(QName qname)
Retrieves the Entry service data for the given QName.

Specified by:
getServiceDataValues in interface ServiceDataValueCallback
Parameters:
qname - - The QName of the Service Data
Returns:
Collection ofthe service data values

remove

public void remove(ExtensibilityType matchExpression)
            throws java.rmi.RemoteException,
                   FaultType,
                   RemoveFailedFaultType,
                   MatchFailedFaultType,
                   ExtensibilityNotSupportedFaultType,
                   ExtensibilityTypeFaultType
Removes service group entries whose handles satisfy the given match expression.

Parameters:
matchExpression - - matchExpression used to filter entries for removal
Throws:
java.rmi.RemoteException
FaultType
RemoveFailedFaultType
MatchFailedFaultType
ExtensibilityNotSupportedFaultType
ExtensibilityTypeFaultType

add

public TerminationTimeType add(LocatorTypeHolder serviceLocator,
                               ExtensibilityType memberContents,
                               TerminationTimeType terminationTime)
                        throws java.rmi.RemoteException,
                               FaultType,
                               ContentCreationFailedFaultType,
                               UnsupportedMemberInterfaceFaultType,
                               AddRefusedFaultType,
                               ExtensibilityNotSupportedFaultType,
                               ExtensibilityTypeFaultType
Adds a member service to this service group.

Parameters:
serviceLocator - - the member service locator
memberContents - - the member service content
terminationTime - - termination time of the service group entry
Throws:
java.rmi.RemoteException
FaultType
ContentCreationFailedFaultType - if unable to create the member service content
AddRefusedFaultType - if unable to complete the add operation
ExtensibilityNotSupportedFaultType - if Extensibility contained unsupported types.
ExtensibilityTypeFaultType - if extensibility is invalid
UnsupportedMemberInterfaceFaultType