setConfigurationDir(String) for the appearance/disappearance or
changes to xml configuration files. The scan is performed at startup and at
an optional hot deployment frequency specified by
setScanInterval(int). By default, the scanning is NOT recursive,
but can be made so by setRecursive(boolean).
Each configuration file is in XmlConfiguration format and represents
the configuration of a instance of ContextHandler (or a subclass
specified by the XML Configure element).
The xml should configure the context and the instance is deployed to the
ContextHandlerCollection specified by setContexts(Server).
Similarly, when one of these existing files is removed, the corresponding
context is undeployed; when one of these files is changed, the corresponding
context is undeployed, the (changed) xml config file reapplied to it, and
then (re)deployed.
Note that the context itself is NOT copied into the hot deploy directory. The
webapp directory or war file can exist anywhere. It is the xml config file
that points to it's location and deploys it from there.
It means, for example, that you can keep a "read-only" copy of your webapp
somewhere, and apply different configurations to it simply by dropping
different xml configuration files into the configuration directory.
| Modifier and Type | Class and Description |
|---|---|
| protected class |
| Modifier and Type | Field and Description |
|---|---|
| private ConfigurationManager | |
| private Resource | |
| private ContextHandlerCollection | |
| private Map | |
| private boolean | |
| private int | |
| private Scanner | |
| private ContextDeployer. | |
| public static final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private ContextHandler | createContext(String
the config file found in the hot deploy directory filename)Create a WebAppContext for the webapp being hot deployed, then apply the xml config file to it to configure it. |
| private void | |
| protected void | doStart()
Start the hot deployer looking for webapps to deploy/undeploy
|
| protected void | |
| public Resource | |
| public ConfigurationManager | |
| public ContextHandlerCollection | |
| public String | |
| public boolean | |
| public int | |
| public boolean | |
| private void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | setContexts(ContextHandlerCollection
the ContextHandlerColletion to which to deploy the contexts contexts)Associate with a |
| public void | |
| public void | |
| public void | setScanInterval(int
The period in second between scans for changed configuration
files. A zero or negative interval disables hot deployment seconds)
|
| private void |
| _configMgr | back to summary |
|---|---|
| private ConfigurationManager _configMgr | |
| _configurationDir | back to summary |
|---|---|
| private Resource _configurationDir | |
| _contexts | back to summary |
|---|---|
| private ContextHandlerCollection _contexts | |
| _currentDeployments | back to summary |
|---|---|
| private Map<K, V> _currentDeployments | |
| _recursive | back to summary |
|---|---|
| private boolean _recursive | |
| _scanInterval | back to summary |
|---|---|
| private int _scanInterval | |
| _scanner | back to summary |
|---|---|
| private Scanner _scanner | |
| _scannerListener | back to summary |
|---|---|
| private ContextDeployer. | |
| NAME | back to summary |
|---|---|
| public static final String NAME | |
| ContextDeployer | back to summary |
|---|---|
| public ContextDeployer() throws Exception Constructor | |
| createContext | back to summary |
|---|---|
| private ContextHandler createContext(String filename) throws Exception Create a WebAppContext for the webapp being hot deployed, then apply the xml config file to it to configure it.
| |
| deploy | back to summary |
|---|---|
| private void deploy(String filename) throws Exception | |
| doStart | back to summary |
|---|---|
| protected void doStart() throws Exception Overrides org. Start the hot deployer looking for webapps to deploy/undeploy | |
| doStop | back to summary |
|---|---|
| protected void doStop() throws Exception Overrides org. Stop the hot deployer. | |
| getConfigurationDir | back to summary |
|---|---|
| public Resource getConfigurationDir() | |
| getConfigurationManager | back to summary |
|---|---|
| public ConfigurationManager getConfigurationManager() | |
| getContexts | back to summary |
|---|---|
public ContextHandlerCollection getContexts()
| |
| getDirectory | back to summary |
|---|---|
| public String getDirectory() | |
| getRecursive | back to summary |
|---|---|
| public boolean getRecursive() | |
| getScanInterval | back to summary |
|---|---|
| public int getScanInterval() | |
| isRecursive | back to summary |
|---|---|
| public boolean isRecursive() | |
| redeploy | back to summary |
|---|---|
| private void redeploy(String filename) throws Exception | |
| setConfigurationDir | back to summary |
|---|---|
| public void setConfigurationDir(String dir) throws Exception | |
| setConfigurationDir | back to summary |
|---|---|
| public void setConfigurationDir(File file) throws Exception | |
| setConfigurationDir | back to summary |
|---|---|
| public void setConfigurationDir(Resource resource) | |
| setConfigurationManager | back to summary |
|---|---|
| public void setConfigurationManager(ConfigurationManager configMgr) | |
| setContexts | back to summary |
|---|---|
| public void setContexts(ContextHandlerCollection contexts) Associate with a
| |
| setDirectory | back to summary |
|---|---|
| public void setDirectory(String directory) throws Exception | |
| setRecursive | back to summary |
|---|---|
| public void setRecursive(boolean recursive) | |
| setScanInterval | back to summary |
|---|---|
public void setScanInterval(int seconds)
| |
| undeploy | back to summary |
|---|---|
| private void undeploy(String filename) throws Exception | |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public void | fileAdded(String filename)
Implements org. |
| public void | fileChanged(String filename)
Implements org. |
| public void | fileRemoved(String filename)
Implements org. |
| public String |
| ScannerListener | back to summary |
|---|---|
| protected ScannerListener() | |
| fileAdded | back to summary |
|---|---|
| public void fileAdded(String filename) throws Exception Implements org. Handle a new deployment | |
| fileChanged | back to summary |
|---|---|
| public void fileChanged(String filename) throws Exception Implements org. Handle a change to an existing deployment. Undeploy then redeploy. | |
| fileRemoved | back to summary |
|---|---|
| public void fileRemoved(String filename) throws Exception Implements org. Handle an undeploy. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
| |