de.fzj.unicore.wsrflite
Interface Home

All Known Subinterfaces:
WSResourceHome
All Known Implementing Classes:
AdminServiceHomeImpl, DefaultHome, NotificationProducerHomeImpl, ServiceGroupEntryHomeImpl, ServiceGroupHomeImpl, ServiceGroupRegistrationHomeImpl, SubscriptionHomeImpl, WSResourceHomeImpl

public interface Home

the Home interface offers methods to create, lookup and destroy WS-Resources

Author:
schuller, daivandy

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> initParams)
          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}
 String extractServiceReference(org.codehaus.xfire.MessageContext context)
          retrieve the correct service instance id, based on the message context TODO refactor to use some abstract context
 WSRFInstance get(String id)
          Get a wsrf instance for read access (i.e. without aquiring a lock)
 FaultConverter getFaultConverter()
          get the FaultConverter for this service
 WSRFInstance getForUpdate(String id)
          Get a wsrf instance for update (i.e. aquire a lock)
 long getNumberOfInstances()
          retrieve the current number of alive instances
 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 resourceId)
          Get the termination time of an WS-Resource
 boolean isShuttingDown()
          check whether the service is currently shutting down
 void passivateHome()
          passivate the service.
 void persist(WSRFInstance instance)
          persist the given instance
 void setTerminationTime(String resourceId, Calendar newTT)
          Set the termination time of an WS-Resource
 void stopExpiryCheckNow()
          Stop the expiry checker for this service
 boolean supportsNotification()
          does this service support notification (i.e.
 

Method Detail

activateHome

void activateHome(String serviceName)
                  throws Exception
activate the service using the given name
Called when the container brings up the service

Throws:
Exception

passivateHome

void passivateHome()
passivate the service. Called when the container is shut down.


getServiceName

String getServiceName()
get the service name controlled by this Home

Returns:

extractServiceReference

String extractServiceReference(org.codehaus.xfire.MessageContext context)
                               throws ResourceUnknownException
retrieve the correct service instance id, based on the message context TODO refactor to use some abstract context

Parameters:
context -
Returns:
the service instance ID
Throws:
ResourceUnknownException

get

WSRFInstance get(String id)
                 throws ResourceUnknownException
Get a wsrf instance for read access (i.e. without aquiring a lock)

Parameters:
id - the ID of the resource
Throws:
ResourceUnknownException - if no such resource exists

getForUpdate

WSRFInstance getForUpdate(String id)
                          throws ResourceUnknownException,
                                 ResourceUnavailableException
Get a wsrf instance for update (i.e. aquire a lock)

Parameters:
id - the ID of the resource
Throws:
ResourceUnknownException - if no such resource exists
ResourceUnavailableException - if the resource cannot be locked within the timeout period

createWSRFServiceInstance

String createWSRFServiceInstance(Map<String,Object> initParams)
                                 throws ResourceNotCreatedException
create a new WS-Resource and persist it

Parameters:
Map - initialisation parameters (may be null)
Returns:
String the unique id of the new instance
Throws:
ResourceNotCreatedException

persist

void persist(WSRFInstance instance)
persist the given instance

Parameters:
instance -

destroyWSRFServiceInstance

void destroyWSRFServiceInstance(String resourceId)
                                throws Exception
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}

Parameters:
resource -
Throws:
Exception

getTerminationTime

Calendar getTerminationTime(String resourceId)
                            throws ResourceUnknownException
Get the termination time of an WS-Resource

Parameters:
resourceId -
Returns:
Calendar (null if instance does not expire)
Throws:
ResourceUnknownException

setTerminationTime

void setTerminationTime(String resourceId,
                        Calendar newTT)
                        throws ResourceUnknownException,
                               TerminationTimeChangeRejectedException,
                               UnableToSetTerminationTimeException
Set the termination time of an WS-Resource

Parameters:
resourceId -
Calendar -
Throws:
ResourceUnknownException
TerminationTimeChangeRejectedException
UnableToSetTerminationTimeException

getNumberOfInstances

long getNumberOfInstances()
retrieve the current number of alive instances

Returns:
long

getFaultConverter

FaultConverter getFaultConverter()
get the FaultConverter for this service

Parameters:
e -
Returns:

stopExpiryCheckNow

void stopExpiryCheckNow()
Stop the expiry checker for this service

See Also:
de.fzj.unicore.wsrflite.utils.deployment.DeploymentCenter.unregisterService(String serviceName)

isShuttingDown

boolean isShuttingDown()
check whether the service is currently shutting down

Returns:
true if the service is currently shutting down

getStore

Store getStore()
get the Store instance, if lower level access to the persistence layer is required

Returns:
Store for this service

supportsNotification

boolean supportsNotification()
does this service support notification (i.e. WS-Notification)? If this returns true, WSRFlite will periodically wake up each service instance if necessary to check for new events



Copyright © 2010. All Rights Reserved.