Package org.apache.catalina.core
Class StandardServer
- java.lang.Object
-
- org.apache.catalina.core.StandardServer
-
-
Field Summary
-
Fields inherited from interface org.apache.catalina.Lifecycle
AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, INIT_EVENT, START_EVENT, STOP_EVENT
-
-
Constructor Summary
Constructors Constructor Description StandardServer()Construct a default instance of this class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLifecycleListener(LifecycleListener listener)Add a LifecycleEvent listener to this component.voidaddPropertyChangeListener(PropertyChangeListener listener)Add a property change listener to this component.voidaddService(Service service)Add a new Service to the set of defined Services.voidawait()Wait until a proper shutdown command is received, then return.List<LifecycleListener>findLifecycleListeners()Gets the (possibly empty) list of lifecycle listeners associated with this StandardServer.ServicefindService(String name)Return the specified Service (if it exists); otherwise returnnull.Service[]findServices()Return the set of Services defined within this Server.intgetDebug()Return the debugging detail level.StringgetDomain()ContextgetGlobalNamingContext()Return the global naming resources context.NamingResourcesgetGlobalNamingResources()Return the global naming resources.StringgetInfo()Return descriptive information about this Server implementation and the corresponding version number, in the format<description>/<version>.ObjectNamegetObjectName()intgetPort()Return the port number we listen to for shutdown commands.ObjectName[]getServiceNames()StringgetShutdown()Return the shutdown command string we are waiting for.voidinit()voidinitialize()Invoke a pre-startup initialization.voidremoveLifecycleListener(LifecycleListener listener)Remove a LifecycleEvent listener from this component.voidremovePropertyChangeListener(PropertyChangeListener listener)Remove a property change listener from this component.voidremoveService(Service service)Remove the specified Service from the set associated from this Server.voidsetDebug(int debug)Set the debugging detail level.voidsetGlobalNamingContext(Context globalNamingContext)Set the global naming resources context.voidsetGlobalNamingResources(NamingResources globalNamingResources)Set the global naming resources.voidsetPort(int port)Set the port number we listen to for shutdown commands.voidsetShutdown(String shutdown)Set the shutdown command we are waiting for.voidstart()Prepare for the beginning of active use of the public methods of this component.voidstop()Gracefully terminate the active use of the public methods of this component.StringtoString()Return a String representation of this component.
-
-
-
Method Detail
-
getDebug
public int getDebug()
Return the debugging detail level.
-
setDebug
public void setDebug(int debug)
Set the debugging detail level.- Parameters:
debug- The new debugging detail level
-
getGlobalNamingContext
public Context getGlobalNamingContext()
Return the global naming resources context.
-
setGlobalNamingContext
public void setGlobalNamingContext(Context globalNamingContext)
Set the global naming resources context.- Parameters:
globalNamingContext- The new global naming resource context
-
getGlobalNamingResources
public NamingResources getGlobalNamingResources()
Return the global naming resources.- Specified by:
getGlobalNamingResourcesin interfaceServer
-
setGlobalNamingResources
public void setGlobalNamingResources(NamingResources globalNamingResources)
Set the global naming resources.- Specified by:
setGlobalNamingResourcesin interfaceServer- Parameters:
globalNamingResources- The new global naming resources
-
getInfo
public String getInfo()
Return descriptive information about this Server implementation and the corresponding version number, in the format<description>/<version>.
-
getPort
public int getPort()
Return the port number we listen to for shutdown commands.
-
setPort
public void setPort(int port)
Set the port number we listen to for shutdown commands.
-
getShutdown
public String getShutdown()
Return the shutdown command string we are waiting for.- Specified by:
getShutdownin interfaceServer
-
setShutdown
public void setShutdown(String shutdown)
Set the shutdown command we are waiting for.- Specified by:
setShutdownin interfaceServer- Parameters:
shutdown- The new shutdown command
-
addService
public void addService(Service service)
Add a new Service to the set of defined Services.- Specified by:
addServicein interfaceServer- Parameters:
service- The Service to be added
-
await
public void await()
Wait until a proper shutdown command is received, then return.
-
findService
public Service findService(String name)
Return the specified Service (if it exists); otherwise returnnull.- Specified by:
findServicein interfaceServer- Parameters:
name- Name of the Service to be returned
-
findServices
public Service[] findServices()
Return the set of Services defined within this Server.- Specified by:
findServicesin interfaceServer
-
getServiceNames
public ObjectName[] getServiceNames()
- Returns:
- the object names of all registered Service instances
-
removeService
public void removeService(Service service)
Remove the specified Service from the set associated from this Server.- Specified by:
removeServicein interfaceServer- Parameters:
service- The Service to be removed
-
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener listener)
Add a property change listener to this component.- Parameters:
listener- The listener to add
-
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener listener)
Remove a property change listener from this component.- Parameters:
listener- The listener to remove
-
toString
public String toString()
Return a String representation of this component.
-
addLifecycleListener
public void addLifecycleListener(LifecycleListener listener)
Add a LifecycleEvent listener to this component.- Specified by:
addLifecycleListenerin interfaceLifecycle- Parameters:
listener- The listener to add
-
findLifecycleListeners
public List<LifecycleListener> findLifecycleListeners()
Gets the (possibly empty) list of lifecycle listeners associated with this StandardServer.- Specified by:
findLifecycleListenersin interfaceLifecycle
-
removeLifecycleListener
public void removeLifecycleListener(LifecycleListener listener)
Remove a LifecycleEvent listener from this component.- Specified by:
removeLifecycleListenerin interfaceLifecycle- Parameters:
listener- The listener to remove
-
start
public void start() throws LifecycleExceptionPrepare for the beginning of active use of the public methods of this component. This method should be called before any of the public methods of this component are utilized. It should also send a LifecycleEvent of type START_EVENT to any registered listeners.- Specified by:
startin interfaceLifecycle- Throws:
LifecycleException- if this component detects a fatal error that prevents this component from being used
-
stop
public void stop() throws LifecycleExceptionGracefully terminate the active use of the public methods of this component. This method should be the last one called on a given instance of this component. It should also send a LifecycleEvent of type STOP_EVENT to any registered listeners.- Specified by:
stopin interfaceLifecycle- Throws:
LifecycleException- if this component detects a fatal error that needs to be reported
-
initialize
public void initialize() throws LifecycleExceptionInvoke a pre-startup initialization. This is used to allow connectors to bind to restricted ports under Unix operating environments.- Specified by:
initializein interfaceServer- Throws:
LifecycleException- If this server was already initialized.
-
getObjectName
public ObjectName getObjectName()
-
getDomain
public String getDomain()
-
-