public abstract class ServiceManager
extends java.lang.Object
Constructor and Description |
---|
ServiceManager() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
accept(java.lang.String serviceName) |
static ServiceManager |
get() |
static ServiceManager |
getManager() |
protected static javax.management.ObjectName |
getObjectName(java.lang.String serviceName) |
abstract void |
init() |
protected ServerService |
initServer(java.lang.String serviceName,
java.util.Properties serviceProperties) |
protected java.util.List<ServerService> |
initServers(java.util.Map<java.lang.String,java.util.Properties> availableServices) |
static boolean |
isEnabled(java.util.Properties props) |
static ServerService |
manage(java.lang.String serviceName,
java.util.Properties serviceProperties,
ServerService service) |
static void |
register(java.lang.String serviceName,
ServerService service,
javax.management.MBeanServer server) |
protected static void |
setServiceManager(ServiceManager newManager) |
void |
start() |
abstract void |
start(boolean block)
Start the services managed by this instance.
|
abstract void |
stop() |
public static ServiceManager getManager()
public static ServiceManager get()
protected static void setServiceManager(ServiceManager newManager)
protected boolean accept(java.lang.String serviceName)
protected java.util.List<ServerService> initServers(java.util.Map<java.lang.String,java.util.Properties> availableServices) throws java.io.IOException
java.io.IOException
protected ServerService initServer(java.lang.String serviceName, java.util.Properties serviceProperties) throws java.io.IOException
java.io.IOException
protected static javax.management.ObjectName getObjectName(java.lang.String serviceName)
public static void register(java.lang.String serviceName, ServerService service, javax.management.MBeanServer server)
public static ServerService manage(java.lang.String serviceName, java.util.Properties serviceProperties, ServerService service)
public static boolean isEnabled(java.util.Properties props)
public abstract void init() throws java.lang.Exception
java.lang.Exception
public final void start() throws ServiceException
ServiceException
public abstract void start(boolean block) throws ServiceException
stop()
has already been called,
in which case a ServiceException should be thrownblock
- A request to blockServiceException
- On error or if the manager has been stopped alreadypublic abstract void stop() throws ServiceException
ServiceException