Class DeploymentManager

  • All Implemented Interfaces:
    org.eclipse.jetty.util.component.Container, org.eclipse.jetty.util.component.Destroyable, org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.component.LifeCycle

    @ManagedObject("Deployment Manager")
    public class DeploymentManager
    extends org.eclipse.jetty.util.component.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

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      class  DeploymentManager.AppEntry
      Represents a single tracked app within the deployment manager.
      • Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

        org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener
      • 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.LifeCycle

        org.eclipse.jetty.util.component.LifeCycle.Listener
    • Field Summary

      • Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

        FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
      • Fields inherited from interface org.eclipse.jetty.util.component.Dumpable

        KEY
    • Constructor Detail

      • DeploymentManager

        public DeploymentManager()
    • Method Detail

      • 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​(java.util.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 java.util.Collection<AppProvider> getAppProviders()
      • addAppProvider

        public void addAppProvider​(AppProvider provider)
      • setLifeCycleBindings

        public void setLifeCycleBindings​(java.util.Collection<AppLifeCycle.Binding> bindings)
      • insertLifeCycleNode

        public void insertLifeCycleNode​(java.lang.String existingFromNodeName,
                                        java.lang.String existingToNodeName,
                                        java.lang.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 java.lang.Exception
        Overrides:
        doStart in class org.eclipse.jetty.util.component.ContainerLifeCycle
        Throws:
        java.lang.Exception
      • doStop

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

        public App getAppByOriginId​(java.lang.String originId)
      • getApps

        public java.util.Collection<App> getApps()
      • getApps

        public java.util.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
      • getAppsWithSameContext

        public java.util.List<App> getAppsWithSameContext​(App app)
      • getContextAttribute

        public java.lang.Object getContextAttribute​(java.lang.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 org.eclipse.jetty.util.AttributesMap getContextAttributes()
      • getContexts

        @ManagedAttribute("Deployed Contexts")
        public org.eclipse.jetty.server.handler.ContextHandlerCollection getContexts()
      • getDefaultLifeCycleGoal

        public java.lang.String getDefaultLifeCycleGoal()
      • getServer

        public org.eclipse.jetty.server.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​(java.lang.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,
                                   java.lang.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")
                                   java.lang.String appId,
                                   @Name("nodeName")
                                   java.lang.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​(java.lang.String name,
                                        java.lang.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​(org.eclipse.jetty.util.AttributesMap contextAttributes)
      • setContexts

        public void setContexts​(org.eclipse.jetty.server.handler.ContextHandlerCollection contexts)
      • setDefaultLifeCycleGoal

        public void setDefaultLifeCycleGoal​(java.lang.String defaultLifeCycleState)
      • undeployAll

        public void undeployAll()
      • isUseStandardBindings

        public boolean isUseStandardBindings()
      • setUseStandardBindings

        public void setUseStandardBindings​(boolean useStandardBindings)
      • getNodes

        public java.util.Collection<Node> getNodes()
      • getApps

        public java.util.Collection<App> getApps​(java.lang.String nodeName)
      • scope

        public void scope​(XmlConfiguration xmlc,
                          org.eclipse.jetty.util.resource.Resource webapp)
                   throws java.io.IOException
        Throws:
        java.io.IOException