Package org.eclipse.jetty.deploy
Class DeploymentManager
- java.lang.Object
-
- org.eclipse.jetty.util.component.AbstractLifeCycle
-
- org.eclipse.jetty.util.component.ContainerLifeCycle
-
- org.eclipse.jetty.deploy.DeploymentManager
-
- All Implemented Interfaces:
Container
,Destroyable
,Dumpable
,Dumpable.DumpableContainer
,LifeCycle
@ManagedObject("Deployment Manager") public class DeploymentManager extends ContainerLifeCycle
The Deployment Manager.Responsibilities:
- Tracking Apps and their LifeCycle Location
- Managing AppProviders and the Apps that they provide.
- Executing AppLifeCycle on App based on current and desired LifeCycle Location.
-
-
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
AbstractLifeCycle.AbstractLifeCycleListener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.Listener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
-
Constructor Summary
Constructors Constructor Description DeploymentManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addApp(App app)
Receive an app for processing.void
addAppProvider(AppProvider provider)
void
addLifeCycleBinding(AppLifeCycle.Binding binding)
protected void
doStart()
Starts the managed lifecycle beans in the order they were added.protected void
doStop()
Stops the managed lifecycle beans in the reverse order they were added.App
getAppByOriginId(java.lang.String originId)
java.util.Collection<DeploymentManager.AppEntry>
getAppEntries()
java.util.Collection<AppProvider>
getAppProviders()
java.util.Collection<App>
getApps()
java.util.Collection<App>
getApps(java.lang.String nodeName)
java.util.Collection<App>
getApps(Node node)
java.util.List<App>
getAppsWithSameContext(App app)
java.lang.Object
getContextAttribute(java.lang.String name)
Get a contextAttribute that will be set for every Context deployed by this provider.AttributesMap
getContextAttributes()
ContextHandlerCollection
getContexts()
java.lang.String
getDefaultLifeCycleGoal()
AppLifeCycle
getLifeCycle()
java.util.Collection<AppLifeCycle.Binding>
getLifeCycleBindings()
java.util.Collection<Node>
getNodes()
Server
getServer()
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.boolean
isUseStandardBindings()
void
removeApp(App app)
Remove the app from the tracking of the DeploymentManagervoid
removeAppProvider(AppProvider provider)
void
removeContextAttribute(java.lang.String name)
Remove a contextAttribute that will be set for every Context deployed by this provider.void
requestAppGoal(java.lang.String appId, java.lang.String nodeName)
Move anApp
through theAppLifeCycle
to the desiredNode
, executing each lifecycle step in the process to reach the desired state.void
requestAppGoal(App app, java.lang.String nodeName)
Move anApp
through theAppLifeCycle
to the desiredNode
, executing each lifecycle step in the process to reach the desired state.void
scope(XmlConfiguration xmlc, Resource webapp)
void
setAppProviders(java.util.Collection<AppProvider> providers)
Set the AppProviders.void
setContextAttribute(java.lang.String name, java.lang.Object value)
Set a contextAttribute that will be set for every Context deployed by this provider.void
setContextAttributes(AttributesMap contextAttributes)
void
setContexts(ContextHandlerCollection contexts)
void
setDefaultLifeCycleGoal(java.lang.String defaultLifeCycleState)
void
setLifeCycleBindings(java.util.Collection<AppLifeCycle.Binding> bindings)
void
setUseStandardBindings(boolean useStandardBindings)
void
undeployAll()
-
Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpObjects, dumpStdErr, dumpThis, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeans
-
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
-
-
-
-
Method Detail
-
addApp
public void addApp(App app)
Receive an app for processing. Most commonly used by the variousAppProvider
implementations.- Parameters:
app
- the app
-
setAppProviders
public void setAppProviders(java.util.Collection<AppProvider> providers)
Set the AppProviders. The providers passed are added viaContainerLifeCycle.addBean(Object)
so that their lifecycles may be managed as aContainerLifeCycle
.- 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)
-
getLifeCycleBindings
public java.util.Collection<AppLifeCycle.Binding> getLifeCycleBindings()
-
addLifeCycleBinding
public void addLifeCycleBinding(AppLifeCycle.Binding binding)
-
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 startexistingToNodeName
- the existing node endinsertedNodeName
- the new node to create between the existing nodes
-
doStart
protected void doStart() throws java.lang.Exception
Description copied from class:ContainerLifeCycle
Starts the managed lifecycle beans in the order they were added.- Overrides:
doStart
in classContainerLifeCycle
- Throws:
java.lang.Exception
-
doStop
protected void doStop() throws java.lang.Exception
Description copied from class:ContainerLifeCycle
Stops the managed lifecycle beans in the reverse order they were added.- Overrides:
doStop
in classContainerLifeCycle
- Throws:
java.lang.Exception
-
getAppByOriginId
public App getAppByOriginId(java.lang.String originId)
-
getAppEntries
public java.util.Collection<DeploymentManager.AppEntry> getAppEntries()
-
getApps
public java.util.Collection<App> getApps()
-
getApps
public java.util.Collection<App> getApps(Node node)
- Parameters:
node
- the node to look for.- Returns:
- the collection of apps for the node
-
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 AttributesMap getContextAttributes()
-
getContexts
@ManagedAttribute("Deployed Contexts") public ContextHandlerCollection getContexts()
-
getDefaultLifeCycleGoal
public java.lang.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(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 anApp
through theAppLifeCycle
to the desiredNode
, executing each lifecycle step in the process to reach the desired state.- Parameters:
app
- the app to move through the processnodeName
- 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 anApp
through theAppLifeCycle
to the desiredNode
, executing each lifecycle step in the process to reach the desired state.- Parameters:
appId
- the id of the app to move through the processnodeName
- 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 namevalue
- the context attribute value
-
setContextAttributes
public void setContextAttributes(AttributesMap contextAttributes)
-
setContexts
public void setContexts(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, Resource webapp) throws java.io.IOException
- Throws:
java.io.IOException
-
-