public class VirtualServerFacade extends Object implements VirtualServer
VirtualServer
object from the web application.Constructor and Description |
---|
VirtualServerFacade(String id,
File docRoot,
WebListener... webListeners) |
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()
Return the virtual server identifier.
|
VirtualServer |
getVirtualServer() |
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)
Set the virtual server identifier string.
|
void |
setVirtualServer(VirtualServer vs) |
void |
setWebListeners(WebListener... webListeners)
Sets the collection of WebListener instances from which
this VirtualServer receives requests.
|
public VirtualServerFacade(String id, File docRoot, WebListener... webListeners)
public void setDocRoot(File docRoot)
setDocRoot
in interface VirtualServer
docRoot
- the docroot of this VirtualServer.public File getDocRoot()
getDocRoot
in interface VirtualServer
public String getID()
getID
in interface VirtualServer
public void setID(String id)
setID
in interface VirtualServer
id
- New identifier for this virtual serverpublic void setWebListeners(WebListener... webListeners)
webListeners
- the collection of WebListener instances from which
this VirtualServer receives requests.public Collection<WebListener> getWebListeners()
getWebListeners
in interface VirtualServer
public void addContext(Context context, String contextRoot) throws ConfigException, GlassFishException
If this VirtualServer has already been started, the given context will be started as well.
addContext
in interface VirtualServer
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 startedpublic void removeContext(Context context) throws GlassFishException
removeContext
in interface VirtualServer
context
- the Context to be stopped and removedGlassFishException
- if an error occurs during the stopping
or removal of the given contextpublic Context getContext(String contextRoot)
getContext
in interface VirtualServer
contextRoot
- the context root whose Context to getpublic Collection<Context> getContexts()
getContexts
in interface VirtualServer
public void setConfig(VirtualServerConfig config) throws ConfigException
In order for the given configuration to take effect, this VirtualServer may be stopped and restarted.
setConfig
in interface VirtualServer
config
- the configuration to be appliedConfigException
- if the configuration requires a restart,
and this VirtualServer fails to be restartedpublic VirtualServerConfig getConfig()
getConfig
in interface VirtualServer
public void setVirtualServer(VirtualServer vs)
public VirtualServer getVirtualServer()
Copyright © 2021. All rights reserved.