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

    • 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​(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

        @ManagedAttribute("Application Providers")
        public Collection<AppProvider> getAppProviders()
      • addAppProvider

        public void addAppProvider​(AppProvider provider)
      • 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
        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
      • getAppByOriginId

        public App getAppByOriginId​(String originId)
      • getApps

        @ManagedAttribute("Deployed Apps")
        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
      • 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 org.eclipse.jetty.util.AttributesMap getContextAttributes()
      • getContexts

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

        public 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​(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​(org.eclipse.jetty.util.AttributesMap contextAttributes)
      • setContexts

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

        public void setDefaultLifeCycleGoal​(String defaultLifeCycleState)
      • undeployAll

        public void undeployAll()
      • isUseStandardBindings

        public boolean isUseStandardBindings()
      • setUseStandardBindings

        public void setUseStandardBindings​(boolean useStandardBindings)
      • scope

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