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

    • 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
    • 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:
      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

      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
    • getAppByOriginId

      public App getAppByOriginId(String originId)
    • 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)
    • getContextAttribute

      public Object getContextAttribute(String name)
      Get a contextAttribute that will be set for every Context deployed by this provider.
      Parameters:
      name - context attribute name
      Returns:
      the context attribute value
    • getContextAttributes

      public AttributesMap getContextAttributes()
    • 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)
    • removeContextAttribute

      public void removeContextAttribute(String name)
      Remove a contextAttribute that will be set for every Context deployed by this provider.
      Parameters:
      name - the context attribute name
    • 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
    • setContextAttribute

      public void setContextAttribute(String name, Object value)
      Set a contextAttribute that will be set for every Context deployed by this provider.
      Parameters:
      name - the context attribute name
      value - the context attribute value
    • setContextAttributes

      public void setContextAttributes(AttributesMap contextAttributes)
    • 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()
    • scope

      public void scope(XmlConfiguration xmlc, Resource webapp) throws IOException
      Throws:
      IOException