public class StandardService extends Object implements Lifecycle, Service, MBeanRegistration
Service
interface. The
associated Container is generally an instance of Engine, but this is
not required.Modifier and Type | Field and Description |
---|---|
protected Connector[] |
connectors
The set of Connectors associated with this Service.
|
protected Container |
container
The Container associated with this Service.
|
protected ObjectName |
controller |
static boolean |
DELAY_CONNECTOR_STARTUP
Alternate flag to enable delaying startup of connectors in embedded mode.
|
protected String |
domain |
protected String |
entropy
A String initialization parameter used to increase the entropy of
the initialization of our random number generator.
|
protected ArrayList<Executor> |
executors |
protected boolean |
initialized
Has this component been initialized?
|
protected Mapper |
mapper
Mapper.
|
protected ServiceMapperListener |
mapperListener
The associated mapper.
|
protected MBeanServer |
mserver |
protected ObjectName |
oname |
protected SecureRandom |
random
The random associated with this service.
|
protected String |
suffix |
protected PropertyChangeSupport |
support
The property change support for this component.
|
protected String |
type |
AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, DESTROY_EVENT, INIT_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT
Constructor and Description |
---|
StandardService() |
Modifier and Type | Method and Description |
---|---|
void |
addConnector(Connector connector)
Add a new Connector to the set of defined Connectors, and associate it
with this Service's Container.
|
void |
addExecutor(Executor ex)
Adds a named executor to the service
|
void |
addLifecycleListener(LifecycleListener listener)
Add a LifecycleEvent listener to this component.
|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Add a property change listener to this component.
|
void |
destroy() |
Connector[] |
findConnectors()
Find and return the set of Connectors associated with this Service.
|
Executor[] |
findExecutors()
Retrieves all executors
|
LifecycleListener[] |
findLifecycleListeners()
Get the lifecycle listeners associated with this lifecycle.
|
ObjectName[] |
getConnectorNames() |
Container |
getContainer()
Return the
Container that handles requests for all
Connectors associated with this Service. |
ObjectName |
getContainerName() |
String |
getDomain() |
String |
getEntropy()
Return the entropy increaser value, or compute a semi-useful value
if this String has not yet been set.
|
Executor |
getExecutor(String name)
Retrieves executor by name, null if not found
|
String |
getInfo()
Return descriptive information about this Service implementation and
the corresponding version number, in the format
<description>/<version> . |
Mapper |
getMapper()
Return the
Mapper that handles mapping for all
Connectors associated with this Service. |
String |
getName()
Return the name of this Service.
|
ObjectName |
getObjectName() |
SecureRandom |
getRandom()
Get the global secure random that will be used for this service.
|
Server |
getServer()
Return the
Server with which we are associated (if any). |
void |
init() |
void |
initialize()
Invoke a pre-startup initialization.
|
void |
postDeregister() |
void |
postRegister(Boolean registrationDone) |
void |
preDeregister() |
ObjectName |
preRegister(MBeanServer server,
ObjectName name) |
void |
removeConnector(Connector connector)
Remove the specified Connector from the set associated from this
Service.
|
void |
removeExecutor(Executor ex)
Removes an executor from the service
|
void |
removeLifecycleListener(LifecycleListener listener)
Remove a LifecycleEvent listener from this component.
|
void |
removePropertyChangeListener(PropertyChangeListener listener)
Remove a property change listener from this component.
|
void |
setContainer(Container container)
Set the
Container that handles requests for all
Connectors associated with this Service. |
void |
setEntropy(String entropy)
Set the entropy increaser value.
|
void |
setName(String name)
Set the name of this Service.
|
void |
setServer(Server server)
Set the
Server with which we are associated (if any). |
void |
start()
Prepare for the beginning of active use of the public methods of this
component.
|
void |
stop()
Gracefully terminate the active use of the public methods of this
component.
|
String |
toString()
Return a String representation of this component.
|
public static final boolean DELAY_CONNECTOR_STARTUP
protected PropertyChangeSupport support
protected Connector[] connectors
protected Container container
protected Mapper mapper
protected ServiceMapperListener mapperListener
protected boolean initialized
protected String entropy
protected SecureRandom random
protected String type
protected String domain
protected String suffix
protected ObjectName oname
protected ObjectName controller
protected MBeanServer mserver
public Container getContainer()
Container
that handles requests for all
Connectors
associated with this Service.getContainer
in interface Service
public void setContainer(Container container)
Container
that handles requests for all
Connectors
associated with this Service.setContainer
in interface Service
container
- The new Containerpublic Mapper getMapper()
Service
Mapper
that handles mapping for all
Connectors
associated with this Service.public ObjectName getContainerName()
public String getInfo()
<description>/<version>
.public String getName()
public void setName(String name)
public Server getServer()
Server
with which we are associated (if any).public void setServer(Server server)
Server
with which we are associated (if any).public String getEntropy()
Service
getEntropy
in interface Service
public void setEntropy(String entropy)
Service
setEntropy
in interface Service
entropy
- The new entropy increaser valuepublic SecureRandom getRandom()
Service
public void addConnector(Connector connector)
addConnector
in interface Service
connector
- The Connector to be addedpublic ObjectName[] getConnectorNames()
public void addPropertyChangeListener(PropertyChangeListener listener)
listener
- The listener to addpublic Connector[] findConnectors()
findConnectors
in interface Service
public void removeConnector(Connector connector)
removeConnector
in interface Service
connector
- The Connector to be removedpublic void removePropertyChangeListener(PropertyChangeListener listener)
listener
- The listener to removepublic String toString()
public void addLifecycleListener(LifecycleListener listener)
addLifecycleListener
in interface Lifecycle
listener
- The listener to addpublic LifecycleListener[] findLifecycleListeners()
findLifecycleListeners
in interface Lifecycle
public void removeLifecycleListener(LifecycleListener listener)
removeLifecycleListener
in interface Lifecycle
listener
- The listener to removepublic void addExecutor(Executor ex)
addExecutor
in interface Service
ex
- Executorpublic Executor[] findExecutors()
findExecutors
in interface Service
public Executor getExecutor(String name)
getExecutor
in interface Service
name
- Stringpublic void removeExecutor(Executor ex)
removeExecutor
in interface Service
ex
- Executorpublic void start() throws LifecycleException
start
in interface Lifecycle
LifecycleException
- if this component detects a fatal error
that prevents this component from being usedpublic void stop() throws LifecycleException
stop
in interface Lifecycle
LifecycleException
- if this component detects a fatal error
that needs to be reportedpublic void initialize() throws LifecycleException
initialize
in interface Service
LifecycleException
- If this server was already initialized.public void destroy() throws LifecycleException
LifecycleException
public void init()
public ObjectName getObjectName()
public String getDomain()
public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception
preRegister
in interface MBeanRegistration
Exception
public void postRegister(Boolean registrationDone)
postRegister
in interface MBeanRegistration
public void preDeregister() throws Exception
preDeregister
in interface MBeanRegistration
Exception
public void postDeregister()
postDeregister
in interface MBeanRegistration
Copyright © 2017 JBoss by Red Hat. All rights reserved.