aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Dumont2013-04-02 11:27:46 (EDT)
committerThomas Watson2013-04-02 11:29:00 (EDT)
commit2048b3dcb40d153ee9e67358a5a3bbd37a2f71f7 (patch)
tree815f353881952f2ab7922e1c294c297ba620c0b4
parent10b493b9c3385e09d3d7f4d35f1f357604dfb058 (diff)
downloadrt.equinox.bundles-2048b3dcb40d153ee9e67358a5a3bbd37a2f71f7.zip
rt.equinox.bundles-2048b3dcb40d153ee9e67358a5a3bbd37a2f71f7.tar.gz
rt.equinox.bundles-2048b3dcb40d153ee9e67358a5a3bbd37a2f71f7.tar.bz2
Bug 402454 - Please add support for pax-web HttpService registerFilter
method for equinox running in Apache Karaf
-rw-r--r--bundles/org.eclipse.equinox.http.registry/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.equinox.http.registry/src/org/eclipse/equinox/http/registry/internal/HttpRegistryManager.java20
2 files changed, 17 insertions, 5 deletions
diff --git a/bundles/org.eclipse.equinox.http.registry/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.http.registry/META-INF/MANIFEST.MF
index 42408ad..ea5ceb9 100644
--- a/bundles/org.eclipse.equinox.http.registry/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.http.registry/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %bundleName
Bundle-SymbolicName: org.eclipse.equinox.http.registry;singleton:=true
-Bundle-Version: 1.1.200.qualifier
+Bundle-Version: 1.1.300.qualifier
Bundle-Activator: org.eclipse.equinox.http.registry.internal.Activator
Bundle-Localization: plugin
Require-Bundle: org.eclipse.equinox.common,
diff --git a/bundles/org.eclipse.equinox.http.registry/src/org/eclipse/equinox/http/registry/internal/HttpRegistryManager.java b/bundles/org.eclipse.equinox.http.registry/src/org/eclipse/equinox/http/registry/internal/HttpRegistryManager.java
index 0266209..0349ffc 100644
--- a/bundles/org.eclipse.equinox.http.registry/src/org/eclipse/equinox/http/registry/internal/HttpRegistryManager.java
+++ b/bundles/org.eclipse.equinox.http.registry/src/org/eclipse/equinox/http/registry/internal/HttpRegistryManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * Copyright (c) 2007, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -292,13 +292,25 @@ public class HttpRegistryManager {
HttpContext context = getHttpContext(contribution.httpContextId, contribution.contributor);
if (context == null)
return false;
+
+ Method registerFilterMethod = null;
try {
- Method registerFilterMethod = httpService.getClass().getMethod("registerFilter", new Class[] {String.class, Filter.class, Dictionary.class, HttpContext.class}); //$NON-NLS-1$
+ // First, try the Equinox http service method
+ registerFilterMethod = httpService.getClass().getMethod("registerFilter", new Class[] {String.class, Filter.class, Dictionary.class, HttpContext.class}); //$NON-NLS-1$
registerFilterMethod.invoke(httpService, new Object[] {contribution.alias, contribution.filter, contribution.initparams, context});
return true;
- } catch (NoSuchMethodException t) {
+ } catch (NoSuchMethodException e) {
+ // Give the pax-web HttpService impl a try
+ try {
+ registerFilterMethod = httpService.getClass().getMethod("registerFilter", new Class[] {Filter.class, String[].class, String[].class, Dictionary.class, HttpContext.class}); //$NON-NLS-1$
+ registerFilterMethod.invoke(httpService, new Object[] {contribution.filter, new String[] {contribution.alias}, null, contribution.initparams, context});
+ return true;
+ } catch (Throwable t) {
+ // TODO: should log this
+ // for now ignore
+ }
// TODO: should log this
- // for now ignore
+ e.printStackTrace();
} catch (Throwable t) {
// TODO: should log this
t.printStackTrace();