org.apache.muse.ws.resource.lifetime.impl
Class SimpleScheduledTermination

java.lang.Object
  extended by org.apache.muse.core.AbstractCapability
      extended by org.apache.muse.ws.resource.impl.AbstractWsResourceCapability
          extended by org.apache.muse.ws.resource.lifetime.impl.SimpleScheduledTermination
All Implemented Interfaces:
Capability, Initialization, InitializationParameters, Shutdown, ScheduledTermination, WsResourceCapability

public class SimpleScheduledTermination
extends AbstractWsResourceCapability
implements ScheduledTermination

SimpleScheduledTermination is Muse's default implementation of the WS-RL ScheduledResourceTermination capability. It uses Java's built in timer mechanism to manage scheduled terminations. This class does not provide any actual resource shutdown operations - it only removes the resource's visibility to internal and external clients at a specified time.

Author:
Dan Jemiolo (danj)

Field Summary
protected static Messages _MESSAGES
           
 
Fields inherited from interface org.apache.muse.ws.resource.lifetime.ScheduledTermination
PROPERTIES
 
Constructor Summary
SimpleScheduledTermination()
           
 
Method Summary
protected  MessageHandler createSetTerminationTimeHandler()
           
 void deleteProperty(QName property)
           
 Date getCurrentTime()
           
 Element[] getProperty(QName property)
           
 QName[] getPropertyNames()
          Concrete capability classes that define properties MUST override this method and provide the names of the properties.
 Date getTerminationTime()
           
 void initialize()
          

AbstractWsResourceCapability continues the initialization process by inspecting the concrete class to find all of the getters (and, if applicable, setters) for its resource properties.
 void insertProperty(QName property, Element[] values)
           
 Date setTerminationTime(Date time)
           
 void shutdown()
           
 void updateProperty(QName property, Element[] values)
           
 
Methods inherited from class org.apache.muse.ws.resource.impl.AbstractWsResourceCapability
createGettersAndSetters, deleteProperty, getGetter, getProperty, getPropertyElements, getSetter, getWsResource, insertProperty, invokeMethod, setResource, updateProperty
 
Methods inherited from class org.apache.muse.core.AbstractCapability
getActions, getCapabilityURI, getEnvironment, getInitializationParameter, getInitializationParameters, getLog, getMessageHandler, getPersistence, getResource, hasBeenInitialized, hasBeenShutdown, initializeCompleted, prepareShutdown, setCapabilityURI, setEnvironment, setInitializationParameters, setLog, setMessageHandler, setMessageHandlers, setPersistence
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.muse.ws.resource.WsResourceCapability
getWsResource
 
Methods inherited from interface org.apache.muse.core.Capability
getActions, getCapabilityURI, getEnvironment, getLog, getMessageHandler, getPersistence, getResource, initializeCompleted, prepareShutdown, setCapabilityURI, setEnvironment, setLog, setMessageHandlers, setPersistence, setResource
 
Methods inherited from interface org.apache.muse.core.Initialization
hasBeenInitialized
 
Methods inherited from interface org.apache.muse.core.InitializationParameters
getInitializationParameter, getInitializationParameters, setInitializationParameters
 
Methods inherited from interface org.apache.muse.core.Shutdown
hasBeenShutdown
 

Field Detail

_MESSAGES

protected static Messages _MESSAGES
Constructor Detail

SimpleScheduledTermination

public SimpleScheduledTermination()
Method Detail

createSetTerminationTimeHandler

protected MessageHandler createSetTerminationTimeHandler()

getCurrentTime

public Date getCurrentTime()
Specified by:
getCurrentTime in interface ScheduledTermination
Returns:
The current time, according to the system the resource is on.

getPropertyNames

public QName[] getPropertyNames()
Concrete capability classes that define properties MUST override this method and provide the names of the properties.

Overrides:
getPropertyNames in class AbstractWsResourceCapability
Returns:
The names of the resource properties defined by this capability.

getTerminationTime

public Date getTerminationTime()
Specified by:
getTerminationTime in interface ScheduledTermination
Returns:
The termination time for this resource, or null if the resource is not scheduled for termination.

initialize

public void initialize()
                throws SoapFault
Description copied from class: AbstractWsResourceCapability


AbstractWsResourceCapability continues the initialization process by inspecting the concrete class to find all of the getters (and, if applicable, setters) for its resource properties. It then registers itself with the resource's WSRP collection so that read and write requests for its properties are delegated to it.

Specified by:
initialize in interface Initialization
Overrides:
initialize in class AbstractWsResourceCapability
Throws:
SoapFault

setTerminationTime

public Date setTerminationTime(Date time)
Specified by:
setTerminationTime in interface ScheduledTermination
Parameters:
time - The new termination time. If the time is null, the resource will not be scheduled for destruction. If the time is in the past, it will be destroyed immediately.
Returns:
The previous termination time value (or null, if none existed).

shutdown

public void shutdown()
              throws SoapFault
Specified by:
shutdown in interface Shutdown
Overrides:
shutdown in class AbstractCapability
Throws:
SoapFault

deleteProperty

public void deleteProperty(QName property)
                    throws BaseFault
Throws:
BaseFault

getProperty

public Element[] getProperty(QName property)
                      throws BaseFault
Throws:
BaseFault

insertProperty

public void insertProperty(QName property,
                           Element[] values)
                    throws BaseFault
Throws:
BaseFault

updateProperty

public void updateProperty(QName property,
                           Element[] values)
                    throws BaseFault
Throws:
BaseFault


Copyright © 2005-2011 Apache Web Services - Muse. All Rights Reserved.