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
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
Modifier and TypeClassDescriptionclass
Represents a single tracked app within the deployment manager.Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener, AbstractLifeCycle.StopException
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
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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.getAppByOriginId
(String originId) getApps()
getContextAttribute
(String name) Get a contextAttribute that will be set for every Context deployed by this provider.getNodes()
void
insertLifeCycleNode
(String existingFromNodeName, String existingToNodeName, String insertedNodeName) Convenience method to allow for insertion of nodes into the lifecycle.boolean
void
Remove the app from the tracking of the DeploymentManagervoid
removeAppProvider
(AppProvider provider) void
removeContextAttribute
(String name) Remove a contextAttribute that will be set for every Context deployed by this provider.void
requestAppGoal
(String appId, 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, 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
(Collection<AppProvider> providers) Set the AppProviders.void
setContextAttribute
(String name, 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
(String defaultLifeCycleState) void
setLifeCycleBindings
(Collection<AppLifeCycle.Binding> bindings) void
setUseStandardBindings
(boolean useStandardBindings) void
Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeans
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, 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.Container
getCachedBeans, getEventListeners
Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
-
Constructor Details
-
DeploymentManager
public DeploymentManager()
-
-
Method Details
-
addApp
Receive an app for processing. Most commonly used by the variousAppProvider
implementations.- Parameters:
app
- the app
-
setAppProviders
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
-
addAppProvider
-
setLifeCycleBindings
-
getLifeCycleBindings
-
addLifeCycleBinding
-
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 startexistingToNodeName
- the existing node endinsertedNodeName
- the new node to create between the existing nodes
-
doStart
Description copied from class:ContainerLifeCycle
Starts the managed lifecycle beans in the order they were added.- Overrides:
doStart
in classContainerLifeCycle
- 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
Description copied from class:ContainerLifeCycle
Stops the managed lifecycle beans in the reverse order they were added.- Overrides:
doStop
in classContainerLifeCycle
- Throws:
Exception
- If there was a problem stopping. Will cause a transition to FAILED state
-
getAppByOriginId
-
getAppEntries
-
getApps
-
getApps
- Parameters:
node
- the node to look for.- Returns:
- the collection of apps for the node
-
getApps
-
getAppsWithSameContext
-
getContextAttribute
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
-
getContexts
-
getDefaultLifeCycleGoal
-
getLifeCycle
-
getServer
-
removeApp
Remove the app from the tracking of the DeploymentManager- Parameters:
app
- if the app is Unavailable remove it from the deployment manager.
-
removeAppProvider
-
removeContextAttribute
Remove a contextAttribute that will be set for every Context deployed by this provider.- Parameters:
name
- the context attribute name
-
requestAppGoal
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") String appId, @Name("nodeName") 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
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
-
setContexts
-
setDefaultLifeCycleGoal
-
undeployAll
public void undeployAll() -
isUseStandardBindings
public boolean isUseStandardBindings() -
setUseStandardBindings
public void setUseStandardBindings(boolean useStandardBindings) -
getNodes
-
scope
- Throws:
IOException
-