public abstract class GCUBEWSResource extends GCUBEStatefulResource<GCUBEWSResourceKey> implements org.globus.wsrf.PersistenceCallback, org.globus.wsrf.ResourceLifetime, org.globus.wsrf.ResourceProperties, org.globus.wsrf.TopicListAccessor
GCUBEStatefulResource for stateful entities that
are accessible to remote clients through the interface of a service port-type.
In particular, a WS-Resource:
-) has a public identifier comprised of its local identifier and the endpoint of the associated port-type.
-) exposes (part of) its state to remote client as multi-valued Resource Properties (RPs). These public properties are
collected in a GCUBEWSResourcePropertySet and documented in the interface definition of the associated
port-type.
-) notifies clients of events about one or more topics, particularly the change of RP values.
-) may have a finite lifetime though its lifetime may be dynamically extended.
GCUBEStatefulResource.LOCK, GCUBEStatefulResource.TaskContextlogger, uuidGen| Constructor and Description |
|---|
GCUBEWSResource() |
| Modifier and Type | Method and Description |
|---|---|
Calendar |
getCurrentTime()
Returns the current time.
|
org.apache.axis.message.addressing.EndpointReferenceType |
getEPR()
Returns the endpoint of the resource.
|
GCUBEStatefulPortTypeContext |
getPorttypeContext()
Returns the context of the port-type associated with the resource.
|
protected org.globus.wsrf.ResourceProperty |
getProperty(String name)
Returns a new RP with a given local name.
|
protected String[] |
getPropertyNames()
Returns the names of the RPs of the resource (none by default).
|
protected ISPublisher |
getPublisher()
Returns the
ISPublisher used for resource publication. |
GCUBEWSResourcePropertySet |
getResourcePropertySet()
Returns the RP set of the resource.
|
GCUBEServiceContext |
getServiceContext()
Returns the context of the service associated with the resource.
|
Calendar |
getTerminationTime()
Returns the termination time of the resource.
|
GCUBETopicList |
getTopicList()
Returns the topic list of the resource.
|
protected String[] |
getTopicNames()
Returns the names of the topics of the resource (none by default).
|
protected void |
initialise(GCUBEWSResourceKey id,
Object... params)
Used internally to initialise the resource with a given identifier and from given parameters.
|
protected abstract void |
initialise(Object... params)
Initialises the resource.
|
protected void |
initialiseContainers()
Initialises the internal data structures of the resource.
|
boolean |
inScope(GCUBEScope... scopes)
Indicates whether the resource is in one or more given scopes.
|
void |
load(org.globus.wsrf.ResourceKey key)
Deprecated.
|
void |
publish(GCUBEScope... scopes)
Publishes the resource in one or more scopes.
|
void |
setPortTypeContext(GCUBEStatefulPortTypeContext context)
Invoked by the
GCUBEResourceHome of the resource to set the associated port-type. |
void |
setTerminationTime(Calendar calendar)
Sets the termination time of resource.
|
void |
unpublish(GCUBEScope... scopes)
Unpublish the resource from one o more scopes.
|
getID, getLock, getScheduledTasks, getScope, launchTask, onRemove, setID, setPersistenceDelegate, stopTask, storegetPortTypeMap, setPortTypeMapprotected void initialiseContainers()
throws Exception
If overridden, it should be invoked to add RPs and topics.
org.globus.wsrf.ResourceException - if the structures could not be initialised.Exceptionprotected void initialise(GCUBEWSResourceKey id, Object... params) throws Exception
initialise in class GCUBEStatefulResource<GCUBEWSResourceKey>id - the identifier, or null if a new one should be generated.params - (optional) the initialisation parameters.Exception - if the resource could not be initialised.protected abstract void initialise(Object... params) throws Exception
Implement by casting to specific parameter types (if any are expected) and performing initialisation in accordance with resource semantics.
params - (optional) the initialisation parameters.Exception - if the resource could not be initialised.public GCUBEWSResourcePropertySet getResourcePropertySet()
getResourcePropertySet in interface org.globus.wsrf.ResourcePropertiespublic GCUBETopicList getTopicList()
getTopicList in interface org.globus.wsrf.TopicListAccessorpublic org.apache.axis.message.addressing.EndpointReferenceType getEPR()
throws Exception
Exception - if the endpoint could not be derived.public Calendar getCurrentTime()
getCurrentTime in interface org.globus.wsrf.ResourceLifetimepublic Calendar getTerminationTime()
getTerminationTime in interface org.globus.wsrf.ResourceLifetimepublic void setTerminationTime(Calendar calendar)
setTerminationTime in interface org.globus.wsrf.ResourceLifetimecalendar - the termination time.public void publish(GCUBEScope... scopes) throws org.globus.wsrf.ResourceException
scopes - the scopes.org.globus.wsrf.ResourceExceptionpublic void unpublish(GCUBEScope... scopes) throws org.globus.wsrf.ResourceException
scopes - the scopes.org.globus.wsrf.ResourceExceptionpublic GCUBEStatefulPortTypeContext getPorttypeContext()
public void setPortTypeContext(GCUBEStatefulPortTypeContext context)
GCUBEResourceHome of the resource to set the associated port-type.context - the context.public GCUBEServiceContext getServiceContext()
getServiceContext in class GCUBEStatefulResource<GCUBEWSResourceKey>protected String[] getPropertyNames()
protected String[] getTopicNames()
protected org.globus.wsrf.ResourceProperty getProperty(String name) throws Exception
SimpleResourceProperty. Override to use different ResourceProperty implementation.name - the local name.Exception - if the property could not be created.public void load(org.globus.wsrf.ResourceKey key)
throws org.globus.wsrf.ResourceException,
org.globus.wsrf.NoSuchResourceException,
org.globus.wsrf.InvalidResourceKeyException
load in interface org.globus.wsrf.PersistenceCallbackorg.globus.wsrf.ResourceExceptionorg.globus.wsrf.NoSuchResourceExceptionorg.globus.wsrf.InvalidResourceKeyExceptionpublic boolean inScope(GCUBEScope... scopes)
scopes - the scopes.true if the resource is in all the input scopes, false otherwise.protected ISPublisher getPublisher() throws Exception
ISPublisher used for resource publication.ISAsyncPublisher by default.Exception - if the publisher could not be returned.Copyright © 2015. All Rights Reserved.