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:
ContextProvider
@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.StopException
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.Listener
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addScannerListener
(Scanner.Listener listener) protected App
Called by the Scanner.DiscreteListener to create a new App object.protected void
doStart()
Starts the managed lifecycle beans in the order they were added.protected void
doStop()
Stops the managed lifecycle beans in the reverse order they were added.protected boolean
Get the deploymentManager.int
boolean
Test if initial scan should be deferred.boolean
protected void
protected void
pathChanged
(Path path) protected void
pathRemoved
(Path path) void
scan()
void
setDeferInitialScan
(boolean defer) Flag to control initial scan behavior.void
setDeploymentManager
(DeploymentManager deploymentManager) Set the Deployment Managervoid
setEnvironmentName
(String environmentName) protected void
setFilenameFilter
(FilenameFilter filter) void
setMonitoredDirectories
(Collection<String> directories) void
void
setMonitoredDirResource
(Resource resource) void
setMonitoredResources
(List<Resource> resources) void
setScanInterval
(int scanInterval) void
setUseRealPaths
(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, updateBeans
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop
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.Container
getCachedBeans, getEventListeners
Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
Methods 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:
getEnvironmentName
in interfaceAppProvider
- Returns:
- The name of the
Environment
this 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
- 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:
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
Description copied from class:ContainerLifeCycle
Starts the managed lifecycle beans in the order they were added.- Overrides:
doStart
in 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:ContainerLifeCycle
Stops the managed lifecycle beans in the reverse order they were added.- Overrides:
doStop
in classContainerLifeCycle
- Throws:
Exception
- If there was a problem stopping. Will cause a transition to FAILED state
-
exists
-
pathAdded
- Throws:
Exception
-
pathChanged
- Throws:
Exception
-
pathRemoved
- 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:AppProvider
Set the Deployment Manager- Specified by:
setDeploymentManager
in 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 theServer
component 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:
toString
in classAbstractLifeCycle
-