Class ScanningAppProvider
- java.lang.Object
-
- org.eclipse.jetty.util.component.AbstractLifeCycle
-
- org.eclipse.jetty.deploy.providers.ScanningAppProvider
-
- All Implemented Interfaces:
AppProvider,LifeCycle
- Direct Known Subclasses:
WebAppProvider
@ManagedObject("Abstract Provider for loading webapps") public abstract class ScanningAppProvider extends AbstractLifeCycle implements AppProvider
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
-
Field Summary
Fields Modifier and Type Field Description protected java.io.FilenameFilter_filenameFilter
-
Constructor Summary
Constructors Modifier Constructor Description protectedScanningAppProvider()protectedScanningAppProvider(java.io.FilenameFilter filter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddScannerListener(Scanner.Listener listener)protected AppcreateApp(java.lang.String filename)Called by the Scanner.DiscreteListener to create a new App object.protected voiddoStart()protected voiddoStop()protected booleanexists(java.lang.String path)protected voidfileAdded(java.lang.String filename)protected voidfileChanged(java.lang.String filename)protected voidfileRemoved(java.lang.String filename)protected java.util.Map<java.lang.String,App>getDeployedApps()DeploymentManagergetDeploymentManager()Get the deploymentManager.java.lang.StringgetMonitoredDirName()ResourcegetMonitoredDirResource()java.util.List<Resource>getMonitoredResources()intgetScanInterval()booleanisRecursive()voidscan()voidsetDeploymentManager(DeploymentManager deploymentManager)Set the Deployment Managerprotected voidsetFilenameFilter(java.io.FilenameFilter filter)voidsetMonitoredDirectories(java.util.Collection<java.lang.String> directories)voidsetMonitoredDirName(java.lang.String dir)voidsetMonitoredDirResource(Resource resource)voidsetMonitoredResources(java.util.List<Resource> resources)protected voidsetRecursive(boolean recursive)voidsetScanInterval(int scanInterval)-
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stop, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.jetty.deploy.AppProvider
createContextHandler
-
Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
-
-
-
-
Method Detail
-
setFilenameFilter
protected void setFilenameFilter(java.io.FilenameFilter filter)
-
getDeployedApps
protected java.util.Map<java.lang.String,App> getDeployedApps()
- Returns:
- The index of currently deployed applications.
-
createApp
protected App createApp(java.lang.String filename)
Called by the Scanner.DiscreteListener to create a new App object. Isolated in a method so that it is possible to override the default App object for specialized implementations of the AppProvider.- Parameters:
filename- The file that is the context.xml. It is resolved byResource.newResource(String)- Returns:
- The App object for this particular context definition file.
-
doStart
protected void doStart() throws java.lang.Exception- Overrides:
doStartin classAbstractLifeCycle- Throws:
java.lang.Exception
-
doStop
protected void doStop() throws java.lang.Exception- Overrides:
doStopin classAbstractLifeCycle- Throws:
java.lang.Exception
-
exists
protected boolean exists(java.lang.String path)
-
fileAdded
protected void fileAdded(java.lang.String filename) throws java.lang.Exception- Throws:
java.lang.Exception
-
fileChanged
protected void fileChanged(java.lang.String filename) throws java.lang.Exception- Throws:
java.lang.Exception
-
fileRemoved
protected void fileRemoved(java.lang.String filename) throws java.lang.Exception- Throws:
java.lang.Exception
-
getDeploymentManager
public DeploymentManager getDeploymentManager()
Get the deploymentManager.- Returns:
- the deploymentManager
-
getMonitoredDirResource
public Resource getMonitoredDirResource()
-
getMonitoredDirName
public java.lang.String getMonitoredDirName()
-
getScanInterval
@ManagedAttribute("scanning interval to detect changes which need reloaded") public int getScanInterval()
-
isRecursive
@ManagedAttribute("recursive scanning supported") public boolean isRecursive()
-
setDeploymentManager
public void setDeploymentManager(DeploymentManager deploymentManager)
Description copied from interface:AppProviderSet the Deployment Manager- Specified by:
setDeploymentManagerin interfaceAppProvider- Parameters:
deploymentManager- the deployment manager
-
setMonitoredResources
public void setMonitoredResources(java.util.List<Resource> resources)
-
getMonitoredResources
public java.util.List<Resource> getMonitoredResources()
-
setMonitoredDirResource
public void setMonitoredDirResource(Resource resource)
-
addScannerListener
public void addScannerListener(Scanner.Listener listener)
-
setMonitoredDirName
public void setMonitoredDirName(java.lang.String dir)
- Parameters:
dir- Directory to scan for context descriptors or war files
-
setMonitoredDirectories
public void setMonitoredDirectories(java.util.Collection<java.lang.String> directories)
-
setRecursive
protected void setRecursive(boolean recursive)
-
setScanInterval
public void setScanInterval(int scanInterval)
-
scan
@ManagedOperation(value="Scan the monitored directories", impact="ACTION") public void scan()
-
-