org.apache.catalina.core
public final class StandardServer extends java.lang.Object implements Lifecycle, Server, javax.management.MBeanRegistration
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
domain |
protected javax.management.MBeanServer |
mserver |
protected javax.management.ObjectName |
oname |
protected java.lang.String |
suffix |
protected java.beans.PropertyChangeSupport |
support
The property change support for this component.
|
protected java.lang.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 |
|---|
StandardServer()
Construct a default instance of this class.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addLifecycleListener(LifecycleListener listener)
Add a LifecycleEvent listener to this component.
|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a property change listener to this component.
|
void |
addService(Service service)
Add a new Service to the set of defined Services.
|
void |
await()
Wait until a proper shutdown command is received, then return.
|
LifecycleListener[] |
findLifecycleListeners()
Get the lifecycle listeners associated with this lifecycle.
|
Service |
findService(java.lang.String name)
Return the specified Service (if it exists); otherwise return
null. |
Service[] |
findServices()
Return the set of Services defined within this Server.
|
java.lang.String |
getDomain() |
javax.naming.Context |
getGlobalNamingContext()
Return the global naming resources context.
|
NamingResources |
getGlobalNamingResources()
Return the global naming resources.
|
java.lang.String |
getInfo()
Return descriptive information about this Server implementation and
the corresponding version number, in the format
<description>/<version>. |
javax.management.ObjectName |
getObjectName() |
int |
getPort()
Return the port number we listen to for shutdown commands.
|
java.lang.String |
getServerInfo()
Report the current Tomcat Server Release number
|
javax.management.ObjectName[] |
getServiceNames()
Return the JMX service names.
|
java.lang.String |
getShutdown()
Return the shutdown command string we are waiting for.
|
void |
init() |
void |
initialize()
Invoke a pre-startup initialization.
|
void |
postDeregister() |
void |
postRegister(java.lang.Boolean registrationDone) |
void |
preDeregister() |
javax.management.ObjectName |
preRegister(javax.management.MBeanServer server,
javax.management.ObjectName name) |
void |
removeLifecycleListener(LifecycleListener listener)
Remove a LifecycleEvent listener from this component.
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a property change listener from this component.
|
void |
removeService(Service service)
Remove the specified Service from the set associated from this
Server.
|
void |
setGlobalNamingContext(javax.naming.Context globalNamingContext)
Set the global naming resources context.
|
void |
setGlobalNamingResources(NamingResources globalNamingResources)
Set the global naming resources.
|
void |
setPort(int port)
Set the port number we listen to for shutdown commands.
|
void |
setShutdown(java.lang.String shutdown)
Set the shutdown command we are waiting for.
|
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.
|
void |
stopAwait() |
void |
storeConfig()
Write the configuration information for this entire
Server
out to the server.xml configuration file. |
void |
storeContext(Context context)
Write the configuration information for
Context
out to the specified configuration file. |
java.lang.String |
toString()
Return a String representation of this component.
|
protected java.beans.PropertyChangeSupport support
protected java.lang.String type
protected java.lang.String domain
protected java.lang.String suffix
protected javax.management.ObjectName oname
protected javax.management.MBeanServer mserver
public StandardServer()
public javax.naming.Context getGlobalNamingContext()
public void setGlobalNamingContext(javax.naming.Context globalNamingContext)
globalNamingContext - The new global naming resource contextpublic NamingResources getGlobalNamingResources()
getGlobalNamingResources in interface Serverpublic void setGlobalNamingResources(NamingResources globalNamingResources)
setGlobalNamingResources in interface ServerglobalNamingResources - The new global naming resourcespublic java.lang.String getInfo()
<description>/<version>.public java.lang.String getServerInfo()
public int getPort()
public void setPort(int port)
public java.lang.String getShutdown()
getShutdown in interface Serverpublic void setShutdown(java.lang.String shutdown)
setShutdown in interface Servershutdown - The new shutdown commandpublic void addService(Service service)
addService in interface Serverservice - The Service to be addedpublic void stopAwait()
public void await()
public Service findService(java.lang.String name)
null.findService in interface Servername - Name of the Service to be returnedpublic Service[] findServices()
findServices in interface Serverpublic javax.management.ObjectName[] getServiceNames()
public void removeService(Service service)
removeService in interface Serverservice - The Service to be removedpublic void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener - The listener to addpublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener - The listener to removepublic java.lang.String toString()
toString in class java.lang.Objectpublic void storeConfig()
throws java.lang.Exception
Server
out to the server.xml configuration file.javax.management.InstanceNotFoundException - if the managed resource object cannot be foundjavax.management.MBeanException - if the initializer of the object throws an exception, or
persistence is not supportedjavax.management.RuntimeOperationsException - if an exception is reported by the persistence mechanismjava.lang.Exceptionpublic void storeContext(Context context) throws java.lang.Exception
Context
out to the specified configuration file.javax.management.InstanceNotFoundException - if the managed resource object
cannot be foundjavax.management.MBeanException - if the initializer of the object throws
an exception, or persistence is not supportedjavax.management.RuntimeOperationsException - if an exception is reported
by the persistence mechanismjava.lang.Exceptionpublic void addLifecycleListener(LifecycleListener listener)
addLifecycleListener in interface Lifecyclelistener - The listener to addpublic LifecycleListener[] findLifecycleListeners()
findLifecycleListeners in interface Lifecyclepublic void removeLifecycleListener(LifecycleListener listener)
removeLifecycleListener in interface Lifecyclelistener - The listener to removepublic void start()
throws LifecycleException
start in interface LifecycleLifecycleException - if this component detects a fatal error
that prevents this component from being usedpublic void stop()
throws LifecycleException
stop in interface LifecycleLifecycleException - if this component detects a fatal error
that needs to be reportedpublic void init()
throws java.lang.Exception
java.lang.Exceptionpublic void initialize()
throws LifecycleException
initialize in interface ServerLifecycleException - If this server was already initialized.public javax.management.ObjectName getObjectName()
public java.lang.String getDomain()
public javax.management.ObjectName preRegister(javax.management.MBeanServer server,
javax.management.ObjectName name)
throws java.lang.Exception
preRegister in interface javax.management.MBeanRegistrationjava.lang.Exceptionpublic void postRegister(java.lang.Boolean registrationDone)
postRegister in interface javax.management.MBeanRegistrationpublic void preDeregister()
throws java.lang.Exception
preDeregister in interface javax.management.MBeanRegistrationjava.lang.Exceptionpublic void postDeregister()
postDeregister in interface javax.management.MBeanRegistrationCopyright © 2000-2013 Apache Software Foundation. All Rights Reserved.