Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2014-12-18 14:16:29 +0000
committerThomas Watson2014-12-18 14:16:29 +0000
commite3d5c440ab3f74de417b77b0e2568abc205c08b5 (patch)
tree31f5de5074a2df2930a50ea05097af251010d3ce
parent93ab0a5b9ee089b547db1f887d6f924fe0107046 (diff)
downloadrt.equinox.bundles-e3d5c440ab3f74de417b77b0e2568abc205c08b5.tar.gz
rt.equinox.bundles-e3d5c440ab3f74de417b77b0e2568abc205c08b5.tar.xz
rt.equinox.bundles-e3d5c440ab3f74de417b77b0e2568abc205c08b5.zip
Bug 455528 - [http] improve context name generated for HttpContext ServletContextHelpersI20141230-0800I20141223-0800
-rw-r--r--bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/HttpServiceRuntimeImpl.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/HttpServiceRuntimeImpl.java b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/HttpServiceRuntimeImpl.java
index 5ecbaef86..3e2585206 100644
--- a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/HttpServiceRuntimeImpl.java
+++ b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/HttpServiceRuntimeImpl.java
@@ -213,7 +213,7 @@ public class HttpServiceRuntimeImpl
trackingContext = null;
consumingContext = null;
contextPathMap = null;
- legacyServiceIdGenerator = null;
+ legacyIdGenerator = null;
parentServletContext = null;
registeredObjects = null;
contextServiceTracker = null;
@@ -385,8 +385,8 @@ public class HttpServiceRuntimeImpl
return null;
}
- AtomicLong getLegacyServiceIdGenerator() {
- return legacyServiceIdGenerator;
+ long generateLegacyId() {
+ return legacyIdGenerator.getAndIncrement();
}
private ContextController createContextController(
@@ -892,7 +892,7 @@ public class HttpServiceRuntimeImpl
if (factory == null) {
factory = new HttpContextHelperFactory(httpContext);
Dictionary<String, Object> props = new Hashtable<String, Object>();
- props.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_NAME, httpContext.toString());
+ props.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_NAME, httpContext.getClass().getName() + "-" + generateLegacyId()); //$NON-NLS-1$
props.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_PATH, "/"); //$NON-NLS-1$
props.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_TARGET, targetFilter);
props.put(Const.EQUINOX_LEGACY_CONTEXT_HELPER, Boolean.TRUE);
@@ -1036,7 +1036,7 @@ public class HttpServiceRuntimeImpl
private ConcurrentMap<ContextController, ServiceReference<ServletContextHelper>> controllerMap =
new ConcurrentHashMap<ContextController, ServiceReference<ServletContextHelper>>();
- private AtomicLong legacyServiceIdGenerator = new AtomicLong(0);
+ private AtomicLong legacyIdGenerator = new AtomicLong(0);
private Set<Object> registeredObjects = Collections.newSetFromMap(new ConcurrentHashMap<Object, Boolean>());
private Set<String> registeredContextNames = new ConcurrentSkipListSet<String>();

Back to the top