Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2015-04-28 19:40:13 +0000
committerThomas Watson2015-04-28 19:40:13 +0000
commitbf7deaab81dc26aaf8d184e62c370cbfc1ab6554 (patch)
tree0e3a77da4f4f803d572966059bf96d4a37a92524
parent7e4590f268a991c305c642977f69b8ff55dd0df2 (diff)
downloadrt.equinox.bundles-bf7deaab81dc26aaf8d184e62c370cbfc1ab6554.tar.gz
rt.equinox.bundles-bf7deaab81dc26aaf8d184e62c370cbfc1ab6554.tar.xz
rt.equinox.bundles-bf7deaab81dc26aaf8d184e62c370cbfc1ab6554.zip
-rw-r--r--bundles/org.eclipse.equinox.http.servlet/META-INF/MANIFEST.MF1
-rw-r--r--bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/HttpServiceRuntimeImpl.java27
2 files changed, 16 insertions, 12 deletions
diff --git a/bundles/org.eclipse.equinox.http.servlet/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.http.servlet/META-INF/MANIFEST.MF
index 3fe1f476..7f83f86e 100644
--- a/bundles/org.eclipse.equinox.http.servlet/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.http.servlet/META-INF/MANIFEST.MF
@@ -15,6 +15,7 @@ Import-Package: javax.servlet;version="[2.3.0,4.0.0)",
javax.servlet.http;version="[2.3.0,4.0.0)",
org.osgi.dto;version="[1.0.0,2.0)",
org.osgi.framework;version="[1.3.0,2.0)",
+ org.osgi.framework.dto; version="[1.8.0,2.0)",
org.osgi.framework.wiring;version="[1.1.0,2.0)",
org.osgi.service.http;version="[1.2,1.3)",
org.osgi.service.http.context;version="[1.0,1.1)",
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 d37bb351..65f60086 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
@@ -26,6 +26,7 @@ import org.eclipse.equinox.http.servlet.internal.error.*;
import org.eclipse.equinox.http.servlet.internal.servlet.*;
import org.eclipse.equinox.http.servlet.internal.util.*;
import org.osgi.framework.*;
+import org.osgi.framework.dto.ServiceReferenceDTO;
import org.osgi.service.http.HttpContext;
import org.osgi.service.http.NamespaceException;
import org.osgi.service.http.context.ServletContextHelper;
@@ -217,7 +218,7 @@ public class HttpServiceRuntimeImpl
public RuntimeDTO getRuntimeDTO() {
RuntimeDTO runtimeDTO = new RuntimeDTO();
- runtimeDTO.attributes = serializeAttributes();
+ runtimeDTO.serviceDTO = getServiceDTO();
// TODO FailedErrorDTOs
@@ -232,6 +233,19 @@ public class HttpServiceRuntimeImpl
return runtimeDTO;
}
+ private ServiceReferenceDTO getServiceDTO() {
+ ServiceReferenceDTO[] services = consumingContext.getBundle().adapt(ServiceReferenceDTO[].class);
+ for (ServiceReferenceDTO serviceDTO : services) {
+ String[] serviceTypes = (String[]) serviceDTO.properties.get(Constants.OBJECTCLASS);
+ for (String type : serviceTypes) {
+ if (HttpServiceRuntime.class.getName().equals(type)) {
+ return serviceDTO;
+ }
+ }
+ }
+ return null;
+ }
+
public void log(String message, Throwable t) {
parentServletContext.log(message, t);
}
@@ -539,17 +553,6 @@ public class HttpServiceRuntimeImpl
new ServletContextDTO[servletContextDTOs.size()]);
}
- private Map<String, String> serializeAttributes() {
- Map<String, String> temp = new HashMap<String, String>();
-
- for (Map.Entry<String, Object> entry : attributes.entrySet()) {
- temp.put(entry.getKey(), String.valueOf(entry.getValue()));
- }
-
- return temp;
- }
-
-
public void registerHttpServiceFilter(
Bundle bundle, String alias, Filter filter, Dictionary<String, String> initparams, HttpContext httpContext) throws ServletException {

Back to the top