org.eclipse.jetty.deploy
类 ContextDeployer

java.lang.Object
  继承者 org.eclipse.jetty.util.component.AbstractLifeCycle
      继承者 org.eclipse.jetty.deploy.ContextDeployer
所有已实现的接口:
LifeCycle

已过时。 replaced with ContextProvider from the DeploymentManager

@Deprecated
public class ContextDeployer
extends AbstractLifeCycle

Legacy Context Deployer.

Note: The WebAppDeployer is being phased out of Jetty in favor of the DeploymentManager and ContextProvider implementation.

This deployer scans a designated directory by 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 HandlerWrapper.setHandler(org.eclipse.jetty.server.Handler).

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.

另请参见:
DeploymentManager, ScanningAppProvider

嵌套类摘要
protected  class ContextDeployer.ScannerListener
          已过时。  
 
从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的嵌套类/接口
AbstractLifeCycle.AbstractLifeCycleListener
 
从接口 org.eclipse.jetty.util.component.LifeCycle 继承的嵌套类/接口
LifeCycle.Listener
 
字段摘要
 
从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的字段
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
 
构造方法摘要
ContextDeployer()
          已过时。 Constructor
 
方法摘要
protected  void doStart()
          已过时。 Start the hot deployer looking for webapps to deploy/undeploy
protected  void doStop()
          已过时。 Stop the hot deployer.
 Object getAttribute(String name)
          已过时。 Get a contextAttribute that will be set for every Context deployed by this deployer.
 Resource getConfigurationDir()
          已过时。 use setContextsDir(String)
 ConfigurationManager getConfigurationManager()
          已过时。  
 ContextHandlerCollection getContexts()
          已过时。  
 String getContextsDir()
          已过时。  
 String getDirectory()
          已过时。 use setContextsDir(String)
 boolean getRecursive()
          已过时。  
 int getScanInterval()
          已过时。  
 boolean isRecursive()
          已过时。  
 void removeAttribute(String name)
          已过时。 Remove a contextAttribute that will be set for every Context deployed by this deployer.
 void setAttribute(String name, Object value)
          已过时。 Set a contextAttribute that will be set for every Context deployed by this deployer.
 void setConfigurationDir(File file)
          已过时。 use setContextsDir(String)
 void setConfigurationDir(Resource resource)
          已过时。 use setContextsDir(String)
 void setConfigurationDir(String dir)
          已过时。 use setContextsDir(String)
 void setConfigurationManager(ConfigurationManager configMgr)
          已过时。  
 void setContexts(ContextHandlerCollection contexts)
          已过时。 Associate with a ContextHandlerCollection.
 void setContextsDir(String dir)
          已过时。  
 void setDirectory(String directory)
          已过时。 use setContextsDir(String)
 void setRecursive(boolean recursive)
          已过时。  
 void setScanInterval(int seconds)
          已过时。  
 
从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的方法
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

ContextDeployer

public ContextDeployer()
已过时。 
Constructor

方法详细信息

getContexts

public ContextHandlerCollection getContexts()
已过时。 
返回:
the ContextHandlerColletion to which to deploy the contexts

setContexts

public void setContexts(ContextHandlerCollection contexts)
已过时。 
Associate with a ContextHandlerCollection.

参数:
contexts - the ContextHandlerColletion to which to deploy the contexts

setScanInterval

public void setScanInterval(int seconds)
已过时。 
参数:
seconds - The period in second between scans for changed configuration files. A zero or negative interval disables hot deployment

getScanInterval

public int getScanInterval()
已过时。 

setContextsDir

public void setContextsDir(String dir)
已过时。 
参数:
dir - Directory to scan for context descriptors

getContextsDir

public String getContextsDir()
已过时。 

setConfigurationDir

@Deprecated
public void setConfigurationDir(String dir)
                         throws Exception
已过时。 use setContextsDir(String)

参数:
dir -
抛出:
Exception

setConfigurationDir

@Deprecated
public void setConfigurationDir(File file)
                         throws Exception
已过时。 use setContextsDir(String)

参数:
file -
抛出:
Exception

setConfigurationDir

@Deprecated
public void setConfigurationDir(Resource resource)
已过时。 use setContextsDir(String)

参数:
resource -

setDirectory

@Deprecated
public void setDirectory(String directory)
                  throws Exception
已过时。 use setContextsDir(String)

参数:
directory -
抛出:
Exception

getDirectory

@Deprecated
public String getDirectory()
已过时。 use setContextsDir(String)

返回:
the directory

getConfigurationDir

@Deprecated
public Resource getConfigurationDir()
已过时。 use setContextsDir(String)

返回:
the configuration directory

setConfigurationManager

public void setConfigurationManager(ConfigurationManager configMgr)
已过时。 
参数:
configMgr -

getConfigurationManager

public ConfigurationManager getConfigurationManager()
已过时。 
返回:
the configuration manager

setRecursive

public void setRecursive(boolean recursive)
已过时。 

getRecursive

public boolean getRecursive()
已过时。 

isRecursive

public boolean isRecursive()
已过时。 

setAttribute

public void setAttribute(String name,
                         Object value)
已过时。 
Set a contextAttribute that will be set for every Context deployed by this deployer.

参数:
name -
value -

getAttribute

public Object getAttribute(String name)
已过时。 
Get a contextAttribute that will be set for every Context deployed by this deployer.

参数:
name -
返回:
the attribute value

removeAttribute

public void removeAttribute(String name)
已过时。 
Remove a contextAttribute that will be set for every Context deployed by this deployer.

参数:
name -

doStart

protected void doStart()
                throws Exception
已过时。 
Start the hot deployer looking for webapps to deploy/undeploy

覆盖:
AbstractLifeCycle 中的 doStart
抛出:
Exception
另请参见:
AbstractLifeCycle.doStart()

doStop

protected void doStop()
               throws Exception
已过时。 
Stop the hot deployer.

覆盖:
AbstractLifeCycle 中的 doStop
抛出:
Exception
另请参见:
AbstractLifeCycle.doStop()


Copyright © 2013. All Rights Reserved.