You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sa...@apache.org on 2008/06/21 13:01:40 UTC

svn commit: r670183 - in /webservices/axis2/trunk/java/modules/osgi/src/org/apache/axis2/osgi: deployment/OSGiAxis2Constants.java internal/Activator.java

Author: saminda
Date: Sat Jun 21 04:01:40 2008
New Revision: 670183

URL: http://svn.apache.org/viewvc?rev=670183&view=rev
Log:
Fixes to map service path to HttpService to properly 

Modified:
    webservices/axis2/trunk/java/modules/osgi/src/org/apache/axis2/osgi/deployment/OSGiAxis2Constants.java
    webservices/axis2/trunk/java/modules/osgi/src/org/apache/axis2/osgi/internal/Activator.java

Modified: webservices/axis2/trunk/java/modules/osgi/src/org/apache/axis2/osgi/deployment/OSGiAxis2Constants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/osgi/src/org/apache/axis2/osgi/deployment/OSGiAxis2Constants.java?rev=670183&r1=670182&r2=670183&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/osgi/src/org/apache/axis2/osgi/deployment/OSGiAxis2Constants.java (original)
+++ webservices/axis2/trunk/java/modules/osgi/src/org/apache/axis2/osgi/deployment/OSGiAxis2Constants.java Sat Jun 21 04:01:40 2008
@@ -24,5 +24,5 @@
 
     public static String PROTOCOL = "protocol";
 
-    public static String  AXIS2_OSGi_ROOT_CONTEXT = "axis2.osgi.root.context";
+    public static String  AXIS2_OSGi_ROOT_CONTEXT = "org.axis2.osgi.service.context.root";
 }

Modified: webservices/axis2/trunk/java/modules/osgi/src/org/apache/axis2/osgi/internal/Activator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/osgi/src/org/apache/axis2/osgi/internal/Activator.java?rev=670183&r1=670182&r2=670183&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/osgi/src/org/apache/axis2/osgi/internal/Activator.java (original)
+++ webservices/axis2/trunk/java/modules/osgi/src/org/apache/axis2/osgi/internal/Activator.java Sat Jun 21 04:01:40 2008
@@ -69,25 +69,27 @@
         }
 
         public Object addingService(ServiceReference serviceReference) {
-            
+
             HttpService httpService = (HttpService) context.getService(serviceReference);
             try {
                 InitServlet initServlet = new InitServlet(context);
                 httpService.registerServlet("/init_servlet_not_public", initServlet, null, null);
                 OSGiAxisServlet axisServlet = new OSGiAxisServlet(context);
-                ServiceReference axisConfigRef =
-                        context.getServiceReference(AxisConfiguration.class.getName());
-                AxisConfiguration axisConfig = (AxisConfiguration)context.getService(axisConfigRef);
-                String propContextRoot = context.getProperty(AXIS2_OSGi_ROOT_CONTEXT);
-                String contextRoot = "/axis2";
-                if (propContextRoot != null && propContextRoot.length() != 0) {
-                    if (!propContextRoot.startsWith("/")) {
-                        contextRoot = "/" + propContextRoot;
+                ServiceReference configCtxRef =
+                        context.getServiceReference(ConfigurationContext.class.getName());
+                ConfigurationContext configCtx =
+                        (ConfigurationContext) context.getService(configCtxRef);
+                String propServiceContextRoot = context.getProperty(AXIS2_OSGi_ROOT_CONTEXT);
+                String serviceContextRoot = "services";
+                if (propServiceContextRoot != null && propServiceContextRoot.length() != 0) {
+                    if (propServiceContextRoot.startsWith("/")) {
+                        serviceContextRoot = propServiceContextRoot.substring(1);
                     } else {
-                        contextRoot = propContextRoot;
+                        serviceContextRoot = propServiceContextRoot;
                     }
                 }
-                httpService.registerServlet(contextRoot, axisServlet, null, null);
+                configCtx.setServicePath(serviceContextRoot);
+                httpService.registerServlet("/" + serviceContextRoot, axisServlet, null, null);
             } catch (ServletException e) {
                 String msg = "Error while registering servlets";
                 throw new RuntimeException(msg, e);