org.globus.ogsa.impl.ogsi
Class GridServiceImpl

java.lang.Object
  extended byorg.globus.ogsa.impl.core.service.ServicePropertiesImpl
      extended byorg.globus.ogsa.impl.ogsi.GridServiceImpl
All Implemented Interfaces:
GridService, GridServiceBase, GridServiceCallback, java.rmi.Remote, ServiceDataValueCallback, ServiceProperties
Direct Known Subclasses:
AdminServiceImpl, AnyImpl, ArraySampleServiceImpl, AuthenticationServiceImpl, ChatImpl, ContainerRegistryImpl, CounterImpl, CounterNotificationImpl, CounterNotificationServiceDataImpl, CreationImpl, EJBHomeFactoryProvider, EJBServiceImpl, ExceptionImpl, GenerateCounterImpl, GoogleImpl, HandleResolverImpl, JMSAdapter, LocalCounterImpl, NotificationSubscriptionImpl, OgsiLogging, OgsiManagement, PersistentCounterImpl, PersistentGridServiceImpl, PingServiceImpl, ServiceDataImpl, ServiceGroupEntryImpl, SinkListenerImpl, SoapSecureCounterImpl, WeatherImpl

public class GridServiceImpl
extends ServicePropertiesImpl
implements GridServiceBase, ServiceDataValueCallback

Base class that all grid services extend. Implements GridServiceBase interface.


Field Summary
protected  QueryEngine queryEngine
           
protected  ServiceDataSet serviceData
           
 
Fields inherited from interface org.globus.ogsa.ServiceProperties
ACTIVATE_ON_STARTUP, ACTIVATION, BASE_CLASS_NAME, BOOTSTRAP, CONFIG_PATH, CONTAINS_REFERENCE, CREATION_EXTENSIBILITY, CREATION_EXTENSIBILITY_OUTPUT, CUSTOM_EXTENSIBILITY_DESERIALIZER, CUSTOM_EXTENSIBILITY_SERIALIZER, CUSTOM_MAPPING_REGISTERED, DEACTIVATED_PERSISTENT, DEACTIVATED_STATE, DEACTIVATED_TRANSIENT, DEACTIVATION, DESTROY_LISTENER, DESTRUCTION_SKELETON, DISABLE_FACTORY_REGISTRY, ENDPOINT, ENTRY_INSTANCE_CREATION, FACTORY, FACTORY_CALLBACK, FACTORY_HANDLE, FACTORY_PROVIDER, FACTORY_REGISTRY, GSR_DESCRIPTION, HANDLE, HANDLE_PORT, HANDLE_PROTOCOL, INSTANCE_CLASS, INSTANCE_DEACTIVATION, INSTANCE_GSR_DESCRIPTION, INSTANCE_LIFECYCLE, INSTANCE_PORT_TYPE, INSTANCE_PORT_TYPE_NS, INSTANCE_PREFIX, INSTANCE_REGISTRY, INSTANCE_SCHEMA_PATH, INSTANCE_WSDL, INTERFACE_CLASS_NAME, INVOCATION_ID, LAZY_CREATION, LIFECYCLE, LIFECYCLE_MONITOR, LIFECYCLE_MONITOR_CLASS, NAME, NOTIFICATION_ENGINE, NOTIFICATION_FACTORY, NOTIFICATION_SOURCE, OPERATION_PROVIDERS, PERSISTENT, PERSISTENT_PROPERTIES, PORT, PORT_TYPE, PORT_TYPE_NS, PRIMARY_KEY, PROTOCOL, QUERY_ENGINE, REDIRECT_RESOLVER, REGISTRY, RESOLVER_CACHE, ROUTER_HEADER, ROUTER_VIA, SCHEMA_LOCATION, SCHEMA_PATH, SERVICE_ACTIVATOR, SERVICE_DATA, SERVICE_DEPLOYMENT, SERVICE_GROUP_ENTRY, SERVICE_GROUP_PROVIDER, SERVICE_LOADER, SERVICE_NODE, SERVICE_PATH, SINK_ID, STARTUP_STATE, SWEEP_SERVICE_DATA, TIMEOUT, TIMESTAMP, TRANSIENT, TYPE, USER, WEBSTART_PANEL_NAME, WEBSTART_URL, WSDL
 
Constructor Summary
GridServiceImpl()
           
GridServiceImpl(java.lang.String name)
           
 
Method Summary
 void activate(GridContext context)
          Called when a service becomes active after having been deactivated.
 void addOperationProvider(OperationProvider provider)
          Add an operation provider to this service.
 void deactivate(GridContext context)
          Called just before a service gets deactivated.
 void destroy()
          Destroys the service.
 ExtensibilityType findServiceData(ExtensibilityType queryExpression)
           
 java.lang.Object getInstanceProperty(java.lang.String key)
          Gets a property that is to be propagated to other instances that this Grid service may create.
 OperationProvider getOperationProvider(javax.xml.namespace.QName operation)
          Gets the operation provider based on the qname of the operation as defined in the WSDL representation of the service interface.
 QueryEngine getQueryEngine()
          Gets the QueryEngine implementation that is used to evaluate service data based query expressions on the service.
 ServiceDataSet getServiceDataSet()
          Gets the ServiceDataSet implementing storage of service data entries for the service.
 java.util.Collection getServiceDataValues(javax.xml.namespace.QName qname)
          Gets service data values requested for a service data element qname.
 java.lang.Class getServiceInterface()
          Gets the class representing the service interface of this service.
 TerminationTimeType getTerminationTime()
          Gets the current termination time of the service.
 void populateInstanceProperties(GridServiceBase properties)
          Propagates instance properties of this service to another Grid service.
 void postCreate(GridContext context)
          Called when a service has been created and all of its configuration has been set up.
 void preCreate(GridServiceBase factory)
          Called when a service object is created.
 void preDestroy(GridContext context)
          Called just before a service gets destroyed.
 void removeOperationProvider(OperationProvider provider)
          Removes an operation provider from this service.
 TerminationTimeType requestTerminationAfter(ExtendedDateTimeType terminationTime)
           
 TerminationTimeType requestTerminationBefore(ExtendedDateTimeType terminationTime)
           
protected  TerminationTimeType setDefaultTermination(ExtendedDateTimeType terminationTime)
           
 void setQueryEngine(QueryEngine queryEngine)
          Sets the QueryEngine implementation that is used to evaluate service data based query expressions on the service.
 ExtensibilityType setServiceData(ExtensibilityType updateExpression)
           
 void setServiceDataSet(ServiceDataSet serviceData)
          Sets the ServiceDataSet implementing storage of service data entries for the service.
 
Methods inherited from class org.globus.ogsa.impl.core.service.ServicePropertiesImpl
flush, flush, getPersistentProperty, getProperty, keySet, setPersistentProperty, setProperty, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.globus.ogsa.ServiceProperties
flush, getPersistentProperty, getProperty, setPersistentProperty, setProperty
 

Field Detail

serviceData

protected ServiceDataSet serviceData

queryEngine

protected QueryEngine queryEngine
Constructor Detail

GridServiceImpl

public GridServiceImpl()

GridServiceImpl

public GridServiceImpl(java.lang.String name)
Method Detail

getServiceInterface

public java.lang.Class getServiceInterface()
Description copied from interface: GridServiceBase
Gets the class representing the service interface of this service. The service interface is a combination of all methods exposed by this Grid service, including those provided by the OperationProviders. The service interface class may differ from the actual class implementing this GridServiceBase.

Specified by:
getServiceInterface in interface GridServiceBase
Returns:
the service interface class that this service was configured with

getOperationProvider

public OperationProvider getOperationProvider(javax.xml.namespace.QName operation)
Description copied from interface: GridServiceBase
Gets the operation provider based on the qname of the operation as defined in the WSDL representation of the service interface.

Specified by:
getOperationProvider in interface GridServiceBase
Parameters:
operation - name of operation to look up (namespace "" and localPart "*" can be used to find generic operation dispatchers)
Returns:
OperationProvider or null if no matching provider was found

addOperationProvider

public void addOperationProvider(OperationProvider provider)
                          throws GridServiceException
Add an operation provider to this service. The OperationProvider.initialize() method will be automatically called.

Specified by:
addOperationProvider in interface GridServiceBase
Parameters:
provider - the operation provider to add
Throws:
GridServiceException - if the provider failed to initialize

removeOperationProvider

public void removeOperationProvider(OperationProvider provider)
                             throws GridServiceException
Removes an operation provider from this service. If the provider also implements GridServiceCallback interface the preDestroy method will be automatically called.

Parameters:
provider - the operation provider to remove
Throws:
GridServiceException

getInstanceProperty

public java.lang.Object getInstanceProperty(java.lang.String key)
Description copied from interface: GridServiceBase
Gets a property that is to be propagated to other instances that this Grid service may create.

Specified by:
getInstanceProperty in interface GridServiceBase
Parameters:
key - the name of the property (note instance properties are prefixed by "instance-" in the configuration)
Returns:
the value of the specified property or null if the property was not found

populateInstanceProperties

public void populateInstanceProperties(GridServiceBase properties)
Description copied from interface: GridServiceBase
Propagates instance properties of this service to another Grid service.

Specified by:
populateInstanceProperties in interface GridServiceBase
Parameters:
properties - the Grid service that is to be populated with instance properties from this service

preCreate

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

Specified by:
preCreate in interface GridServiceCallback
Parameters:
factory - 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)

getServiceDataSet

public ServiceDataSet getServiceDataSet()
Description copied from interface: GridServiceBase
Gets the ServiceDataSet implementing storage of service data entries for the service.

Specified by:
getServiceDataSet in interface GridServiceBase
Returns:
ServiceDataSet associated with this Grid service

setServiceDataSet

public void setServiceDataSet(ServiceDataSet serviceData)
Description copied from interface: GridServiceBase
Sets the ServiceDataSet implementing storage of service data entries for the service.

Specified by:
setServiceDataSet in interface GridServiceBase
Parameters:
serviceData - ServiceDataSet to be associated with this Grid service

getQueryEngine

public QueryEngine getQueryEngine()
Description copied from interface: GridServiceBase
Gets the QueryEngine implementation that is used to evaluate service data based query expressions on the service. The QueryEngine can be used to register new evaluators for custom query expressions.

Specified by:
getQueryEngine in interface GridServiceBase
Returns:
QueryEngine currently associated with this Grid service

setQueryEngine

public void setQueryEngine(QueryEngine queryEngine)
Description copied from interface: GridServiceBase
Sets the QueryEngine implementation that is used to evaluate service data based query expressions on the service.

Specified by:
setQueryEngine in interface GridServiceBase
Parameters:
queryEngine - QueryEngine to be associated with this Grid service

getServiceDataValues

public java.util.Collection getServiceDataValues(javax.xml.namespace.QName qname)
Description copied from interface: ServiceDataValueCallback
Gets service data values requested for a service data element qname.

Specified by:
getServiceDataValues in interface ServiceDataValueCallback
Parameters:
qname - name of service data element (all values will be wrapped inside of element tags with this qname)
Returns:
a collection of service data values, if the collection is empty or null, the evaluator will ignore this service data element.

setServiceData

public ExtensibilityType setServiceData(ExtensibilityType updateExpression)
                                 throws java.rmi.RemoteException,
                                        MutabilityViolationFaultType,
                                        ExtensibilityTypeFaultType,
                                        PartialFailureFaultType,
                                        CardinalityViolationFaultType,
                                        IncorrectValueFaultType,
                                        TypeViolationFaultType,
                                        FaultType,
                                        ExtensibilityNotSupportedFaultType,
                                        ModifiabilityViolationFaultType
Specified by:
setServiceData in interface GridService
Throws:
java.rmi.RemoteException
MutabilityViolationFaultType
ExtensibilityTypeFaultType
PartialFailureFaultType
CardinalityViolationFaultType
IncorrectValueFaultType
TypeViolationFaultType
FaultType
ExtensibilityNotSupportedFaultType
ModifiabilityViolationFaultType

requestTerminationAfter

public TerminationTimeType requestTerminationAfter(ExtendedDateTimeType terminationTime)
                                            throws java.rmi.RemoteException,
                                                   TerminationTimeUnchangedFaultType,
                                                   FaultType
Specified by:
requestTerminationAfter in interface GridService
Throws:
java.rmi.RemoteException
TerminationTimeUnchangedFaultType
FaultType

setDefaultTermination

protected TerminationTimeType setDefaultTermination(ExtendedDateTimeType terminationTime)

requestTerminationBefore

public TerminationTimeType requestTerminationBefore(ExtendedDateTimeType terminationTime)
                                             throws java.rmi.RemoteException,
                                                    TerminationTimeUnchangedFaultType,
                                                    FaultType
Specified by:
requestTerminationBefore in interface GridService
Throws:
java.rmi.RemoteException
TerminationTimeUnchangedFaultType
FaultType

findServiceData

public ExtensibilityType findServiceData(ExtensibilityType queryExpression)
                                  throws java.rmi.RemoteException,
                                         FaultType,
                                         TargetInvalidFaultType,
                                         ExtensibilityNotSupportedFaultType,
                                         ExtensibilityTypeFaultType
Specified by:
findServiceData in interface GridService
Throws:
java.rmi.RemoteException
FaultType
TargetInvalidFaultType
ExtensibilityNotSupportedFaultType
ExtensibilityTypeFaultType

getTerminationTime

public TerminationTimeType getTerminationTime()
Description copied from interface: GridServiceBase
Gets the current termination time of the service. This is a convenience method for local clients. The same information can be retrieved by issuing a query on the OGSI terminationTime Service Data element.

Specified by:
getTerminationTime in interface GridServiceBase
Returns:
current termination time of this service

destroy

public void destroy()
             throws java.rmi.RemoteException,
                    FaultType,
                    ServiceNotDestroyedFaultType
Destroys the service. If the service is of a persistent type a ServiceNotDestroyedFaultType is raised. First, the preDestroy callback is invoked on all operation providers. If any one of them fails, a ServiceNotDestroyedFaultType is raised and service destruction is halted. Next, a DestroyListener will be called if the service has one registered. If DestroyListener call fails, a ServiceNotDestroyedFaultType is raised and service destruction is halted. Otherwise, service destruction is successful. If service destruction halted, the destroy function can be called again.

Specified by:
destroy in interface GridService
Throws:
java.rmi.RemoteException
FaultType
ServiceNotDestroyedFaultType


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