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.StopException

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container

    org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.Listener

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable

    org.eclipse.jetty.util.component.Dumpable.DumpableContainer

    Nested 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, STOPPING

    Fields inherited from interface org.eclipse.jetty.util.component.Dumpable

    KEY
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addScannerListener(org.eclipse.jetty.util.Scanner.Listener listener)
     
    protected App
    createApp(String filename)
    Called by the Scanner.DiscreteListener to create a new App object.
    protected void
     
    protected void
     
    protected boolean
    exists(String path)
     
    protected void
    fileAdded(String filename)
     
    protected void
    fileChanged(String filename)
     
    protected void
    fileRemoved(String filename)
     
    protected Map<String,App>
     
    Get the deploymentManager.
     
    org.eclipse.jetty.util.resource.Resource
     
    List<org.eclipse.jetty.util.resource.Resource>
     
    int
     
    boolean
     
    void
     
    void
    Set the Deployment Manager
    protected void
     
    void
     
    void
     
    void
    setMonitoredDirResource(org.eclipse.jetty.util.resource.Resource resource)
     
    void
    setMonitoredResources(List<org.eclipse.jetty.util.resource.Resource> resources)
     
    void
    setScanInterval(int scanInterval)
     
    void
    setUseRealPaths(boolean useRealPaths)
     
     

    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, 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

    dumpSelf

    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

      protected ScanningAppProvider(FilenameFilter filter)
  • 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

      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 by Resource.newResource(String)
      Returns:
      The App object for this particular context definition file.
    • doStart

      protected void doStart() throws Exception
      Overrides:
      doStart in class org.eclipse.jetty.util.component.ContainerLifeCycle
      Throws:
      Exception
    • doStop

      protected void doStop() throws Exception
      Overrides:
      doStop in class org.eclipse.jetty.util.component.ContainerLifeCycle
      Throws:
      Exception
    • exists

      protected boolean exists(String path)
    • fileAdded

      protected void fileAdded(String filename) throws Exception
      Throws:
      Exception
    • fileChanged

      protected void fileChanged(String filename) throws Exception
      Throws:
      Exception
    • fileRemoved

      protected void fileRemoved(String filename) throws Exception
      Throws:
      Exception
    • 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()
    • setDeploymentManager

      public void setDeploymentManager(DeploymentManager deploymentManager)
      Description copied from interface: AppProvider
      Set the Deployment Manager
      Specified by:
      setDeploymentManager in interface AppProvider
      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)
    • setScanInterval

      public void setScanInterval(int scanInterval)
    • scan

      @ManagedOperation(value="Scan the monitored directories", impact="ACTION") public void scan()
    • toString

      public String toString()
      Overrides:
      toString in class org.eclipse.jetty.util.component.AbstractLifeCycle