diff --git a/VERSION.txt b/VERSION.txt index d839c531727..4f2645e07f1 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -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 diff --git a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/App.java b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/App.java index 4dc1f5a3700..52d114b2ac2 100644 --- a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/App.java +++ b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/App.java @@ -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} * diff --git a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/DeploymentManager.java b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/DeploymentManager.java index 23ca14c4c6a..9c136a6a29e 100644 --- a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/DeploymentManager.java +++ b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/DeploymentManager.java @@ -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); } diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiAppProvider.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiAppProvider.java index eb93a8f3f7a..acaa1ab7f92 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiAppProvider.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiAppProvider.java @@ -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(); }