JETTY-1295 Contexts mixed up when hot-deploying on virtual hosts
git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@2427 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
parent
cf7f8b27f8
commit
9d901da82e
|
@ -1,4 +1,5 @@
|
|||
|
||||
+ JETTY-1295 Contexts mixed up when hot-deploying on virtual hosts
|
||||
+ 328199 Ensure blocking connectors always close socket
|
||||
+ 328205 Improved SelectManager stopping
|
||||
+ 328306 Serialization of FormAuthentication
|
||||
|
@ -9,6 +10,7 @@
|
|||
+ 328782 allow per connection max idle time to be set
|
||||
+ 328885 web overrides do not override
|
||||
|
||||
|
||||
jetty-7.2.0.v20101020 20 October 2010
|
||||
+ 289540 added javadoc into distribution
|
||||
+ 297154 add source distribution artifact
|
||||
|
|
|
@ -36,7 +36,7 @@ public class App
|
|||
* the origin ID (The ID that the {@link AppProvider} knows
|
||||
* about)
|
||||
* @see App#getOriginId()
|
||||
* @see App#getContextId()
|
||||
* @see App#getContextPath()
|
||||
*/
|
||||
public App(DeploymentManager manager, AppProvider provider, String originId)
|
||||
{
|
||||
|
@ -52,7 +52,7 @@ public class App
|
|||
* the origin ID (The ID that the {@link AppProvider} knows
|
||||
* about)
|
||||
* @see App#getOriginId()
|
||||
* @see App#getContextId()
|
||||
* @see App#getContextPath()
|
||||
* @param context
|
||||
* Some implementations of AppProvider might have to use an
|
||||
* already created ContextHandler.
|
||||
|
@ -109,13 +109,31 @@ public class App
|
|||
return _context;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The unique id of the {@link App} relating to how it is installed on the
|
||||
* The context path {@link App} relating to how it is installed on the
|
||||
* jetty server side.
|
||||
*
|
||||
* @return the generated Id for the App.
|
||||
* NOTE that although the method name indicates that this is a unique
|
||||
* identifier, it is not, as many contexts may have the same contextPath,
|
||||
* yet different virtual hosts.
|
||||
*
|
||||
* @deprecated Use getContextPath instead.
|
||||
* @return the context path for the App
|
||||
*/
|
||||
public String getContextId()
|
||||
{
|
||||
return getContextPath();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The context path {@link App} relating to how it is installed on the
|
||||
* jetty server side.
|
||||
*
|
||||
* @return the contextPath for the App
|
||||
*/
|
||||
public String getContextPath()
|
||||
{
|
||||
if (this._context == null)
|
||||
{
|
||||
|
@ -124,6 +142,7 @@ public class App
|
|||
return this._context.getContextPath();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The origin of this {@link App} as specified by the {@link AppProvider}
|
||||
*
|
||||
|
|
|
@ -232,6 +232,7 @@ public class DeploymentManager extends AbstractLifeCycle
|
|||
super.doStop();
|
||||
}
|
||||
|
||||
/*
|
||||
private AppEntry findAppByContextId(String contextId)
|
||||
{
|
||||
if (contextId == null)
|
||||
|
@ -248,6 +249,7 @@ public class DeploymentManager extends AbstractLifeCycle
|
|||
}
|
||||
return null;
|
||||
}
|
||||
*/
|
||||
|
||||
private AppEntry findAppByOriginId(String originId)
|
||||
{
|
||||
|
@ -266,6 +268,7 @@ public class DeploymentManager extends AbstractLifeCycle
|
|||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
public App getAppByContextId(String contextId)
|
||||
{
|
||||
AppEntry entry = findAppByContextId(contextId);
|
||||
|
@ -275,7 +278,8 @@ public class DeploymentManager extends AbstractLifeCycle
|
|||
}
|
||||
return entry.app;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
public App getAppByOriginId(String originId)
|
||||
{
|
||||
AppEntry entry = findAppByOriginId(originId);
|
||||
|
@ -329,7 +333,7 @@ public class DeploymentManager extends AbstractLifeCycle
|
|||
return ret;
|
||||
}
|
||||
|
||||
String contextId = app.getContextId();
|
||||
String contextId = app.getContextPath();
|
||||
if (contextId == null)
|
||||
{
|
||||
// No context? Likely not deployed or started yet.
|
||||
|
@ -345,7 +349,7 @@ public class DeploymentManager extends AbstractLifeCycle
|
|||
continue;
|
||||
}
|
||||
|
||||
if (contextId.equals(entry.app.getContextId()))
|
||||
if (contextId.equals(entry.app.getContextPath()))
|
||||
{
|
||||
ret.add(entry.app);
|
||||
}
|
||||
|
@ -449,15 +453,12 @@ public class DeploymentManager extends AbstractLifeCycle
|
|||
*/
|
||||
public void requestAppGoal(App app, String nodeName)
|
||||
{
|
||||
AppEntry appentry = findAppByContextId(app.getContextId());
|
||||
if (appentry == null)
|
||||
{
|
||||
appentry = findAppByOriginId(app.getOriginId());
|
||||
AppEntry appentry = findAppByOriginId(app.getOriginId());
|
||||
if (appentry == null)
|
||||
{
|
||||
throw new IllegalStateException("App not being tracked by Deployment Manager: " + app);
|
||||
}
|
||||
}
|
||||
|
||||
requestAppGoal(appentry,nodeName);
|
||||
}
|
||||
|
||||
|
@ -516,14 +517,10 @@ public class DeploymentManager extends AbstractLifeCycle
|
|||
*/
|
||||
public void requestAppGoal(String appId, String nodeName)
|
||||
{
|
||||
AppEntry appentry = findAppByContextId(appId);
|
||||
AppEntry appentry = findAppByOriginId(appId);
|
||||
if (appentry == null)
|
||||
{
|
||||
appentry = findAppByOriginId(appId);
|
||||
if (appentry == null)
|
||||
{
|
||||
throw new IllegalStateException("App not being tracked by Deployment Manager: " + appId);
|
||||
}
|
||||
throw new IllegalStateException("App not being tracked by Deployment Manager: " + appId);
|
||||
}
|
||||
requestAppGoal(appentry,nodeName);
|
||||
}
|
||||
|
|
|
@ -120,7 +120,7 @@ public class OSGiAppProvider extends ScanningAppProvider implements AppProvider
|
|||
public ContextHandler createContextHandler(App app) throws Exception
|
||||
{
|
||||
// return pre-created Context
|
||||
if (app.getContextId() != null)
|
||||
if (app.getContextHandler() != null)
|
||||
{
|
||||
return app.getContextHandler();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue