Class ScanningAppProvider

java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.deploy.providers.ScanningAppProvider
All Implemented Interfaces:
AppProvider, LifeCycle
Direct Known Subclasses:
WebAppProvider

@ManagedObject("Abstract Provider for loading webapps") public abstract class ScanningAppProvider extends AbstractLifeCycle implements AppProvider
  • Field Details

  • Constructor Details

    • ScanningAppProvider

      protected ScanningAppProvider()
    • ScanningAppProvider

      protected ScanningAppProvider(FilenameFilter filter)
  • Method Details

    • 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 AbstractLifeCycle
      Throws:
      Exception
    • doStop

      protected void doStop() throws Exception
      Overrides:
      doStop in class AbstractLifeCycle
      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 Resource getMonitoredDirResource()
    • getMonitoredDirName

      public String getMonitoredDirName()
    • getScanInterval

      @ManagedAttribute("scanning interval to detect changes which need reloaded") public int getScanInterval()
    • isRecursive

      @ManagedAttribute("recursive scanning supported") public boolean isRecursive()
    • 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<Resource> resources)
    • getMonitoredResources

      public List<Resource> getMonitoredResources()
    • setMonitoredDirResource

      public void setMonitoredDirResource(Resource resource)
    • addScannerListener

      public void addScannerListener(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)
    • setRecursive

      protected void setRecursive(boolean recursive)
    • setScanInterval

      public void setScanInterval(int scanInterval)
    • scan

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