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:
ContextProvider
@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 booleanGet the deploymentManager.org.eclipse.jetty.util.resource.ResourceList<org.eclipse.jetty.util.resource.Resource> intbooleanTest if initial scan should be deferred.booleanprotected voidprotected voidpathChanged(Path path) protected voidpathRemoved(Path path) voidscan()voidsetDeferInitialScan(boolean defer) Flag to control initial scan behavior.voidsetDeploymentManager(DeploymentManager deploymentManager) Set the Deployment ManagervoidsetEnvironmentName(String environmentName) protected 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, installBean, installBean, 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
-
getEnvironmentName
- Specified by:
getEnvironmentNamein interfaceAppProvider- Returns:
- The name of the
Environmentthis provider is for.
-
setEnvironmentName
-
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
-
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:
path- The file that is the context.xml. It is resolved byResourceFactory.newResource(String)- Returns:
- The App object for this particular context definition file.
-
doStart
-
doStop
-
exists
-
pathAdded
-
pathChanged
-
pathRemoved
-
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
-
isDeferInitialScan
public boolean isDeferInitialScan()Test if initial scan should be deferred.- Returns:
- true if initial scan is deferred, false to have initial scan occur on startup of ScanningAppProvider.
-
setDeferInitialScan
public void setDeferInitialScan(boolean defer) Flag to control initial scan behavior.true- to have initial scan deferred until theServercomponent has reached it's STARTED state.
Note: any failures in a deploy will not fail the Server startup in this mode.false- (default value) to have initial scan occur as normal on ScanningAppProvider startup.
- Parameters:
defer- true to defer initial scan, false to have initial scan occur on startup of ScanningAppProvider.
-
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
-