org.idoox.wasp.server
Interface ServiceStateManager


Deprecated. See the new Runtime Publishing API (ServiceInstance).

public interface ServiceStateManager

Represents the service state manager in the WSO2 SOA Enablement Server runtime. It is used by the administrator tools to display and manage the state of service instances, and by the deployment mechanism during the uninstallation process.

Since:
4.0
Component:
Core

Method Summary
 void disable(java.lang.String serviceName)
          Deprecated. Performs transition to the ServiceInstance.Disabled service state.
 void enable(java.lang.String serviceName)
          Deprecated. Performs transition from the ServiceInstance.Disabled state to ServiceInstance.Offline state, thus allowing the service to process requests.
 ServiceState getServiceState(java.lang.String serviceName)
          Deprecated. Returns service state for service instance with given name.
 void kill(java.lang.String serviceName)
          Deprecated. Forces service instance to go to Stopped without waiting for the active request to complete.
 void start(java.lang.String serviceName)
          Deprecated. Starts the service, moving it to the Enabled state.
 void stop(java.lang.String serviceName)
          Deprecated. Performs transition to the ServiceInstance.Stopped service state, thus preventing service to receive requests, but will not remove service from memory.
 void waitForState(java.lang.String serviceName, ServiceState state, long timeout)
          Deprecated. Waits for the service instance to enter given state.
 

Method Detail

getServiceState

public ServiceState getServiceState(java.lang.String serviceName)
                             throws ServiceInstanceNotFoundException
Deprecated. 
Returns service state for service instance with given name.

Parameters:
serviceName - name of the service instance for which the state has to be returned
Returns:
service state
Throws:
ServiceInstanceNotFoundException

disable

public void disable(java.lang.String serviceName)
             throws ServiceInstanceNotFoundException,
                    InvalidStateTransitionException
Deprecated. 
Performs transition to the ServiceInstance.Disabled service state. For more information see documentation about service states and their transition diagram.

This method is not legal for service instance in Disabled state.

Parameters:
serviceName - name of the service instance
Throws:
ServiceInstanceNotFoundException
InvalidStateTransitionException

enable

public void enable(java.lang.String serviceName)
            throws ServiceInstanceNotFoundException,
                   InvalidStateTransitionException
Deprecated. 
Performs transition from the ServiceInstance.Disabled state to ServiceInstance.Offline state, thus allowing the service to process requests.

This method is legal only for services in the Disabled state.

Parameters:
serviceName - name of the service instance
Throws:
ServiceInstanceNotFoundException
InvalidStateTransitionException

stop

public void stop(java.lang.String serviceName)
          throws ServiceInstanceNotFoundException,
                 InvalidStateTransitionException
Deprecated. 
Performs transition to the ServiceInstance.Stopped service state, thus preventing service to receive requests, but will not remove service from memory.

If the service instance is in the Active state, transition is done via the Stopping state as described in the service states documentation.

Parameters:
serviceName - name of the service instance
Throws:
ServiceInstanceNotFoundException
InvalidStateTransitionException

kill

public void kill(java.lang.String serviceName)
          throws ServiceInstanceNotFoundException,
                 InvalidStateTransitionException
Deprecated. 
Forces service instance to go to Stopped without waiting for the active request to complete. The active connections are abandoned.

This method is legal only for service instance in the Enabled, Offline, Active and Stopping states.

Note: use with care - this method is unsafe and does not terminate active connections properly. It can thus lead to unpredictable behavior.

Parameters:
serviceName - name of the service instance
Throws:
ServiceInstanceNotFoundException
InvalidStateTransitionException

start

public void start(java.lang.String serviceName)
           throws ServiceInstanceNotFoundException,
                  InvalidStateTransitionException
Deprecated. 
Starts the service, moving it to the Enabled state.

This method is legal for services in Stopped state only.

Parameters:
serviceName - name of the service instance
Throws:
ServiceInstanceNotFoundException
InvalidStateTransitionException

waitForState

public void waitForState(java.lang.String serviceName,
                         ServiceState state,
                         long timeout)
                  throws ServiceInstanceNotFoundException,
                         TimeoutExpiredException,
                         java.lang.InterruptedException
Deprecated. 
Waits for the service instance to enter given state.

This method returns when the service instance enters a given state or when the given timeout expires. The user can set timeout = -1 to wait without timeout.

Parameters:
serviceName - name of the service instance
state - the service state to wait for
timeout - upper bound of time in milliseconds to wait for service instance to enter required state. Set to -1 to wait without timeout.
Throws:
TimeoutExpiredException - when timeout interval expires without the service instance entering given state
ServiceInstanceNotFoundException
java.lang.InterruptedException