Class DeploymentManager

All Implemented Interfaces:
Container, Destroyable, Dumpable, Dumpable.DumpableContainer, LifeCycle

@ManagedObject("Deployment Manager") public class DeploymentManager extends ContainerLifeCycle
The Deployment Manager.

Responsibilities:

deployment manager roles graph

  1. Tracking Apps and their LifeCycle Location
  2. Managing AppProviders and the Apps that they provide.
  3. Executing AppLifeCycle on App based on current and desired LifeCycle Location.

deployment manager graph

  • Constructor Details

    • DeploymentManager

      public DeploymentManager()
  • Method Details

    • getDefaultEnvironmentName

      public String getDefaultEnvironmentName()
      Get the default Environment name for deployed applications, which is the maximal name when using the Deployable.ENVIRONMENT_COMPARATOR.
      Returns:
      The default Environment name or null.
    • addApp

      public void addApp(App app)
      Receive an app for processing. Most commonly used by the various AppProvider implementations.
      Parameters:
      app - the app
    • setAppProviders

      public void setAppProviders(Collection<AppProvider> providers)
      Set the AppProviders. The providers passed are added via ContainerLifeCycle.addBean(Object) so that their lifecycles may be managed as a ContainerLifeCycle.
      Parameters:
      providers - the app provider list
    • hasAppProviderFor

      public boolean hasAppProviderFor(String environmentName)
    • getAppProviders

      public Collection<AppProvider> getAppProviders()
    • addAppProvider

      public void addAppProvider(AppProvider provider)
    • setLifeCycleBindings

      public void setLifeCycleBindings(Collection<AppLifeCycle.Binding> bindings)
    • getLifeCycleBindings

      public Collection<AppLifeCycle.Binding> getLifeCycleBindings()
    • addLifeCycleBinding

      public void addLifeCycleBinding(AppLifeCycle.Binding binding)
    • insertLifeCycleNode

      public void insertLifeCycleNode(String existingFromNodeName, String existingToNodeName, String insertedNodeName)
      Convenience method to allow for insertion of nodes into the lifecycle.
      Parameters:
      existingFromNodeName - the existing node start
      existingToNodeName - the existing node end
      insertedNodeName - the new node to create between the existing nodes
    • doStart

      protected void doStart() throws Exception
      Description copied from class: ContainerLifeCycle
      Starts the managed lifecycle beans in the order they were added.
      Overrides:
      doStart in class ContainerLifeCycle
      Throws:
      Exception - If there was a problem starting. Will cause a transition to FAILED state
    • doStop

      protected void doStop() throws Exception
      Description copied from class: ContainerLifeCycle
      Stops the managed lifecycle beans in the reverse order they were added.
      Overrides:
      doStop in class ContainerLifeCycle
      Throws:
      Exception - If there was a problem stopping. Will cause a transition to FAILED state
    • getApp

      public App getApp(String appId)
    • getApp

      public App getApp(Path path)
    • getAppEntries

      public Collection<DeploymentManager.AppEntry> getAppEntries()
    • getApps

      public Collection<App> getApps()
    • getApps

      public Collection<App> getApps(Node node)
      Get Set of Apps by Node
      Parameters:
      node - the node to look for.
      Returns:
      the collection of apps for the node
    • getApps

      public Collection<App> getApps(String nodeName)
    • getAppsWithSameContext

      public List<App> getAppsWithSameContext(App app)
    • getContexts

      @ManagedAttribute("Deployed Contexts") public ContextHandlerCollection getContexts()
    • getDefaultLifeCycleGoal

      public String getDefaultLifeCycleGoal()
    • getLifeCycle

      public AppLifeCycle getLifeCycle()
    • getServer

      public Server getServer()
    • removeApp

      public void removeApp(App app)
      Remove the app from the tracking of the DeploymentManager
      Parameters:
      app - if the app is Unavailable remove it from the deployment manager.
    • removeAppProvider

      public void removeAppProvider(AppProvider provider)
    • requestAppGoal

      public void requestAppGoal(App app, String nodeName)
      Move an App through the AppLifeCycle to the desired Node, executing each lifecycle step in the process to reach the desired state.
      Parameters:
      app - the app to move through the process
      nodeName - the name of the node to attain
    • requestAppGoal

      @ManagedOperation(value="request the app to be moved to the specified lifecycle node", impact="ACTION") public void requestAppGoal(@Name("appId") String appId, @Name("nodeName") String nodeName)
      Move an App through the AppLifeCycle to the desired Node, executing each lifecycle step in the process to reach the desired state.
      Parameters:
      appId - the id of the app to move through the process
      nodeName - the name of the node to attain
    • setContexts

      public void setContexts(ContextHandlerCollection contexts)
    • setDefaultLifeCycleGoal

      public void setDefaultLifeCycleGoal(String defaultLifeCycleState)
    • undeployAll

      public void undeployAll()
    • isUseStandardBindings

      public boolean isUseStandardBindings()
    • setUseStandardBindings

      public void setUseStandardBindings(boolean useStandardBindings)
    • getNodes

      public Collection<Node> getNodes()