cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r500212 - in /incubator/cxf/trunk: rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/ rt/core/src/main/java/org/apache/cxf/transport/ rt/transports/http/src/main/java/org/apache/cxf/transport/http/ rt/transports/http/src/main/resou...
Date Fri, 26 Jan 2007 10:33:39 GMT
Author: ema
Date: Fri Jan 26 02:33:38 2007
New Revision: 500212

URL: http://svn.apache.org/viewvc?view=rev&rev=500212
Log:
Fixed issue CXF-392. Get CXFBus work

Modified:
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapTransportFactory.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/ConduitInitiatorManagerImpl.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/DestinationFactoryManagerImpl.java
    incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPTransportFactory.java
    incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/bus-extensions.xml
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/basicDOCBare/DOCBareClientServerTest.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/basicDOCBare/Server.java

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapTransportFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapTransportFactory.java?view=diff&rev=500212&r1=500211&r2=500212
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapTransportFactory.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapTransportFactory.java
Fri Jan 26 02:33:38 2007
@@ -20,9 +20,11 @@
 package org.apache.cxf.binding.soap;
 
 import java.io.IOException;
+import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
 
+import javax.annotation.PostConstruct;
 import javax.annotation.Resource;
 import javax.wsdl.Port;
 import javax.wsdl.extensions.soap.SOAPAddress;
@@ -57,7 +59,7 @@
     WSDLEndpointFactory, ConduitInitiator {
     public static final String TRANSPORT_ID = "http://schemas.xmlsoap.org/soap/";
     private Bus bus;
-
+    private Collection<String> activationNamespaces;
     public SoapTransportFactory() {
         super();
     }
@@ -102,13 +104,13 @@
             op.setStyle(soi.getStyle());
 
             b.addExtensor(op);
-            
+
             if (b.getInput() != null) {
                 SOAPBodyImpl body = new SOAPBodyImpl();
                 body.setUse("literal");
                 b.getInput().addExtensor(body);
             }
-            
+
             if (b.getOutput() != null) {
                 SOAPBodyImpl body = new SOAPBodyImpl();
                 body.setUse("literal");
@@ -134,7 +136,7 @@
 
         return null;
     }
-    
+
 
     public Conduit getConduit(EndpointInfo ei, EndpointReferenceType target) throws IOException
{
         return getConduit(ei);
@@ -162,5 +164,25 @@
     public void setBus(Bus bus) {
         this.bus = bus;
     }
+
+    @Resource
+    public void setActivationNamespaces(Collection<String> ans) {
+        activationNamespaces = ans;
+    }
+
+    @PostConstruct
+    void registerWithBindingManager() {
+        if (null == bus) {
+            return;
+        }
+
+        DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
+        if (null != dfm) {
+            for (String ns : activationNamespaces) {
+                dfm.registerDestinationFactory(ns, this);
+            }
+        }
+    }
+
 
 }

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/ConduitInitiatorManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/ConduitInitiatorManagerImpl.java?view=diff&rev=500212&r1=500211&r2=500212
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/ConduitInitiatorManagerImpl.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/ConduitInitiatorManagerImpl.java
Fri Jan 26 02:33:38 2007
@@ -31,6 +31,7 @@
 import org.apache.cxf.BusException;
 import org.apache.cxf.common.i18n.BundleUtils;
 import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.extension.ExtensionManager;
 
 public final class ConduitInitiatorManagerImpl implements ConduitInitiatorManager {
 
@@ -39,6 +40,8 @@
     final Map<String, ConduitInitiator> conduitInitiators;
     
     private Bus bus;
+    
+    private ExtensionManager extensionManager;
 
     public ConduitInitiatorManagerImpl() {
         conduitInitiators = new ConcurrentHashMap<String, ConduitInitiator>();
@@ -49,6 +52,12 @@
     }
     
     @Resource
+    public void setExtensionManager(ExtensionManager em) {
+        extensionManager = em;
+    }
+    
+    
+    @Resource
     public void setBus(Bus b) {
         bus = b;
     }
@@ -93,6 +102,12 @@
      */
     public ConduitInitiator getConduitInitiator(String namespace) throws BusException {
         ConduitInitiator factory = conduitInitiators.get(namespace);
+        
+        if (null == factory && extensionManager != null) { 
+            extensionManager.activateViaNS(namespace);            
+            factory = conduitInitiators.get(namespace);
+        }
+        
         if (null == factory) {
             throw new BusException(new Message("NO_CONDUIT_INITIATOR", BUNDLE, namespace));
         }

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/DestinationFactoryManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/DestinationFactoryManagerImpl.java?view=diff&rev=500212&r1=500211&r2=500212
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/DestinationFactoryManagerImpl.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/DestinationFactoryManagerImpl.java
Fri Jan 26 02:33:38 2007
@@ -32,6 +32,7 @@
 import org.apache.cxf.BusException;
 import org.apache.cxf.common.i18n.BundleUtils;
 import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.extension.ExtensionManager;
 
 public final class DestinationFactoryManagerImpl implements DestinationFactoryManager {
 
@@ -39,6 +40,7 @@
 
     final Map<String, DestinationFactory> destinationFactories;
     Properties factoryNamespaceMappings;
+    private ExtensionManager extensionManager; 
 
     private Bus bus;
 
@@ -50,17 +52,26 @@
         this.destinationFactories = destinationFactories;
     }
 
+  
+
+    @Resource
+    public void setExtensionManager(ExtensionManager em) {
+        extensionManager = em;
+    }
+    
     @Resource
     public void setBus(Bus b) {
         bus = b;
     }
-
+    
     @PostConstruct
     public void register() {
         if (null != bus) {
             bus.setExtension(this, DestinationFactoryManager.class);
         }
     }
+    
+
 
     /*
      * (non-Javadoc)
@@ -95,6 +106,11 @@
      */
     public DestinationFactory getDestinationFactory(String namespace) throws BusException
{
         DestinationFactory factory = destinationFactories.get(namespace);
+        if (null == factory && extensionManager != null) {
+            extensionManager.activateViaNS(namespace);            
+            factory = destinationFactories.get(namespace);
+        }
+        
         if (null == factory) {
             throw new BusException(new Message("NO_DEST_FACTORY", BUNDLE, namespace));
         }

Modified: incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPTransportFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPTransportFactory.java?view=diff&rev=500212&r1=500211&r2=500212
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPTransportFactory.java
(original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPTransportFactory.java
Fri Jan 26 02:33:38 2007
@@ -164,14 +164,14 @@
                ? new URLConnectionFactory() {
                        public URLConnection createConnection(Proxy proxy, URL u)
                            throws IOException {
-                           return proxy != null 
+                           return proxy != null
                                   ? u.openConnection(proxy)
                                   : u.openConnection();
                        }
                    }
                : new HttpsURLConnectionFactory(policy);
     }
-    
+
     protected static JettyListenerFactory getListenerFactory(SSLServerPolicy policy) {
         return policy == null
                ? new JettyListenerFactory() {

Modified: incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/bus-extensions.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/bus-extensions.xml?view=diff&rev=500212&r1=500211&r2=500212
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/bus-extensions.xml
(original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/bus-extensions.xml
Fri Jan 26 02:33:38 2007
@@ -19,7 +19,7 @@
 -->
 <extensions xmlns="http://cxf.apache.org/bus/extension">
 
-    <extension class="org.apache.cxf.transport.http.HTTPTransportFactory" deferred="true">
+    <extension class="org.apache.cxf.transport.http.HTTPTransportFactory"  deferred="true">
         <namespace>http://schemas.xmlsoap.org/wsdl/soap/http</namespace>
         <namespace>http://schemas.xmlsoap.org/soap/http</namespace>
         <namespace>http://www.w3.org/2003/05/soap/bindings/HTTP/</namespace>

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/basicDOCBare/DOCBareClientServerTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/basicDOCBare/DOCBareClientServerTest.java?view=diff&rev=500212&r1=500211&r2=500212
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/basicDOCBare/DOCBareClientServerTest.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/basicDOCBare/DOCBareClientServerTest.java
Fri Jan 26 02:33:38 2007
@@ -44,6 +44,10 @@
                                                 "SOAPService");
     private final QName portName = new QName("http://apache.org/hello_world_doc_lit_bare",
"SoapPort");
 
+    public void setUp() {
+        System.setProperty("org.apache.cxf.bus.factory", "org.apache.cxf.bus.cxf.CXFBusFactory");
+    }
+    
     public static Test suite() throws Exception {
         TestSuite suite = new TestSuite(DOCBareClientServerTest.class);
         return new ClientServerSetupBase(suite) {

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/basicDOCBare/Server.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/basicDOCBare/Server.java?view=diff&rev=500212&r1=500211&r2=500212
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/basicDOCBare/Server.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/basicDOCBare/Server.java
Fri Jan 26 02:33:38 2007
@@ -33,6 +33,7 @@
 
 
     protected void run()  {
+        System.setProperty("org.apache.cxf.bus.factory", "org.apache.cxf.bus.cxf.CXFBusFactory");
 
         Object implementor = new PutLastTradedPriceImpl();
         String address = "http://localhost:9107/SOAPDocLitBareService/SoapPort";      
         Endpoint ep = Endpoint.create(implementor);



Mime
View raw message