axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r662454 - in /webservices/axis2/trunk/java/modules/osgi/src/org/apache/axis2/extensions/osgi: OSGiAxis2Servlet.java ServiceRegistry.java
Date Mon, 02 Jun 2008 15:04:03 GMT
Author: dims
Date: Mon Jun  2 08:04:03 2008
New Revision: 662454

URL: http://svn.apache.org/viewvc?rev=662454&view=rev
Log:
init the jaxwsdeployer with the configuration context. add checks to make sure the context
is already created

Modified:
    webservices/axis2/trunk/java/modules/osgi/src/org/apache/axis2/extensions/osgi/OSGiAxis2Servlet.java
    webservices/axis2/trunk/java/modules/osgi/src/org/apache/axis2/extensions/osgi/ServiceRegistry.java

Modified: webservices/axis2/trunk/java/modules/osgi/src/org/apache/axis2/extensions/osgi/OSGiAxis2Servlet.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/osgi/src/org/apache/axis2/extensions/osgi/OSGiAxis2Servlet.java?rev=662454&r1=662453&r2=662454&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/osgi/src/org/apache/axis2/extensions/osgi/OSGiAxis2Servlet.java
(original)
+++ webservices/axis2/trunk/java/modules/osgi/src/org/apache/axis2/extensions/osgi/OSGiAxis2Servlet.java
Mon Jun  2 08:04:03 2008
@@ -21,23 +21,18 @@
 
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.transport.http.AxisServlet;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.deployment.WarBasedAxisConfigurator;
+import org.apache.axis2.deployment.DeploymentException;
+import org.apache.axis2.Constants;
 
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 
 public class OSGiAxis2Servlet extends AxisServlet {
-    public void init(ServletConfig config) throws ServletException {
-        // Fix for a class loader issue in Felix
-        ClassLoader cl = Thread.currentThread().getContextClassLoader();
-        Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
-        try {
-            super.init(config);
-        } finally {
-            Thread.currentThread().setContextClassLoader(cl);
-        }
-    }
-
+    
     /**
      * Set the context root if it is not set already. We are overriding AxisServlet's impl
to
      * get past an issue in Felix.
@@ -59,7 +54,7 @@
         configContext.setContextRoot(contextRoot);
     }
 
-    public AxisConfiguration getConfiguration() {
-        return this.axisConfiguration;
+    public ConfigurationContext ConfigurationContext() {
+        return configContext;
     }
 }

Modified: webservices/axis2/trunk/java/modules/osgi/src/org/apache/axis2/extensions/osgi/ServiceRegistry.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/osgi/src/org/apache/axis2/extensions/osgi/ServiceRegistry.java?rev=662454&r1=662453&r2=662454&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/osgi/src/org/apache/axis2/extensions/osgi/ServiceRegistry.java
(original)
+++ webservices/axis2/trunk/java/modules/osgi/src/org/apache/axis2/extensions/osgi/ServiceRegistry.java
Mon Jun  2 08:04:03 2008
@@ -20,6 +20,7 @@
 package org.apache.axis2.extensions.osgi;
 
 import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.deployment.ModuleBuilder;
 import org.apache.axis2.deployment.ModuleDeployer;
 import org.apache.axis2.deployment.util.Utils;
@@ -42,6 +43,7 @@
     private OSGiAxis2Servlet servlet;
     private LogService log;
     private HashMap services = new HashMap();
+    private boolean isInited = false;
 
     public ServiceRegistry(OSGiAxis2Servlet servlet, LogService log) {
         this.servlet = servlet;
@@ -49,7 +51,15 @@
     }
 
     public void register(Bundle bundle) {
-        axisConfig = servlet.getConfiguration();
+        if(!isInited){
+            ConfigurationContext context = servlet.ConfigurationContext();
+            if(context == null){
+                System.out.println("[Axis2/OSGi] Configuration Context is null. unable to
register bundle");
+                return;
+            }
+            init(context);
+            isInited = true;
+        }
         ClassLoader loader = new BundleClassLoader(bundle, this.getClass().getClassLoader());
 
         addModules(bundle, loader);



Mime
View raw message