Sonic ESB API

com.sonicsw.xq
Interface XQLifeCycleManager


public interface XQLifeCycleManager

This is the interface exposed to ESB services to perform life cycle operations on ESB Container and Services. A service can obtain this interface from the XQInitContext or XQServiceContext. A service can perform life cycle operations on the following artifacts:

This interface also allows services to access the current state of the ESB Container and Service (itself).


Method Summary
 boolean abortContainer()
          A service can use this API to stop the ESB container it is hosted in.
 boolean abortService()
          Abort the service.
 XQState getCurrentContainerState()
          Returns the current state of the ESB container
 XQState getCurrentServiceState()
          Returns the current state of the ESB service
 boolean isContainerAborting()
          Returns true if the container is aborting.
 boolean isServiceAborting()
          Returns true if the service is aborting.
 void setLastError(java.lang.String error)
          Set the last error message flag.
 boolean startService()
          Start the service that was stopped or aborted earlier.
 boolean stopContainer()
          A service can use this API to stop the ESB container it is hosted in.
 boolean stopService()
          Stop the service.
 

Method Detail

startService

boolean startService()
Start the service that was stopped or aborted earlier.

Returns:
true if this the service was started successfully.
Throws:
java.lang.RuntimeException - if the service is not in an appropriate state to perform this operation

stopService

boolean stopService()
Stop the service.

Returns:
true if this the service was stopped successfully.
Throws:
java.lang.RuntimeException - if the service is not in an appropriate state to perform this operation

abortService

boolean abortService()
Abort the service.

Returns:
true if this the service was aborted successfully.
Throws:
java.lang.RuntimeException - if the service is not in an appropriate state to perform this operation

getCurrentServiceState

XQState getCurrentServiceState()
Returns the current state of the ESB service

Returns:
An XQState object that contains information about the current state

stopContainer

boolean stopContainer()
A service can use this API to stop the ESB container it is hosted in. This causes a normal shutdown of the ESB container; similar to performing a stop from SMC. All the messages that are being processed when this API is called is allowed to complete If QoS is ALO the incoming message is acknowledged and if QoS is ExO then the JMS transaction is committed.

Returns:
true if this the container was stopped successfully.
Throws:
java.lang.RuntimeException - if the container is not in an appropriate state to perform this operation

abortContainer

boolean abortContainer()
A service can use this API to stop the ESB container it is hosted in. All the messages that are being processed when this API is called is allowed to complete. If QoS is ALO the incoming message is not acknowledged and if QoS is ExO then the JMS transaction is rolled back.

Returns:
true if this the container was aborted successfully.
Throws:
java.lang.RuntimeException - if the container is not in an appropriate state to perform this operation

getCurrentContainerState

XQState getCurrentContainerState()
Returns the current state of the ESB container

Returns:
An XQState object that contains information about the current state

isServiceAborting

boolean isServiceAborting()
Returns true if the service is aborting. This method will typically be used in the XQServiceEx.stop() method to determine if the service is being stopped or being aborted.


isContainerAborting

boolean isContainerAborting()
Returns true if the container is aborting. This method will typically be used in the XQServiceEx.stop() method to determine if the container is being stopped or being aborted.


setLastError

void setLastError(java.lang.String error)
Set the last error message flag. This will allow services to set this flag if required.

Parameters:
error - The error message

Sonic ESB API

Copyright © 2001-2012 Progress Software Corporation. All Rights Reserved.
HTML formatted on 13-Mar-2012.