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,Container,Destroyable,Dumpable,Dumpable.DumpableContainer,LifeCycle
- Direct Known Subclasses:
WebAppProvider
@ManagedObject("Abstract Provider for loading webapps")
public abstract class ScanningAppProvider
extends ContainerLifeCycle
implements AppProvider
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener, AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddScannerListener(Scanner.Listener listener) protected AppCalled by the Scanner.DiscreteListener to create a new App object.protected voiddoStart()Starts the managed lifecycle beans in the order they were added.protected voiddoStop()Stops the managed lifecycle beans in the reverse order they were added.protected booleanprotected voidprotected voidfileChanged(String filename) protected voidfileRemoved(String filename) Get the deploymentManager.intbooleanTest if initial scan should be deferred.booleanvoidscan()voidsetDeferInitialScan(boolean defer) Flag to control initial scan behavior.voidsetDeploymentManager(DeploymentManager deploymentManager) Set the Deployment Managerprotected voidsetFilenameFilter(FilenameFilter filter) voidsetMonitoredDirectories(Collection<String> directories) voidvoidsetMonitoredDirResource(Resource resource) voidsetMonitoredResources(List<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.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
Description copied from class:ContainerLifeCycleStarts the managed lifecycle beans in the order they were added.- Overrides:
doStartin classContainerLifeCycle- Throws:
AbstractLifeCycle.StopException- If thrown, the lifecycle will immediately be stopped.Exception- If there was a problem starting. Will cause a transition to FAILED state
-
doStop
Description copied from class:ContainerLifeCycleStops the managed lifecycle beans in the reverse order they were added.- Overrides:
doStopin classContainerLifeCycle- Throws:
Exception- If there was a problem stopping. Will cause a transition to FAILED state
-
exists
-
fileAdded
- Throws:
Exception
-
fileChanged
- Throws:
Exception
-
fileRemoved
- Throws:
Exception
-
getDeploymentManager
Get the deploymentManager.- Returns:
- the deploymentManager
-
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
-
addScannerListener
-
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
-
toString
- Overrides:
toStringin classAbstractLifeCycle
-