java.lang.Object
com.flexstor.flexdbserver.services.ServiceManager
- All Implemented Interfaces:
- com.flexstor.common.threadmgr.ThreadConsumerI
- public abstract class ServiceManager
- extends java.lang.Object
- implements com.flexstor.common.threadmgr.ThreadConsumerI
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IDENTIFIER
public static final java.lang.String IDENTIFIER
- See Also:
- Constant Field Values
sMgrName
private java.lang.String sMgrName
sGroupName
private java.lang.String sGroupName
caller
private com.flexstor.common.threadmgr.ThreadCallbackI caller
result
private com.flexstor.common.data.ActionResult result
runner
private ServiceRunner runner
ServiceManager
public ServiceManager(com.flexstor.common.data.ActionData data,
com.flexstor.common.threadmgr.ThreadCallbackI caller)
execute
protected abstract com.flexstor.common.data.ActionResult execute()
throws java.lang.InterruptedException
- All the logic for the service manager goes here.
getResultObjectOnAbnormalEnding
protected abstract com.flexstor.common.data.ActionResult getResultObjectOnAbnormalEnding()
- This method need to be implemented for all subclasses to return the proper
result object if the execution of the service manager ends abnormally (due
to a non-catch exception inside the service manager.
startManager
public void startManager()
- Start this ServiceManager in a new Thread.
abortManager
protected boolean abortManager()
- Check if the Thread running this ServiceManager has been signaled to stop.
processService
public void processService(java.lang.Object o)
- This run method will catch any kind of unhandled exception in the sub-service manager
and will return a null value to the caller of this manager.
This is done with the intention of not hanging the caller of the service manager when
sitting in wait mode.
- Specified by:
processService in interface com.flexstor.common.threadmgr.ThreadConsumerI
getResult
public com.flexstor.common.data.ActionResult getResult()
doService
protected com.flexstor.common.data.ActionResult doService(java.lang.String sServiceName,
com.flexstor.common.data.ActionData data)
throws com.flexstor.common.services.SrvcNotAvailException
- Starts the specified service with the specified data object
doService
protected com.flexstor.common.data.ActionResult doService(java.lang.String sServiceName,
java.util.Hashtable htProperties,
com.flexstor.common.data.ActionData data)
throws com.flexstor.common.services.SrvcNotAvailException
- Starts the specified service with the specified data object.
Before the service is started, we load the properties for this service. This method is mostly
used by the AssetServiceManager, which needs to get some properties from the
roletype_service.config file and load them into the service.