field names
git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@1169 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
parent
63205b461c
commit
94e6168fe6
|
@ -107,14 +107,14 @@ public class DeploymentManager extends AbstractLifeCycle
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private final List<AppProvider> providers = new ArrayList<AppProvider>();
|
private final List<AppProvider> _providers = new ArrayList<AppProvider>();
|
||||||
private final AppLifeCycle lifecycle = new AppLifeCycle();
|
private final AppLifeCycle _lifecycle = new AppLifeCycle();
|
||||||
private final LinkedList<AppEntry> apps = new LinkedList<AppEntry>();
|
private final LinkedList<AppEntry> _apps = new LinkedList<AppEntry>();
|
||||||
private AttributesMap contextAttributes = new AttributesMap();
|
private AttributesMap _contextAttributes = new AttributesMap();
|
||||||
private ConfigurationManager configurationManager;
|
private ConfigurationManager _configurationManager;
|
||||||
private ContextHandlerCollection contexts;
|
private ContextHandlerCollection _contexts;
|
||||||
private boolean useStandardBindings = true;
|
private boolean _useStandardBindings = true;
|
||||||
private String defaultLifeCycleGoal = "started";
|
private String _defaultLifeCycleGoal = "started";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Receive an app for processing.
|
* Receive an app for processing.
|
||||||
|
@ -126,19 +126,19 @@ public class DeploymentManager extends AbstractLifeCycle
|
||||||
Log.info("App Added: " + app.getOriginId());
|
Log.info("App Added: " + app.getOriginId());
|
||||||
AppEntry entry = new AppEntry();
|
AppEntry entry = new AppEntry();
|
||||||
entry.app = app;
|
entry.app = app;
|
||||||
entry.setLifeCycleNode(lifecycle.getNodeByName("undeployed"));
|
entry.setLifeCycleNode(_lifecycle.getNodeByName("undeployed"));
|
||||||
apps.add(entry);
|
_apps.add(entry);
|
||||||
|
|
||||||
if (defaultLifeCycleGoal != null)
|
if (_defaultLifeCycleGoal != null)
|
||||||
{
|
{
|
||||||
// Immediately attempt to go to default lifecycle state
|
// Immediately attempt to go to default lifecycle state
|
||||||
this.requestAppGoal(entry,defaultLifeCycleGoal);
|
this.requestAppGoal(entry,_defaultLifeCycleGoal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addAppProvider(AppProvider provider)
|
public void addAppProvider(AppProvider provider)
|
||||||
{
|
{
|
||||||
providers.add(provider);
|
_providers.add(provider);
|
||||||
if (isStarted() || isStarting())
|
if (isStarted() || isStarting())
|
||||||
{
|
{
|
||||||
startAppProvider(provider);
|
startAppProvider(provider);
|
||||||
|
@ -147,7 +147,7 @@ public class DeploymentManager extends AbstractLifeCycle
|
||||||
|
|
||||||
public void addLifeCycleBinding(AppLifeCycle.Binding binding)
|
public void addLifeCycleBinding(AppLifeCycle.Binding binding)
|
||||||
{
|
{
|
||||||
lifecycle.addBinding(binding);
|
_lifecycle.addBinding(binding);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -159,16 +159,16 @@ public class DeploymentManager extends AbstractLifeCycle
|
||||||
*/
|
*/
|
||||||
public void insertLifeCycleNode(String existingFromNodeName, String existingToNodeName, String insertedNodeName)
|
public void insertLifeCycleNode(String existingFromNodeName, String existingToNodeName, String insertedNodeName)
|
||||||
{
|
{
|
||||||
Node fromNode = lifecycle.getNodeByName(existingFromNodeName);
|
Node fromNode = _lifecycle.getNodeByName(existingFromNodeName);
|
||||||
Node toNode = lifecycle.getNodeByName(existingToNodeName);
|
Node toNode = _lifecycle.getNodeByName(existingToNodeName);
|
||||||
Edge edge = new Edge(fromNode,toNode);
|
Edge edge = new Edge(fromNode,toNode);
|
||||||
lifecycle.insertNode(edge,insertedNodeName);
|
_lifecycle.insertNode(edge,insertedNodeName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doStart() throws Exception
|
protected void doStart() throws Exception
|
||||||
{
|
{
|
||||||
if (useStandardBindings)
|
if (_useStandardBindings)
|
||||||
{
|
{
|
||||||
Log.info("Using standard bindings");
|
Log.info("Using standard bindings");
|
||||||
addLifeCycleBinding(new StandardDeployer());
|
addLifeCycleBinding(new StandardDeployer());
|
||||||
|
@ -177,9 +177,9 @@ public class DeploymentManager extends AbstractLifeCycle
|
||||||
addLifeCycleBinding(new StandardUndeployer());
|
addLifeCycleBinding(new StandardUndeployer());
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.info("Starting all Providers: " + providers.size());
|
Log.info("Starting all Providers: " + _providers.size());
|
||||||
// Start all of the AppProviders
|
// Start all of the AppProviders
|
||||||
for (AppProvider provider : providers)
|
for (AppProvider provider : _providers)
|
||||||
{
|
{
|
||||||
startAppProvider(provider);
|
startAppProvider(provider);
|
||||||
}
|
}
|
||||||
|
@ -189,10 +189,10 @@ public class DeploymentManager extends AbstractLifeCycle
|
||||||
@Override
|
@Override
|
||||||
protected void doStop() throws Exception
|
protected void doStop() throws Exception
|
||||||
{
|
{
|
||||||
Log.info("Stopping all Providers: " + providers.size());
|
Log.info("Stopping all Providers: " + _providers.size());
|
||||||
|
|
||||||
// Stop all of the AppProviders
|
// Stop all of the AppProviders
|
||||||
for (AppProvider provider : providers)
|
for (AppProvider provider : _providers)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -213,7 +213,7 @@ public class DeploymentManager extends AbstractLifeCycle
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (AppEntry entry : apps)
|
for (AppEntry entry : _apps)
|
||||||
{
|
{
|
||||||
if (contextId.equals(entry.app.getContextId()))
|
if (contextId.equals(entry.app.getContextId()))
|
||||||
{
|
{
|
||||||
|
@ -230,7 +230,7 @@ public class DeploymentManager extends AbstractLifeCycle
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (AppEntry entry : apps)
|
for (AppEntry entry : _apps)
|
||||||
{
|
{
|
||||||
if (originId.equals(entry.app.getOriginId()))
|
if (originId.equals(entry.app.getOriginId()))
|
||||||
{
|
{
|
||||||
|
@ -262,18 +262,18 @@ public class DeploymentManager extends AbstractLifeCycle
|
||||||
|
|
||||||
public Collection<AppEntry> getAppEntries()
|
public Collection<AppEntry> getAppEntries()
|
||||||
{
|
{
|
||||||
return apps;
|
return _apps;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Collection<AppProvider> getAppProviders()
|
public Collection<AppProvider> getAppProviders()
|
||||||
{
|
{
|
||||||
return providers;
|
return _providers;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Collection<App> getApps()
|
public Collection<App> getApps()
|
||||||
{
|
{
|
||||||
List<App> ret = new ArrayList<App>();
|
List<App> ret = new ArrayList<App>();
|
||||||
for (AppEntry entry : apps)
|
for (AppEntry entry : _apps)
|
||||||
{
|
{
|
||||||
ret.add(entry.app);
|
ret.add(entry.app);
|
||||||
}
|
}
|
||||||
|
@ -290,7 +290,7 @@ public class DeploymentManager extends AbstractLifeCycle
|
||||||
public Collection<App> getApps(Node node)
|
public Collection<App> getApps(Node node)
|
||||||
{
|
{
|
||||||
List<App> ret = new ArrayList<App>();
|
List<App> ret = new ArrayList<App>();
|
||||||
for (AppEntry entry : apps)
|
for (AppEntry entry : _apps)
|
||||||
{
|
{
|
||||||
if (entry.lifecyleNode == node)
|
if (entry.lifecyleNode == node)
|
||||||
{
|
{
|
||||||
|
@ -315,7 +315,7 @@ public class DeploymentManager extends AbstractLifeCycle
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (AppEntry entry : apps)
|
for (AppEntry entry : _apps)
|
||||||
{
|
{
|
||||||
if (entry.app.equals(app))
|
if (entry.app.equals(app))
|
||||||
{
|
{
|
||||||
|
@ -340,41 +340,41 @@ public class DeploymentManager extends AbstractLifeCycle
|
||||||
*/
|
*/
|
||||||
public Object getContextAttribute(String name)
|
public Object getContextAttribute(String name)
|
||||||
{
|
{
|
||||||
return contextAttributes.getAttribute(name);
|
return _contextAttributes.getAttribute(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConfigurationManager getConfigurationManager()
|
public ConfigurationManager getConfigurationManager()
|
||||||
{
|
{
|
||||||
return configurationManager;
|
return _configurationManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AttributesMap getContextAttributes()
|
public AttributesMap getContextAttributes()
|
||||||
{
|
{
|
||||||
return contextAttributes;
|
return _contextAttributes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ContextHandlerCollection getContexts()
|
public ContextHandlerCollection getContexts()
|
||||||
{
|
{
|
||||||
return contexts;
|
return _contexts;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDefaultLifeCycleGoal()
|
public String getDefaultLifeCycleGoal()
|
||||||
{
|
{
|
||||||
return defaultLifeCycleGoal;
|
return _defaultLifeCycleGoal;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AppLifeCycle getLifeCycle()
|
public AppLifeCycle getLifeCycle()
|
||||||
{
|
{
|
||||||
return lifecycle;
|
return _lifecycle;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Server getServer()
|
public Server getServer()
|
||||||
{
|
{
|
||||||
if (contexts == null)
|
if (_contexts == null)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return contexts.getServer();
|
return _contexts.getServer();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -385,7 +385,7 @@ public class DeploymentManager extends AbstractLifeCycle
|
||||||
*/
|
*/
|
||||||
public void removeApp(App app)
|
public void removeApp(App app)
|
||||||
{
|
{
|
||||||
ListIterator<AppEntry> it = apps.listIterator();
|
ListIterator<AppEntry> it = _apps.listIterator();
|
||||||
while (it.hasNext())
|
while (it.hasNext())
|
||||||
{
|
{
|
||||||
AppEntry entry = it.next();
|
AppEntry entry = it.next();
|
||||||
|
@ -399,7 +399,7 @@ public class DeploymentManager extends AbstractLifeCycle
|
||||||
|
|
||||||
public void removeAppProvider(AppProvider provider)
|
public void removeAppProvider(AppProvider provider)
|
||||||
{
|
{
|
||||||
providers.remove(provider);
|
_providers.remove(provider);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
provider.stop();
|
provider.stop();
|
||||||
|
@ -417,7 +417,7 @@ public class DeploymentManager extends AbstractLifeCycle
|
||||||
*/
|
*/
|
||||||
public void removeContextAttribute(String name)
|
public void removeContextAttribute(String name)
|
||||||
{
|
{
|
||||||
contextAttributes.removeAttribute(name);
|
_contextAttributes.removeAttribute(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -454,9 +454,9 @@ public class DeploymentManager extends AbstractLifeCycle
|
||||||
*/
|
*/
|
||||||
private void requestAppGoal(AppEntry appentry, String nodeName)
|
private void requestAppGoal(AppEntry appentry, String nodeName)
|
||||||
{
|
{
|
||||||
Node destinationNode = lifecycle.getNodeByName(nodeName);
|
Node destinationNode = _lifecycle.getNodeByName(nodeName);
|
||||||
// Compute lifecycle steps
|
// Compute lifecycle steps
|
||||||
Path path = lifecycle.getPath(appentry.lifecyleNode,destinationNode);
|
Path path = _lifecycle.getPath(appentry.lifecyleNode,destinationNode);
|
||||||
if (path.isEmpty())
|
if (path.isEmpty())
|
||||||
{
|
{
|
||||||
// nothing to do. already there.
|
// nothing to do. already there.
|
||||||
|
@ -476,7 +476,7 @@ public class DeploymentManager extends AbstractLifeCycle
|
||||||
{
|
{
|
||||||
Node node = it.next();
|
Node node = it.next();
|
||||||
Log.info("Executing Node: " + node);
|
Log.info("Executing Node: " + node);
|
||||||
lifecycle.runBindings(node,appentry.app,this);
|
_lifecycle.runBindings(node,appentry.app,this);
|
||||||
appentry.setLifeCycleNode(node);
|
appentry.setLifeCycleNode(node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -518,27 +518,27 @@ public class DeploymentManager extends AbstractLifeCycle
|
||||||
*/
|
*/
|
||||||
public void setContextAttribute(String name, Object value)
|
public void setContextAttribute(String name, Object value)
|
||||||
{
|
{
|
||||||
contextAttributes.setAttribute(name,value);
|
_contextAttributes.setAttribute(name,value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setConfigurationManager(ConfigurationManager configurationManager)
|
public void setConfigurationManager(ConfigurationManager configurationManager)
|
||||||
{
|
{
|
||||||
this.configurationManager = configurationManager;
|
this._configurationManager = configurationManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setContextAttributes(AttributesMap contextAttributes)
|
public void setContextAttributes(AttributesMap contextAttributes)
|
||||||
{
|
{
|
||||||
this.contextAttributes = contextAttributes;
|
this._contextAttributes = contextAttributes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setContexts(ContextHandlerCollection contexts)
|
public void setContexts(ContextHandlerCollection contexts)
|
||||||
{
|
{
|
||||||
this.contexts = contexts;
|
this._contexts = contexts;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDefaultLifeCycleGoal(String defaultLifeCycleState)
|
public void setDefaultLifeCycleGoal(String defaultLifeCycleState)
|
||||||
{
|
{
|
||||||
this.defaultLifeCycleGoal = defaultLifeCycleState;
|
this._defaultLifeCycleGoal = defaultLifeCycleState;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void startAppProvider(AppProvider provider)
|
private void startAppProvider(AppProvider provider)
|
||||||
|
@ -557,7 +557,7 @@ public class DeploymentManager extends AbstractLifeCycle
|
||||||
public void undeployAll()
|
public void undeployAll()
|
||||||
{
|
{
|
||||||
Log.info("Undeploy (All) started");
|
Log.info("Undeploy (All) started");
|
||||||
for (AppEntry appentry : apps)
|
for (AppEntry appentry : _apps)
|
||||||
{
|
{
|
||||||
Log.info("Undeploy: " + appentry);
|
Log.info("Undeploy: " + appentry);
|
||||||
requestAppGoal(appentry,"undeployed");
|
requestAppGoal(appentry,"undeployed");
|
||||||
|
@ -567,11 +567,11 @@ public class DeploymentManager extends AbstractLifeCycle
|
||||||
|
|
||||||
public boolean isUseStandardBindings()
|
public boolean isUseStandardBindings()
|
||||||
{
|
{
|
||||||
return useStandardBindings;
|
return _useStandardBindings;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUseStandardBindings(boolean useStandardBindings)
|
public void setUseStandardBindings(boolean useStandardBindings)
|
||||||
{
|
{
|
||||||
this.useStandardBindings = useStandardBindings;
|
this._useStandardBindings = useStandardBindings;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue