Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.flexstor.flexdbserver.services
Class ServiceManager  view ServiceManager download ServiceManager.java

java.lang.Object
  extended bycom.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


Field Summary
private  com.flexstor.common.threadmgr.ThreadCallbackI caller
           
static java.lang.String IDENTIFIER
           
private  com.flexstor.common.data.ActionResult result
           
private  ServiceRunner runner
           
private  java.lang.String sGroupName
           
private  java.lang.String sMgrName
           
 
Constructor Summary
ServiceManager(com.flexstor.common.data.ActionData data, com.flexstor.common.threadmgr.ThreadCallbackI caller)
           
 
Method Summary
protected  boolean abortManager()
          Check if the Thread running this ServiceManager has been signaled to stop.
protected  com.flexstor.common.data.ActionResult doService(java.lang.String sServiceName, com.flexstor.common.data.ActionData data)
          Starts the specified service with the specified data object
protected  com.flexstor.common.data.ActionResult doService(java.lang.String sServiceName, java.util.Hashtable htProperties, com.flexstor.common.data.ActionData data)
          Starts the specified service with the specified data object.
protected abstract  com.flexstor.common.data.ActionResult execute()
          All the logic for the service manager goes here.
 com.flexstor.common.data.ActionResult getResult()
           
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.
 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.
 void startManager()
          Start this ServiceManager in a new Thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

ServiceManager

public ServiceManager(com.flexstor.common.data.ActionData data,
                      com.flexstor.common.threadmgr.ThreadCallbackI caller)
Method Detail

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.