|
Apache Tomcat 7.0.28 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.catalina.util.LifecycleBase org.apache.catalina.util.LifecycleMBeanBase org.apache.catalina.core.StandardServer
public final class StandardServer
Standard implementation of the Server interface, available for use (but not required) when deploying and starting Catalina.
Field Summary | |
---|---|
protected PropertyChangeSupport |
support
The property change support for this component. |
Fields inherited from class org.apache.catalina.util.LifecycleMBeanBase |
---|
mserver |
Fields inherited from interface org.apache.catalina.Lifecycle |
---|
AFTER_DESTROY_EVENT, AFTER_INIT_EVENT, AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_DESTROY_EVENT, BEFORE_INIT_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, CONFIGURE_START_EVENT, CONFIGURE_STOP_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT |
Constructor Summary | |
---|---|
StandardServer()
Construct a default instance of this class. |
Method Summary | |
---|---|
void |
addPropertyChangeListener(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. |
protected void |
destroyInternal()
Sub-classes wishing to perform additional clean-up should override this method, ensuring that super.destroyInternal() is the last call in the overriding method. |
Service |
findService(String name)
Return the specified Service (if it exists); otherwise return null . |
Service[] |
findServices()
Return the set of Services defined within this Server. |
String |
getAddress()
Return the address on which we listen to for shutdown commands. |
Catalina |
getCatalina()
Return the outer Catalina startup/shutdown component if present. |
protected String |
getDomainInternal()
Obtain the MBean domain for this server. |
Context |
getGlobalNamingContext()
Return the global naming resources context. |
NamingResources |
getGlobalNamingResources()
Return the global naming resources. |
String |
getInfo()
Return descriptive information about this Server implementation and the corresponding version number, in the format <description>/<version> . |
protected String |
getObjectNameKeyProperties()
Allow sub-classes to specify the key properties component of the ObjectName that will be used to register this component. |
ClassLoader |
getParentClassLoader()
Return the parent class loader for this component. |
int |
getPort()
Return the port number we listen to for shutdown commands. |
String |
getServerInfo()
Report the current Tomcat Server Release number |
ObjectName[] |
getServiceNames()
Return the JMX service names. |
String |
getShutdown()
Return the shutdown command string we are waiting for. |
protected void |
initInternal()
Invoke a pre-startup initialization. |
void |
removePropertyChangeListener(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 |
setAddress(String address)
Set the address on which we listen to for shutdown commands. |
void |
setCatalina(Catalina catalina)
Set the outer Catalina startup/shutdown component if present. |
void |
setGlobalNamingContext(Context globalNamingContext)
Set the global naming resources context. |
void |
setGlobalNamingResources(NamingResources globalNamingResources)
Set the global naming resources. |
void |
setParentClassLoader(ClassLoader parent)
Set the parent class loader for this server. |
void |
setPort(int port)
Set the port number we listen to for shutdown commands. |
void |
setShutdown(String shutdown)
Set the shutdown command we are waiting for. |
protected void |
startInternal()
Start nested components ( Service s) and implement the requirements
of LifecycleBase.startInternal() . |
void |
stopAwait()
|
protected void |
stopInternal()
Stop nested components ( Service s) and implement the requirements
of LifecycleBase.stopInternal() . |
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. |
String |
toString()
Return a String representation of this component. |
Methods inherited from class org.apache.catalina.util.LifecycleMBeanBase |
---|
getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister |
Methods inherited from class org.apache.catalina.util.LifecycleBase |
---|
addLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, init, removeLifecycleListener, setState, setState, start, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.catalina.Lifecycle |
---|
addLifecycleListener, destroy, findLifecycleListeners, getState, getStateName, init, removeLifecycleListener, start, stop |
Field Detail |
---|
protected PropertyChangeSupport support
Constructor Detail |
---|
public StandardServer()
Method Detail |
---|
public Context getGlobalNamingContext()
getGlobalNamingContext
in interface Server
public void setGlobalNamingContext(Context globalNamingContext)
globalNamingContext
- The new global naming resource contextpublic NamingResources getGlobalNamingResources()
getGlobalNamingResources
in interface Server
public void setGlobalNamingResources(NamingResources globalNamingResources)
setGlobalNamingResources
in interface Server
globalNamingResources
- The new global naming resourcespublic String getInfo()
<description>/<version>
.
getInfo
in interface Server
public String getServerInfo()
public int getPort()
getPort
in interface Server
public void setPort(int port)
setPort
in interface Server
port
- The new port numberpublic String getAddress()
getAddress
in interface Server
public void setAddress(String address)
setAddress
in interface Server
address
- The new addresspublic String getShutdown()
getShutdown
in interface Server
public void setShutdown(String shutdown)
setShutdown
in interface Server
shutdown
- The new shutdown commandpublic Catalina getCatalina()
getCatalina
in interface Server
public void setCatalina(Catalina catalina)
setCatalina
in interface Server
public void addService(Service service)
addService
in interface Server
service
- The Service to be addedpublic void stopAwait()
public void await()
await
in interface Server
public Service findService(String name)
null
.
findService
in interface Server
name
- Name of the Service to be returnedpublic Service[] findServices()
findServices
in interface Server
public ObjectName[] getServiceNames()
public void removeService(Service service)
removeService
in interface Server
service
- The Service to be removedpublic void addPropertyChangeListener(PropertyChangeListener listener)
listener
- The listener to addpublic void removePropertyChangeListener(PropertyChangeListener listener)
listener
- The listener to removepublic String toString()
toString
in class Object
public void storeConfig() throws Exception
Server
out to the server.xml configuration file.
InstanceNotFoundException
- if the managed resource object cannot be found
MBeanException
- if the initializer of the object throws an exception, or
persistence is not supported
RuntimeOperationsException
- if an exception is reported by the persistence mechanism
Exception
public void storeContext(Context context) throws Exception
Context
out to the specified configuration file.
InstanceNotFoundException
- if the managed resource object
cannot be found
MBeanException
- if the initializer of the object throws
an exception, or persistence is not supported
RuntimeOperationsException
- if an exception is reported
by the persistence mechanism
Exception
protected void startInternal() throws LifecycleException
Service
s) and implement the requirements
of LifecycleBase.startInternal()
.
startInternal
in class LifecycleBase
LifecycleException
- if this component detects a fatal error
that prevents this component from being usedprotected void stopInternal() throws LifecycleException
Service
s) and implement the requirements
of LifecycleBase.stopInternal()
.
stopInternal
in class LifecycleBase
LifecycleException
- if this component detects a fatal error
that needs to be reportedprotected void initInternal() throws LifecycleException
initInternal
in class LifecycleMBeanBase
LifecycleException
protected void destroyInternal() throws LifecycleException
LifecycleMBeanBase
destroyInternal
in class LifecycleMBeanBase
LifecycleException
public ClassLoader getParentClassLoader()
getParentClassLoader
in interface Server
public void setParentClassLoader(ClassLoader parent)
setParentClassLoader
in interface Server
parent
- The new parent class loaderprotected String getDomainInternal()
getDomainInternal
in class LifecycleMBeanBase
protected final String getObjectNameKeyProperties()
LifecycleMBeanBase
ObjectName
that will be used to register this component.
getObjectNameKeyProperties
in class LifecycleMBeanBase
ObjectName
|
Apache Tomcat 7.0.28 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |