Module org.eclipse.jetty.deploy
Class ScanningAppProvider
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.deploy.providers.ScanningAppProvider
- All Implemented Interfaces:
AppProvider,org.eclipse.jetty.util.component.Container,org.eclipse.jetty.util.component.Destroyable,org.eclipse.jetty.util.component.Dumpable,org.eclipse.jetty.util.component.Dumpable.DumpableContainer,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.ContainerLifeCycle
implements AppProvider
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
org.eclipse.jetty.util.component.Dumpable.DumpableContainerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
org.eclipse.jetty.util.component.LifeCycle.Listener -
Field Summary
Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
FAILED, STARTED, STARTING, STOPPED, STOPPINGFields inherited from interface org.eclipse.jetty.util.component.Dumpable
KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddScannerListener(org.eclipse.jetty.util.Scanner.Listener listener) protected AppCalled by the Scanner.DiscreteListener to create a new App object.protected voiddoStart()protected voiddoStop()protected booleanprotected voidprotected voidfileChanged(String filename) protected voidfileRemoved(String filename) Get the deploymentManager.org.eclipse.jetty.util.resource.ResourceList<org.eclipse.jetty.util.resource.Resource> intbooleanvoidscan()voidsetDeploymentManager(DeploymentManager deploymentManager) Set the Deployment Managerprotected voidsetFilenameFilter(FilenameFilter filter) voidsetMonitoredDirectories(Collection<String> directories) voidvoidsetMonitoredDirResource(org.eclipse.jetty.util.resource.Resource resource) voidsetMonitoredResources(List<org.eclipse.jetty.util.resource.Resource> resources) voidsetScanInterval(int scanInterval) voidsetUseRealPaths(boolean useRealPaths) toString()Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeansMethods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.deploy.AppProvider
createContextHandlerMethods inherited from interface org.eclipse.jetty.util.component.Container
getCachedBeans, getEventListenersMethods inherited from interface org.eclipse.jetty.util.component.Dumpable
dumpSelfMethods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpableMethods inherited from interface org.eclipse.jetty.util.component.LifeCycle
addEventListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeEventListener, start, stop
-
Constructor Details
-
ScanningAppProvider
protected ScanningAppProvider() -
ScanningAppProvider
-
-
Method Details
-
isUseRealPaths
public boolean isUseRealPaths()- Returns:
- True if the real path of the scanned files should be used for deployment.
-
setUseRealPaths
public void setUseRealPaths(boolean useRealPaths) - Parameters:
useRealPaths- True if the real path of the scanned files should be used for deployment.
-
setFilenameFilter
-
getDeployedApps
- Returns:
- The index of currently deployed applications.
-
createApp
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
- Overrides:
doStartin classorg.eclipse.jetty.util.component.ContainerLifeCycle- Throws:
Exception
-
doStop
- Overrides:
doStopin classorg.eclipse.jetty.util.component.ContainerLifeCycle- Throws:
Exception
-
exists
-
fileAdded
- Throws:
Exception
-
fileChanged
- Throws:
Exception
-
fileRemoved
- Throws:
Exception
-
getDeploymentManager
Get the deploymentManager.- Returns:
- the deploymentManager
-
getMonitoredDirResource
public org.eclipse.jetty.util.resource.Resource getMonitoredDirResource() -
getMonitoredDirName
-
getScanInterval
@ManagedAttribute("scanning interval to detect changes which need reloaded") public int getScanInterval() -
setDeploymentManager
Description copied from interface:AppProviderSet the Deployment Manager- Specified by:
setDeploymentManagerin interfaceAppProvider- Parameters:
deploymentManager- the deployment manager
-
setMonitoredResources
-
getMonitoredResources
-
setMonitoredDirResource
public void setMonitoredDirResource(org.eclipse.jetty.util.resource.Resource resource) -
addScannerListener
public void addScannerListener(org.eclipse.jetty.util.Scanner.Listener listener) -
setMonitoredDirName
- Parameters:
dir- Directory to scan for context descriptors or war files
-
setMonitoredDirectories
-
setScanInterval
public void setScanInterval(int scanInterval) -
scan
@ManagedOperation(value="Scan the monitored directories", impact="ACTION") public void scan() -
toString
- Overrides:
toStringin classorg.eclipse.jetty.util.component.AbstractLifeCycle
-