Class ScanningAppProvider
- java.lang.Object
-
- org.eclipse.jetty.util.component.AbstractLifeCycle
-
- org.eclipse.jetty.deploy.providers.ScanningAppProvider
-
- All Implemented Interfaces:
AppProvider,org.eclipse.jetty.util.component.LifeCycle
- Direct Known Subclasses:
WebAppProvider
@ManagedObject("Abstract Provider for loading webapps") public abstract class ScanningAppProvider extends org.eclipse.jetty.util.component.AbstractLifeCycle implements AppProvider
-
-
Field Summary
Fields Modifier and Type Field Description protected FilenameFilter_filenameFilter
-
Constructor Summary
Constructors Modifier Constructor Description protectedScanningAppProvider()protectedScanningAppProvider(FilenameFilter filter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddScannerListener(org.eclipse.jetty.util.Scanner.Listener listener)protected AppcreateApp(String filename)Called by the Scanner.DiscreteListener to create a new App object.protected voiddoStart()protected voiddoStop()protected booleanexists(String path)protected voidfileAdded(String filename)protected voidfileChanged(String filename)protected voidfileRemoved(String filename)protected Map<String,App>getDeployedApps()DeploymentManagergetDeploymentManager()Get the deploymentManager.StringgetMonitoredDirName()org.eclipse.jetty.util.resource.ResourcegetMonitoredDirResource()List<org.eclipse.jetty.util.resource.Resource>getMonitoredResources()intgetScanInterval()booleanisRecursive()voidsetDeploymentManager(DeploymentManager deploymentManager)Set the Deployment Managerprotected voidsetFilenameFilter(FilenameFilter filter)voidsetMonitoredDirectories(Collection<String> directories)voidsetMonitoredDirName(String dir)voidsetMonitoredDirResource(org.eclipse.jetty.util.resource.Resource resource)voidsetMonitoredResources(List<org.eclipse.jetty.util.resource.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
-
-
-
-
Field Detail
-
_filenameFilter
protected FilenameFilter _filenameFilter
-
-
Constructor Detail
-
ScanningAppProvider
protected ScanningAppProvider()
-
ScanningAppProvider
protected ScanningAppProvider(FilenameFilter filter)
-
-
Method Detail
-
setFilenameFilter
protected void setFilenameFilter(FilenameFilter filter)
-
getDeployedApps
protected Map<String,App> getDeployedApps()
- Returns:
- The index of currently deployed applications.
-
createApp
protected App createApp(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 Exception- Overrides:
doStartin classorg.eclipse.jetty.util.component.AbstractLifeCycle- Throws:
Exception
-
doStop
protected void doStop() throws Exception- Overrides:
doStopin classorg.eclipse.jetty.util.component.AbstractLifeCycle- Throws:
Exception
-
exists
protected boolean exists(String path)
-
getDeploymentManager
public DeploymentManager getDeploymentManager()
Get the deploymentManager.- Returns:
- the deploymentManager
-
getMonitoredDirResource
public org.eclipse.jetty.util.resource.Resource getMonitoredDirResource()
-
getMonitoredDirName
public 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(List<org.eclipse.jetty.util.resource.Resource> resources)
-
getMonitoredResources
public List<org.eclipse.jetty.util.resource.Resource> getMonitoredResources()
-
setMonitoredDirResource
public void setMonitoredDirResource(org.eclipse.jetty.util.resource.Resource resource)
-
addScannerListener
public void addScannerListener(org.eclipse.jetty.util.Scanner.Listener listener)
-
setMonitoredDirName
public void setMonitoredDirName(String dir)
- Parameters:
dir- Directory to scan for context descriptors or war files
-
setMonitoredDirectories
public void setMonitoredDirectories(Collection<String> directories)
-
setRecursive
protected void setRecursive(boolean recursive)
-
setScanInterval
public void setScanInterval(int scanInterval)
-
-