org.gcube.common.core.contexts
Class GCUBEStatefulPortTypeContext

java.lang.Object
  extended by org.gcube.common.core.contexts.GCUBEContext
      extended by org.gcube.common.core.contexts.GCUBEPortTypeContext
          extended by org.gcube.common.core.contexts.GCUBEStatefulPortTypeContext

public abstract class GCUBEStatefulPortTypeContext
extends GCUBEPortTypeContext

Abstract specialisation of GCUBEPortTypeContext for stateful services.

Author:
Fabio Simeoni (University of Strathclyde), Manuele Simi (ISTI-CNR)

Nested Class Summary
 
Nested classes/interfaces inherited from class org.gcube.common.core.contexts.GCUBEPortTypeContext
GCUBEPortTypeContext.PTConsumer
 
Field Summary
protected static String LIFETIME_JNDI_NAME
          Name of lifetime JNDI environment.
protected  GCUBEPublicationProfile profile
          Publication profile.
protected static String PUBLICATION_MODE_JNDI_PULL
          Legal value of publication mode JNDI environment.
protected static String PUBLICATION_MODE_JNDI_PUSH
          Legal value of publication mode JNDI environment.
protected static String PUBLICATIONPROFILE_JNDI_NAME
          Name of publication profile JNDI resource.
protected  boolean publicationStatus
          Publication status.
protected static String RESOURCE_HOME_JNDI_NAME
          Name of stateful resource home JNDI resource.
protected static String RPDNAME_JNDI_NAME
          Name of Resource Property Document (RPD) JNDI environment.
protected static String WS_HOME_JNDI_NAME
          Name of WS-resource home JNDI resource.
 
Fields inherited from class org.gcube.common.core.contexts.GCUBEPortTypeContext
deploymentDescriptor, name, securityDescriptor, WSDD_FILE_NAME, WSSD_WSDD_NAME
 
Fields inherited from class org.gcube.common.core.contexts.GCUBEContext
logger, timers
 
Constructor Summary
GCUBEStatefulPortTypeContext()
           
 
Method Summary
 GCUBELocalHome getLocalHome()
          Returns the GCUBELocalHome associated with the port-type.
 GCUBEPublicationProfile getPublicationProfile()
          Loads and returns the GCUBEPublicationProfile of the port-type.
The publication profile is configured as a JNDI resource in accordance with the following template (text in italics marks points of instantiations):
 Integer getResourceLifeTime()
          Returns the time after which WS-Resources are scheduled to terminate.
 String getRPDName()
          Returns the name of the root element of the Resource Property Document in the WSDL of the associated port-type.
 GCUBEWSHome getWSHome()
          Returns the GCUBEWSHome associated with the port-type.
 GCUBEWSResourceKey makeKey(String value)
          Convenience method to builds a GCUBEWSResourceKey key from a given value.
protected  void onInitialisation()
          Invoked when the Running Instance has completed initialisation.
 
Methods inherited from class org.gcube.common.core.contexts.GCUBEPortTypeContext
getDeploymentDescriptor, getEPR, getFile, getJNDIName, getName, getNamespace, getPersistentFile, getProperty, getSecurityDescriptor, getServiceContext, onFailure, onReady, onStateChange, onUpdate
 
Methods inherited from class org.gcube.common.core.contexts.GCUBEContext
debugContext, getJNDIContext, getResource, getTiming, printContext, resetTimer, setJNDIContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RPDNAME_JNDI_NAME

protected static final String RPDNAME_JNDI_NAME
Name of Resource Property Document (RPD) JNDI environment.

See Also:
Constant Field Values

WS_HOME_JNDI_NAME

protected static final String WS_HOME_JNDI_NAME
Name of WS-resource home JNDI resource.

See Also:
Constant Field Values

RESOURCE_HOME_JNDI_NAME

protected static final String RESOURCE_HOME_JNDI_NAME
Name of stateful resource home JNDI resource.

See Also:
Constant Field Values

LIFETIME_JNDI_NAME

protected static final String LIFETIME_JNDI_NAME
Name of lifetime JNDI environment.

See Also:
Constant Field Values

PUBLICATIONPROFILE_JNDI_NAME

protected static final String PUBLICATIONPROFILE_JNDI_NAME
Name of publication profile JNDI resource.

See Also:
Constant Field Values

PUBLICATION_MODE_JNDI_PULL

protected static final String PUBLICATION_MODE_JNDI_PULL
Legal value of publication mode JNDI environment.

See Also:
Constant Field Values

PUBLICATION_MODE_JNDI_PUSH

protected static final String PUBLICATION_MODE_JNDI_PUSH
Legal value of publication mode JNDI environment.

See Also:
Constant Field Values

profile

protected GCUBEPublicationProfile profile
Publication profile.


publicationStatus

protected boolean publicationStatus
Publication status.

Constructor Detail

GCUBEStatefulPortTypeContext

public GCUBEStatefulPortTypeContext()
Method Detail

onInitialisation

protected void onInitialisation()
                         throws Exception
Invoked when the Running Instance has completed initialisation. If needed, override in accordance with service semantics.

Overrides:
onInitialisation in class GCUBEPortTypeContext
Throws:
Exception - if the callback did not complete successfully.

getRPDName

public String getRPDName()
Returns the name of the root element of the Resource Property Document in the WSDL of the associated port-type. The name is configured as the value of a JNDI environment, in accordance with the following template (text in italics marks points of instantiations):

<environment
  name="RPDName"
  value="[RPD name]"
  type="java.lang.String"
  override="false" />

Returns:
the element name.

getWSHome

public GCUBEWSHome getWSHome()
Returns the GCUBEWSHome associated with the port-type. The home instance is configured as a JNDI resource, in accordance with with the following template (text in italics marks points of instantiations):

<resource name="home" type="[the FQN of a sublclass of GCUBEWSHome]">
  <resourceParams>
   <parameter>
    <name>factory</name>
    <value>org.globus.wsrf.jndi.BeanFactory</value>
   </parameter>
   <parameter>
    <name>resourceClass</name>
    <value>[FQN of a subclass of GCUBEWSResource]</value>
   </parameter>
   <parameter>
    <name>persistenceDelegateClass</name>
    <value>[FQN of a concrete subclass of GCUBEPersistenceDelegate]</value>
   </parameter>
   <parameter>
    <name>keyName</name>
    <value>[the serialisation of a QName]</value>
   </parameter>
   <parameter>
    <name>sweeperDelay</name>
    <value>[milliseconds]</value>
   </parameter>
   <parameter>
    <name>cacheTimeout</name>
    <value>[milliseconds, e.g. 120000]</value>
   </parameter>
  </resourceParams>
</resource>

where sweeperDelay and cacheTimeout are optional, and the name of the JNDI resource and its context of occurrence are to be constrained by clients.

Returns:
the WS-Resource home.
See Also:
GCUBEResourceHome, GCUBEWSHome

makeKey

public GCUBEWSResourceKey makeKey(String value)
Convenience method to builds a GCUBEWSResourceKey key from a given value.

Parameters:
value - the value.
Returns:
the key.

getLocalHome

public GCUBELocalHome getLocalHome()
Returns the GCUBELocalHome associated with the port-type. The home instance is configured as a JNDI resource, in accordance with with the following template (text in italics marks points of instantiations):

<resource name="localhome" type="[the FQN of a sublclass of GCUBELocalHome]">
  <resourceParams>
   <parameter>
    <name>factory</name>
    <value>org.globus.wsrf.jndi.BeanFactory</value>
   </parameter>
   <parameter>
    <name>resourceClass</name>
    <value>[FQN of a subclass of GCUBELocalResource]</value>
   </parameter>
   <parameter>
    <name>cacheTimeout</name>
    <value>[milliseconds, e.g. 120000]</value>
   </parameter>
  </resourceParams>
</resource>

where cacheTimeout is optional.

Returns:
the resource home.
See Also:
GCUBEResourceHome, GCUBELocalHome

getResourceLifeTime

public Integer getResourceLifeTime()
Returns the time after which WS-Resources are scheduled to terminate. The name is configured as the value of a JNDI environment in accordance with the following template (text in italics marks points of instantiations):

<environment
  name="lifetime"
  value="[lifetime in seconds]"
  type="java.lang.Integer"
  override="false" />

Returns:
the termination time

getPublicationProfile

public GCUBEPublicationProfile getPublicationProfile()
Loads and returns the GCUBEPublicationProfile of the port-type.
The publication profile is configured as a JNDI resource in accordance with the following template (text in italics marks points of instantiations):

<resource name="publicationProfile" type="org.gcube.common.core.service.GCUBEPublicationProfile">
  <resourceParams>
   <parameter>
    <name>factory</name>
    <value>org.globus.wsrf.jndi.BeanFactory</value>
   </parameter>
   <parameter>
    <name>mode</name>
    <value>[push|pull]</value>
   </parameter>
   <parameter>
    <name>fileName</name>
    <value>@config.dir@/[configuration file name]</value>
   </parameter>
  </resourceParams>
</resource>

Returns:
the profile, or null if the profile could not be loaded


Copyright © 2012. All Rights Reserved.