tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r432816 - /incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java
Date Sat, 19 Aug 2006 08:59:00 GMT
Author: antelder
Date: Sat Aug 19 01:58:58 2006
New Revision: 432816

URL: http://svn.apache.org/viewvc?rev=432816&view=rev
Log:
Fix for TUSCANY-647
For now set the TCCL for the Axis2 initialization

Modified:
    incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java

Modified: incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java?rev=432816&r1=432815&r2=432816&view=diff
==============================================================================
--- incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java
(original)
+++ incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java
Sat Aug 19 01:58:58 2006
@@ -22,6 +22,7 @@
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.tuscany.binding.axis2.util.TuscanyAxisConfigurator;
 import org.apache.tuscany.spi.annotation.Autowire;
+import org.apache.tuscany.spi.builder.BuilderConfigException;
 import org.apache.tuscany.spi.component.CompositeComponent;
 import org.apache.tuscany.spi.component.SCAObject;
 import org.apache.tuscany.spi.deployer.DeploymentContext;
@@ -43,10 +44,13 @@
 
     private ConfigurationContext configContext;
 
+    public Axis2BindingBuilder() {
+        initAxis();
+    }
+
     @Autowire()
-    public void setServletHost(ServletHost servletHost) throws AxisFault {
+    public void setServletHost(ServletHost servletHost) {
         this.servletHost = servletHost;
-        this.configContext = new TuscanyAxisConfigurator().getConfigurationContext();
     }
 
     public SCAObject build(CompositeComponent parent, BoundServiceDefinition<WebServiceBinding>
serviceDefinition, DeploymentContext deploymentContext) {
@@ -71,5 +75,26 @@
 
     protected Class<WebServiceBinding> getBindingType() {
         return WebServiceBinding.class;
+    }
+    
+    protected void initAxis() {
+        // TODO: Fix classloader switching. See TUSCANY-647 
+        // TODO: also consider having a system component wrapping the Axis2 ConfigContext
+        ClassLoader tccl = Thread.currentThread().getContextClassLoader();
+        ClassLoader scl = getClass().getClassLoader();
+        try { 
+            if (tccl != scl) {
+                Thread.currentThread().setContextClassLoader(scl);
+            }
+            try {
+                this.configContext = new TuscanyAxisConfigurator().getConfigurationContext();
+            } catch (AxisFault e) {
+                throw new BuilderConfigException(e);
+            }
+        } finally {
+            if (tccl != scl) {
+                Thread.currentThread().setContextClassLoader(tccl);
+            }
+        }
     }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org


Mime
View raw message