public abstract class ServiceActivator extends ServiceActivatorBase implements ServiceActivatorMBean
This class supports RVPF services implemented by a ServiceImpl.
StatsHolder.UpdateNotificationNAME_ARG_PREFIX, OBJECT_NAME_PROPERTYACTIVATOR_CLASS_NAME_SUFFIX, DEFAULT_DOMAIN, DOMAIN_PROPERTY, NAME_KEY, STATS_UPDATE_TYPE, TYPE_KEY| Constructor and Description |
|---|
ServiceActivator() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
acceptMainArg(String arg)
Accepts a main argument.
|
void |
create()
Creates the service.
|
protected abstract ServiceImpl |
createServiceImpl()
Creates the service implementation.
|
protected ServiceImpl |
createServiceImpl(Class<? extends ServiceImpl> serviceImplClass)
Creates a service implementation.
|
protected ServiceImpl |
createServiceImpl(ClassDef classDef)
Creates a service implementation.
|
void |
destroy()
Destroys the service.
|
protected void |
export()
Allows a subclass to export the JMX agent.
|
Optional<Config> |
getConfig()
Gets the service config.
|
String |
getConfigURL()
Gets the Configuration URL.
|
Optional<String> |
getObjectVersion()
Gets the object's version.
|
Service |
getService()
Gets the service.
|
Optional<Stats> |
getStats()
Gets the stats.
|
boolean |
isRunning()
Asks if the service is running.
|
boolean |
isStarted()
Asks if the service has been started.
|
boolean |
isStopped()
Asks if the service has been stopped.
|
boolean |
isZombie()
Asks if the service is in a 'zombie' state.
|
void |
setConfigURL(String configURL)
Sets the configuration file specification.
|
void |
setWait(boolean wait)
Sets the wait indicator.
|
void |
start()
Starts the service.
|
void |
start(boolean wait)
Starts the service.
|
void |
stop()
Stops the service.
|
protected void |
tearDownStandAlone()
Tears down what has been set up in stand alone mode.
|
void |
updateStats()
Updates the stats.
|
created, destroyed, equals, getObjectName, getProperties, getProperty, getServer, getVersion, hashCode, postDeregister, postRegister, preDeregister, preRegister, restart, restart, run, setListener, setObjectNameProperty, setProperties, setProperty, started, starting, stopped, stopping, terminate, toStringgetDefaultDomain, getStatsStrings, getThisLogger, makeObjectName, makeObjectName, objectName, onStatsUpdated, setObjectNameaddNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotificationgetProperties, getProperty, restart, setProperties, setPropertygetStatsStringspublic void create()
throws Exception
create in interface ServiceActivatorBaseMBeancreate in class ServiceActivatorBaseException - As appropriate for the service.public void destroy()
destroy in interface ServiceActivatorBaseMBeandestroy in class ServiceActivatorBase@Nonnull @CheckReturnValue public final Optional<Config> getConfig()
public final String getConfigURL()
getConfigURL in interface ServiceActivatorMBeanpublic final Optional<String> getObjectVersion()
getObjectVersion in interface StatsOwnergetObjectVersion in class StatsHolder@Nonnull @CheckReturnValue public final Service getService()
public final Optional<Stats> getStats()
getStats in class ServiceActivatorBasepublic final boolean isRunning()
isRunning in interface ServiceActivatorBaseMBeanisRunning in class ServiceActivatorBasepublic final boolean isStarted()
isStarted in interface ServiceActivatorBaseMBeanpublic final boolean isStopped()
isStopped in interface ServiceActivatorBaseMBeanisStopped in class ServiceActivatorBasepublic final boolean isZombie()
isZombie in interface ServiceActivatorMBeanpublic final void setConfigURL(String configURL)
setConfigURL in interface ServiceActivatorMBeanconfigURL - The configuration file specification.public final void setWait(boolean wait)
This provides the default value for start().
wait - The wait indicator.public void start()
throws Exception
start in interface ServiceActivatorBaseMBeanstart in class ServiceActivatorBaseException - As appropriate for the service.public final void start(boolean wait)
throws Exception
wait - True asks to wait until running.Exception - As appropriate for the service.public void stop()
stop in interface ServiceActivatorBaseMBeanstop in class ServiceActivatorBasepublic final void updateStats()
updateStats in interface StatsOwnerupdateStats in class ServiceActivatorBaseprotected boolean acceptMainArg(String arg)
acceptMainArg in class ServiceActivatorBasearg - An argument for main args.@Nonnull @CheckReturnValue protected abstract ServiceImpl createServiceImpl()
This must be implemented by the subclasses to provide the actual service.
@Nonnull @CheckReturnValue protected final ServiceImpl createServiceImpl(@Nonnull Class<? extends ServiceImpl> serviceImplClass)
serviceImplClass - The class of the service implementation.@Nullable @CheckReturnValue protected final ServiceImpl createServiceImpl(@Nonnull ClassDef classDef)
classDef - The class definition for the service implementation.protected final void export()
export in class ServiceActivatorBaseprotected void tearDownStandAlone()
tearDownStandAlone in class ServiceActivatorBaseCopyright © 2003-2019 Serge Brisson. All Rights Reserved.