|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.fzj.unicore.wsrflite.impl.DefaultHome
public abstract class DefaultHome
This is a basic implementation of the Home interface.
It is responsible for managing WS-Resources of a single service.
Furthermore it starts a thread that periodically checks for expired resources.
Note: the actual WS-Resource to be used is selected either
a) from the query part of the WS-Addressing To: field
b) from reference parameters given in the SOAP header.
To use the second method, make sure to override the
getReferenceParameterQNames() method, and return the QNames of
the XML element you want to use as reference parameter.
| Field Summary | |
|---|---|
static String |
DEFAULT_LIFETIME
property name for configuring the default lifetime (in seconds) set to an integer value (seconds) |
static String |
EXPIRYCHECK_INITIAL
property name for configuring the initial delay for ws-resource expiry checking set to an integer value (seconds) |
static String |
EXPIRYCHECK_PERIOD
property name for configuring the repeat period for ws-resource expiry checking set to an integer value (seconds) |
protected InstanceChecker |
expiryChecker
|
protected InstanceChecking |
instanceChecking
this takes care of removing expired WS-Resources etc. |
protected static org.apache.log4j.Logger |
logger
|
static String |
MAXIMUM_LIFETIME
property name for configuring the maximum lifetime (in seconds) set to an integer value (seconds) |
protected Store |
serviceInstances
|
protected String |
serviceName
|
protected boolean |
supportsNotification
|
protected static Map<String,Calendar> |
terminationTimes
|
| Constructor Summary | |
|---|---|
DefaultHome()
|
|
| Method Summary | |
|---|---|
void |
activateHome(String serviceName)
activate the service using the given name Called when the container brings up the service |
String |
createWSRFServiceInstance(Map<String,Object> initObjs)
create a new WS-Resource and persist it |
void |
destroyWSRFServiceInstance(String resourceId)
delete and cleanup the administrative information about a WS-Resource (NOTE: this will not call WSRFInstance.destroy()
(NOTE 2: locks will be cleaned as well} |
protected abstract WSRFInstance |
doCreateInstance()
You must override this in subclasses to actually create the instance. |
protected WSRFInstance |
doCreateInstance(Map<String,Object> initObjs)
You may override in subclasses to create the instance. |
String |
extractServiceReference(org.codehaus.xfire.MessageContext context)
retrieve the unique service instance id from the message context This can be as a query parameter in the wsa:To, or as a ReferenceParameter, or (as fallback) as a query parameter in the HTTP transport URL |
WSRFInstance |
get(String id)
Get a wsrf instance for read access (i.e. without aquiring a lock) |
WSRFInstance |
getForUpdate(String id)
Get a wsrf instance for update (i.e. aquire a lock) |
long |
getNumberOfInstances()
retrieve the current number of alive instances |
protected List<QName> |
getReferenceParameterQNames()
if you want to use referenceParameters for selecting resources, return a list of accepted qnames here |
String |
getServiceName()
get the service name controlled by this Home |
Store |
getStore()
get the Store instance, if lower level access to the persistence layer is required |
Calendar |
getTerminationTime(String uniqueID)
Get the termination time of an WS-Resource |
protected WSNProvider |
getWSNProvider()
get a messaging provider for sending WS-N messages (only relevant if this service supports WS-N) |
protected void |
initExpiryCheck()
setup the expiry check this implementation can be customised by setting two parameters: |
boolean |
isShuttingDown()
check whether the service is currently shutting down |
void |
passivateHome()
called when the container shuts down |
void |
persist(WSRFInstance instance)
persist the given instance |
void |
runExpiryCheckNow()
|
void |
setServiceName(String serviceName)
|
void |
setStore(Store serviceInstances)
|
void |
setTerminationTime(String uniqueID,
Calendar c)
Set the termination time of an WS-Resource |
void |
stopExpiryCheckNow()
Stops expiry checks for undeployed Web Services. |
protected void |
storeNewInstance(WSRFInstance newInstance)
store the new instance |
boolean |
supportsNotification()
does this service support notification (i.e. |
protected void |
updateTT()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface de.fzj.unicore.wsrflite.Home |
|---|
getFaultConverter |
| Field Detail |
|---|
protected static final org.apache.log4j.Logger logger
protected Store serviceInstances
protected String serviceName
protected static Map<String,Calendar> terminationTimes
public static final String EXPIRYCHECK_INITIAL
public static final String EXPIRYCHECK_PERIOD
public static final String DEFAULT_LIFETIME
public static final String MAXIMUM_LIFETIME
protected InstanceChecking instanceChecking
protected InstanceChecker expiryChecker
protected boolean supportsNotification
| Constructor Detail |
|---|
public DefaultHome()
| Method Detail |
|---|
public void activateHome(String serviceName)
throws Exception
Home
activateHome in interface HomeExceptionprotected WSNProvider getWSNProvider()
protected void initExpiryCheck()
EXPIRYCHECK_INITIAL,
EXPIRYCHECK_PERIODpublic void runExpiryCheckNow()
public void stopExpiryCheckNow()
stopExpiryCheckNow in interface Homede.fzj.unicore.wsrflite.utils.deployment.DeploymentCenter.unregisterService(String serviceName)public void passivateHome()
passivateHome in interface Homepublic String getServiceName()
Home
getServiceName in interface Homepublic void setServiceName(String serviceName)
public WSRFInstance get(String id)
throws ResourceUnknownException
Home
get in interface Homeid - the ID of the resource
ResourceUnknownException - if no such resource exists
public WSRFInstance getForUpdate(String id)
throws ResourceUnknownException,
ResourceUnavailableException
Home
getForUpdate in interface Homeid - the ID of the resource
ResourceUnknownException - if no such resource exists
ResourceUnavailableException - if the resource cannot be locked within the timeout period
public String createWSRFServiceInstance(Map<String,Object> initObjs)
throws ResourceNotCreatedException
Home
createWSRFServiceInstance in interface HomeResourceNotCreatedExceptionpublic void persist(WSRFInstance instance)
Home
persist in interface Homepublic Calendar getTerminationTime(String uniqueID)
Home
getTerminationTime in interface Homeprotected void updateTT()
public void setTerminationTime(String uniqueID,
Calendar c)
throws TerminationTimeChangeRejectedException,
UnableToSetTerminationTimeException
Home
setTerminationTime in interface HomeTerminationTimeChangeRejectedException
UnableToSetTerminationTimeExceptionprotected abstract WSRFInstance doCreateInstance()
doCreateInstance(Map) method
protected WSRFInstance doCreateInstance(Map<String,Object> initObjs)
doCreateInstance()
initObjs - initialisation map passed to the createWSRFServiceInstance(Map) methodprotected void storeNewInstance(WSRFInstance newInstance)
newInstance -
public void destroyWSRFServiceInstance(String resourceId)
throws Exception
HomeWSRFInstance.destroy()
(NOTE 2: locks will be cleaned as well}
destroyWSRFServiceInstance in interface HomeExceptionpublic long getNumberOfInstances()
Home
getNumberOfInstances in interface Home
public String extractServiceReference(org.codehaus.xfire.MessageContext context)
throws ResourceUnknownException
extractServiceReference in interface Homecontext -
ResourceUnknownExceptionprotected List<QName> getReferenceParameterQNames()
public Store getStore()
HomeStore instance, if lower level access to the persistence layer is required
getStore in interface Homepublic void setStore(Store serviceInstances)
public boolean isShuttingDown()
Home
isShuttingDown in interface Hometrue if the service is currently shutting downpublic boolean supportsNotification()
Home
supportsNotification in interface Home
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||