Package org.apache.catalina
Interface Server
- 
- All Superinterfaces:
- Lifecycle
 - All Known Implementing Classes:
- StandardServer
 
 public interface Server extends Lifecycle AServerelement represents the entire Catalina servlet container. Its attributes represent the characteristics of the servlet container as a whole. AServermay contain one or moreServices, and the top level set of naming resources.Normally, an implementation of this interface will also implement Lifecycle, such that when thestart()andstop()methods are called, all of the definedServicesare also started or stopped.In between, the implementation must open a server socket on the port number specified by the portproperty. When a connection is accepted, the first line is read and compared with the specified shutdown command. If the command matches, shutdown of the server is initiated.- Author:
- Craig R. McClanahan
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.apache.catalina.LifecycleLifecycle.SingleUse
 
- 
 - 
Field Summary- 
Fields inherited from interface org.apache.catalina.LifecycleAFTER_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
 
- 
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddService(Service service)Add a new Service to the set of defined Services.voidawait()Wait until a proper shutdown command is received, then return.ServicefindService(java.lang.String name)Find the specified ServiceService[]findServices()java.lang.StringgetAddress()CatalinagetCatalina()java.io.FilegetCatalinaBase()java.io.FilegetCatalinaHome()javax.naming.ContextgetGlobalNamingContext()NamingResourcesImplgetGlobalNamingResources()java.lang.ObjectgetNamingToken()java.lang.ClassLoadergetParentClassLoader()intgetPort()intgetPortOffset()Get the number that offsets the port used for shutdown commands.intgetPortWithOffset()Get the actual port on which server is listening for the shutdown commands.java.lang.StringgetShutdown()java.util.concurrent.ScheduledExecutorServicegetUtilityExecutor()intgetUtilityThreads()Get the utility thread count.voidremoveService(Service service)Remove the specified Service from the set associated from this Server.voidsetAddress(java.lang.String address)Set the address on which we listen to for shutdown commands.voidsetCatalina(Catalina catalina)Set the outer Catalina startup/shutdown component if present.voidsetCatalinaBase(java.io.File catalinaBase)Set the configured base (instance) directory.voidsetCatalinaHome(java.io.File catalinaHome)Set the configured home (binary) directory.voidsetGlobalNamingResources(NamingResourcesImpl globalNamingResources)Set the global naming resources.voidsetParentClassLoader(java.lang.ClassLoader parent)Set the parent class loader for this server.voidsetPort(int port)Set the port number we listen to for shutdown commands.voidsetPortOffset(int portOffset)Set the number that offsets the server port used for shutdown commands.voidsetShutdown(java.lang.String shutdown)Set the shutdown command we are waiting for.voidsetUtilityThreads(int utilityThreads)Set the utility thread count.- 
Methods inherited from interface org.apache.catalina.LifecycleaddLifecycleListener, destroy, findLifecycleListeners, getState, getStateName, init, removeLifecycleListener, start, stop
 
- 
 
- 
- 
- 
Method Detail- 
getGlobalNamingResourcesNamingResourcesImpl getGlobalNamingResources() - Returns:
- the global naming resources.
 
 - 
setGlobalNamingResourcesvoid setGlobalNamingResources(NamingResourcesImpl globalNamingResources) Set the global naming resources.- Parameters:
- globalNamingResources- The new global naming resources
 
 - 
getGlobalNamingContextjavax.naming.Context getGlobalNamingContext() - Returns:
- the global naming resources context.
 
 - 
getPortint getPort() - Returns:
- the port number we listen to for shutdown commands.
- See Also:
- getPortOffset(),- getPortWithOffset()
 
 - 
setPortvoid setPort(int port) Set the port number we listen to for shutdown commands.- Parameters:
- port- The new port number
- See Also:
- setPortOffset(int)
 
 - 
getPortOffsetint getPortOffset() Get the number that offsets the port used for shutdown commands. For example, if port is 8005, and portOffset is 1000, the server listens at 9005.- Returns:
- the port offset
 
 - 
setPortOffsetvoid setPortOffset(int portOffset) Set the number that offsets the server port used for shutdown commands. For example, if port is 8005, and you set portOffset to 1000, connector listens at 9005.- Parameters:
- portOffset- sets the port offset
 
 - 
getPortWithOffsetint getPortWithOffset() Get the actual port on which server is listening for the shutdown commands. If you do not set port offset, port is returned. If you set port offset, port offset + port is returned.- Returns:
- the port with offset
 
 - 
getAddressjava.lang.String getAddress() - Returns:
- the address on which we listen to for shutdown commands.
 
 - 
setAddressvoid setAddress(java.lang.String address) Set the address on which we listen to for shutdown commands.- Parameters:
- address- The new address
 
 - 
getShutdownjava.lang.String getShutdown() - Returns:
- the shutdown command string we are waiting for.
 
 - 
setShutdownvoid setShutdown(java.lang.String shutdown) Set the shutdown command we are waiting for.- Parameters:
- shutdown- The new shutdown command
 
 - 
getParentClassLoaderjava.lang.ClassLoader getParentClassLoader() - Returns:
- the parent class loader for this component. If not set, return
 getCatalina()Catalina.getParentClassLoader(). If catalina has not been set, return the system class loader.
 
 - 
setParentClassLoadervoid setParentClassLoader(java.lang.ClassLoader parent) Set the parent class loader for this server.- Parameters:
- parent- The new parent class loader
 
 - 
getCatalinaCatalina getCatalina() - Returns:
- the outer Catalina startup/shutdown component if present.
 
 - 
setCatalinavoid setCatalina(Catalina catalina) Set the outer Catalina startup/shutdown component if present.- Parameters:
- catalina- the outer Catalina component
 
 - 
getCatalinaBasejava.io.File getCatalinaBase() - Returns:
- the configured base (instance) directory. Note that home and base
 may be the same (and are by default). If this is not set the value
 returned by getCatalinaHome()will be used.
 
 - 
setCatalinaBasevoid setCatalinaBase(java.io.File catalinaBase) Set the configured base (instance) directory. Note that home and base may be the same (and are by default).- Parameters:
- catalinaBase- the configured base directory
 
 - 
getCatalinaHomejava.io.File getCatalinaHome() - Returns:
- the configured home (binary) directory. Note that home and base may be the same (and are by default).
 
 - 
setCatalinaHomevoid setCatalinaHome(java.io.File catalinaHome) Set the configured home (binary) directory. Note that home and base may be the same (and are by default).- Parameters:
- catalinaHome- the configured home directory
 
 - 
getUtilityThreadsint getUtilityThreads() Get the utility thread count.- Returns:
- the thread count
 
 - 
setUtilityThreadsvoid setUtilityThreads(int utilityThreads) Set the utility thread count.- Parameters:
- utilityThreads- the new thread count
 
 - 
addServicevoid addService(Service service) Add a new Service to the set of defined Services.- Parameters:
- service- The Service to be added
 
 - 
awaitvoid await() Wait until a proper shutdown command is received, then return.
 - 
findServiceService findService(java.lang.String name) Find the specified Service- Parameters:
- name- Name of the Service to be returned
- Returns:
- the specified Service, or nullif none exists.
 
 - 
findServicesService[] findServices() - Returns:
- the set of Services defined within this Server.
 
 - 
removeServicevoid removeService(Service service) Remove the specified Service from the set associated from this Server.- Parameters:
- service- The Service to be removed
 
 - 
getNamingTokenjava.lang.Object getNamingToken() - Returns:
- the token necessary for operations on the associated JNDI naming context.
 
 - 
getUtilityExecutorjava.util.concurrent.ScheduledExecutorService getUtilityExecutor() - Returns:
- the utility executor managed by the Service.
 
 
- 
 
-