public interface VirtualServer
Instances of VirtualServer may be in one of two states: stopped or started. Any requests mapped to a VirtualServer that was stopped will result in a response with a status code equal to javax.servlet.http.HttpServletResponse#SC_NOT_FOUND.
SeeWebContainer for usage example.| Modifier and Type | Method and Description |
|---|---|
void |
addContext(Context context,
String contextRoot)
Registers the given Context with this VirtualServer
at the given context root.
|
VirtualServerConfig |
getConfig()
Gets the current configuration of this VirtualServer.
|
Context |
getContext(String contextRoot)
Finds the Context registered at the given context root.
|
Collection<Context> |
getContexts()
Gets the collection of Context instances registered with
this VirtualServer.
|
File |
getDocRoot()
Gets the docroot of this VirtualServer.
|
String |
getID()
Gets the id of this VirtualServer.
|
Collection<WebListener> |
getWebListeners()
Gets the collection of WebListener instances from which
this VirtualServer receives requests.
|
void |
removeContext(Context context)
Stops the given context and removes it from this
VirtualServer.
|
void |
setConfig(VirtualServerConfig config)
Reconfigures this VirtualServer with the given
configuration.
|
void |
setDocRoot(File docRoot)
Sets the docroot of this VirtualServer.
|
void |
setID(String ID)
Sets the id of this VirtualServer.
|
void setID(String ID)
ID - id of this VirtualServer.String getID()
void setDocRoot(File docRoot)
docRoot - the docroot of this VirtualServer.File getDocRoot()
Collection<WebListener> getWebListeners()
void addContext(Context context, String contextRoot) throws ConfigException, GlassFishException
If this VirtualServer has already been started, the given context will be started as well.
context - the Context to registercontextRoot - the context root at which to registerConfigException - if a Context already exists
at the given context root on this VirtualServerGlassFishException - if the given context fails
to be startedvoid removeContext(Context context) throws GlassFishException
context - the Context to be stopped and removedGlassFishException - if an error occurs during the stopping
or removal of the given contextContext getContext(String contextRoot)
contextRoot - the context root whose Context to getCollection<Context> getContexts()
void setConfig(VirtualServerConfig config) throws ConfigException
In order for the given configuration to take effect, this VirtualServer may be stopped and restarted.
config - the configuration to be appliedConfigException - if the configuration requires a restart,
and this VirtualServer fails to be restartedVirtualServerConfig getConfig()
Copyright © 2017. All rights reserved.