cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1496566 [1/2] - in /cxf/trunk: api/src/main/java/org/apache/cxf/endpoint/ api/src/main/java/org/apache/cxf/transport/ api/src/main/java/org/apache/cxf/ws/addressing/ rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/ rt/bindings...
Date Tue, 25 Jun 2013 18:07:11 GMT
Author: dkulp
Date: Tue Jun 25 18:07:10 2013
New Revision: 1496566

URL: http://svn.apache.org/r1496566
Log:
Modify the transport factories (ConduitInitiator and DestinationFactory) to pass the bus as a param to allow the factories to exist as singletons or OSGi services or similar.

Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/AbstractConduitSelector.java
    cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/ServerImpl.java
    cxf/trunk/api/src/main/java/org/apache/cxf/transport/AbstractTransportFactory.java
    cxf/trunk/api/src/main/java/org/apache/cxf/transport/ConduitInitiator.java
    cxf/trunk/api/src/main/java/org/apache/cxf/transport/DestinationFactory.java
    cxf/trunk/api/src/main/java/org/apache/cxf/transport/TransportFinder.java
    cxf/trunk/api/src/main/java/org/apache/cxf/transport/TransportURIResolver.java
    cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
    cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaBindingFactory.java
    cxf/trunk/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/CorbaBindingFactoryTest.java
    cxf/trunk/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/TestUtils.java
    cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/LocalServerListener.java
    cxf/trunk/rt/bindings/object/src/test/java/org/apache/cxf/binding/object/LocalServerRegistrationTest.java
    cxf/trunk/rt/bindings/object/src/test/java/org/apache/cxf/binding/object/ObjectBindingTest.java
    cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapTransportFactory.java
    cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapDestinationFactoryTest.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerImpl.java
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/AbstractAegisTest.java
    cxf/trunk/rt/databinding/jibx/src/test/java/org/apache/cxf/jibx/AbstractJibxTest.java
    cxf/trunk/rt/databinding/sdo/src/test/java/org/apache/cxf/sdo/AbstractSDOTest.java
    cxf/trunk/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/AbstractXmlBeansTest.java
    cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/AbstractJaxWsTest.java
    cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java
    cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JaxWsClientTest.java
    cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/dispatch/DispatchTest.java
    cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/holder/HolderTest.java
    cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ws/PolicyAnnotationTest.java
    cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/AbstractSimpleFrontendTest.java
    cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/ServerFactoryTest.java
    cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/stax/StaxDatabindingTest.java
    cxf/trunk/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduitFactory.java
    cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestinationTest.java
    cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/ApplicationContextTest.java
    cxf/trunk/rt/transports/http-netty/netty-client/src/main/java/org/apache/cxf/transport/http/netty/client/NettyHttpConduitFactory.java
    cxf/trunk/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/NettyHttpDestinationTest.java
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduitFactory.java
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPTransportFactory.java
    cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HTTPTransportFactoryTest.java
    cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/spring/HttpConduitConfigurationTest.java
    cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSTransportFactory.java
    cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java
    cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java
    cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalTransportFactory.java
    cxf/trunk/rt/transports/local/src/test/java/org/apache/cxf/transport/local/LocalTransportFactoryTest.java
    cxf/trunk/rt/transports/udp/src/main/java/org/apache/cxf/transport/udp/UDPTransportFactory.java
    cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/InternalContextUtils.java
    cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/MAPAggregatorImpl.java
    cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/MtomPolicyTest.java
    cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/MtomServerTest.java
    cxf/trunk/testutils/src/main/java/org/apache/cxf/test/TestUtilities.java

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/AbstractConduitSelector.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/AbstractConduitSelector.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/AbstractConduitSelector.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/AbstractConduitSelector.java Tue Jun 25 18:07:10 2013
@@ -100,14 +100,14 @@ public abstract class AbstractConduitSel
                         String basePath = (String)message.get(Message.BASE_PATH);
                         if (StringUtils.isEmpty(add)
                             || add.equals(ei.getAddress())) {
-                            c = conduitInitiator.getConduit(ei);
+                            c = conduitInitiator.getConduit(ei, exchange.getBus());
                             replaceEndpointAddressPropertyIfNeeded(message, add, c);
                         } else {
                             EndpointReferenceType epr = new EndpointReferenceType();
                             AttributedURIType ad = new AttributedURIType();
                             ad.setValue(StringUtils.isEmpty(basePath) ? add : basePath);
                             epr.setAddress(ad);
-                            c = conduitInitiator.getConduit(ei, epr);
+                            c = conduitInitiator.getConduit(ei, epr, exchange.getBus());
                         }
                         MessageObserver observer = 
                             exchange.get(MessageObserver.class);

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/ServerImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/ServerImpl.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/ServerImpl.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/ServerImpl.java Tue Jun 25 18:07:10 2013
@@ -90,7 +90,7 @@ public class ServerImpl implements Serve
             }
         }
             
-        destination = destinationFactory.getDestination(ei);
+        destination = destinationFactory.getDestination(ei, bus);
         LOG.info("Setting the server's publish address to be " + ei.getAddress());
         serverRegistry = bus.getExtension(ServerRegistry.class);
         

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/transport/AbstractTransportFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/transport/AbstractTransportFactory.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/transport/AbstractTransportFactory.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/transport/AbstractTransportFactory.java Tue Jun 25 18:07:10 2013
@@ -22,15 +22,12 @@ import java.util.Collections;
 import java.util.List;
 import java.util.Set;
 
-import org.apache.cxf.Bus;
-import org.apache.cxf.BusException;
 import org.apache.cxf.helpers.CastUtils;
 
 /**
  * Helper methods for {@link DestinationFactory}s and {@link ConduitInitiator}s.
  */
 public abstract class AbstractTransportFactory {
-    protected Bus bus;
     private List<String> transportIds;
     
     public AbstractTransportFactory() {
@@ -38,89 +35,16 @@ public abstract class AbstractTransportF
     public AbstractTransportFactory(List<String> ids) {
         transportIds = ids;
     }
-    public AbstractTransportFactory(List<String> ids, Bus b) {
-        transportIds = ids;
-        bus = b;
-        register();
-    }
     
-    public Bus getBus() {
-        return bus;
-    }
-    public void setBus(Bus b) {
-        unregister();
-        bus = b;
-        register();
-    }
-
     public final List<String> getTransportIds() {
         return transportIds;
     }
 
     public void setTransportIds(List<String> transportIds) {
-        unregister();
         this.transportIds = transportIds;
-        register();
     }
 
     public Set<String> getUriPrefixes() {
         return CastUtils.cast(Collections.EMPTY_SET);
     }
-    
-    public final void register() {
-        if (null == bus) {
-            return;
-        }
-        if (this instanceof DestinationFactory) {
-            DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
-            if (null != dfm && getTransportIds() != null) {
-                for (String ns : getTransportIds()) {
-                    dfm.registerDestinationFactory(ns, (DestinationFactory)this);
-                }
-            }
-        }
-        if (this instanceof ConduitInitiator) {
-            ConduitInitiatorManager cim = bus.getExtension(ConduitInitiatorManager.class);
-            if (cim != null && getTransportIds() != null) {
-                for (String ns : getTransportIds()) {
-                    cim.registerConduitInitiator(ns, (ConduitInitiator)this);
-                }
-            }
-        }
-    }
-    public final void unregister() {
-        if (null == bus) {
-            return;
-        }
-        if (this instanceof DestinationFactory) {
-            DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
-            if (null != dfm && getTransportIds() != null) {
-                for (String ns : getTransportIds()) {
-                    try {
-                        if (dfm.getDestinationFactory(ns) == this) {
-                            dfm.deregisterDestinationFactory(ns);
-                        }
-                    } catch (BusException e) {
-                        //ignore
-                    }
-                }
-            }
-        }
-        if (this instanceof ConduitInitiator) {
-            ConduitInitiatorManager cim = bus.getExtension(ConduitInitiatorManager.class);
-            if (cim != null && getTransportIds() != null) {
-                for (String ns : getTransportIds()) {
-                    try {
-                        if (cim.getConduitInitiator(ns) == this) {
-                            cim.deregisterConduitInitiator(ns);
-                        }
-                    } catch (BusException e) {
-                        //ignore
-                    }
-                }
-            }
-        }
-        
-    }
-    
 }

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/transport/ConduitInitiator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/transport/ConduitInitiator.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/transport/ConduitInitiator.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/transport/ConduitInitiator.java Tue Jun 25 18:07:10 2013
@@ -23,6 +23,7 @@ import java.io.IOException;
 import java.util.List;
 import java.util.Set;
 
+import org.apache.cxf.Bus;
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.ws.addressing.EndpointReferenceType;
 
@@ -36,7 +37,8 @@ public interface ConduitInitiator {
      * @param targetInfo the endpoint info of the target 
      * @return a suitable new or pre-existing Conduit
      */
-    Conduit getConduit(EndpointInfo targetInfo) throws IOException;
+    Conduit getConduit(EndpointInfo targetInfo,
+                       Bus bus) throws IOException;
 
     /**
      * Initiate an outbound Conduit.
@@ -47,7 +49,8 @@ public interface ConduitInitiator {
      * @return a suitable new or pre-existing Conduit
      */
     Conduit getConduit(EndpointInfo localInfo,
-                       EndpointReferenceType target) throws IOException;
+                       EndpointReferenceType target,
+                       Bus bus) throws IOException;
     
     Set<String> getUriPrefixes();
     List<String> getTransportIds();

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/transport/DestinationFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/transport/DestinationFactory.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/transport/DestinationFactory.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/transport/DestinationFactory.java Tue Jun 25 18:07:10 2013
@@ -23,6 +23,7 @@ import java.io.IOException;
 import java.util.List;
 import java.util.Set;
 
+import org.apache.cxf.Bus;
 import org.apache.cxf.service.model.EndpointInfo;
 
 /**
@@ -36,7 +37,7 @@ public interface DestinationFactory {
      * @param ei the endpoint info of the destination.
      * @return the created Destination.
      */
-    Destination getDestination(EndpointInfo ei) throws IOException;
+    Destination getDestination(EndpointInfo ei, Bus bus) throws IOException;
     
     Set<String> getUriPrefixes();
     

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/transport/TransportFinder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/transport/TransportFinder.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/transport/TransportFinder.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/transport/TransportFinder.java Tue Jun 25 18:07:10 2013
@@ -242,6 +242,7 @@ public class TransportFinder<T> {
             = new ConfiguredBeanLocator.BeanLoaderListener<T>() {
                 public boolean beanLoaded(String name, T bean) {
                     loaded.add(name);
+                    registerBean(bean);
                     return map.containsKey(namespace);
                 }
 

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/transport/TransportURIResolver.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/transport/TransportURIResolver.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/transport/TransportURIResolver.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/transport/TransportURIResolver.java Tue Jun 25 18:07:10 2013
@@ -106,7 +106,7 @@ public class TransportURIResolver extend
                     // set the endpointInfo name which could be used for configuration
                     info.setName(new QName("http://cxf.apache.org", "TransportURIResolver"));
                     info.setAddress(base.toString());
-                    final Conduit c = ci.getConduit(info);
+                    final Conduit c = ci.getConduit(info, bus);
                     Message message = new MessageImpl();
                     Exchange exch = new ExchangeImpl();
                     message.setExchange(exch);

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java Tue Jun 25 18:07:10 2013
@@ -619,7 +619,7 @@ public final class ContextUtils {
                     = bus.getExtension(ConduitInitiatorManager.class)
                         .getConduitInitiatorForUri(reference.getAddress().getValue());
                 if (conduitInitiator != null) {
-                    Conduit c = conduitInitiator.getConduit(ei, reference);
+                    Conduit c = conduitInitiator.getConduit(ei, reference, bus);
                     //ensure decoupled back channel input stream is closed
                     c.setMessageObserver(new MessageObserver() {
                         public void onMessage(Message m) {

Modified: cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaBindingFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaBindingFactory.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaBindingFactory.java (original)
+++ cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaBindingFactory.java Tue Jun 25 18:07:10 2013
@@ -27,8 +27,6 @@ import java.util.Collection;
 import java.util.List;
 import java.util.Set;
 
-import javax.annotation.PostConstruct;
-
 import org.apache.cxf.Bus;
 import org.apache.cxf.binding.Binding;
 import org.apache.cxf.binding.corba.interceptors.CorbaStreamFaultInInterceptor;
@@ -36,21 +34,17 @@ import org.apache.cxf.binding.corba.inte
 import org.apache.cxf.binding.corba.interceptors.CorbaStreamInInterceptor;
 import org.apache.cxf.binding.corba.interceptors.CorbaStreamOutInterceptor;
 import org.apache.cxf.binding.corba.utils.OrbConfig;
-import org.apache.cxf.common.injection.NoJSR250Annotations;
 import org.apache.cxf.interceptor.BareInInterceptor;
 import org.apache.cxf.interceptor.BareOutInterceptor;
 import org.apache.cxf.service.model.BindingInfo;
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.transport.Conduit;
 import org.apache.cxf.transport.ConduitInitiator;
-import org.apache.cxf.transport.ConduitInitiatorManager;
 import org.apache.cxf.transport.Destination;
 import org.apache.cxf.transport.DestinationFactory;
-import org.apache.cxf.transport.DestinationFactoryManager;
 import org.apache.cxf.ws.addressing.EndpointReferenceType;
 import org.apache.cxf.wsdl.binding.AbstractWSDLBindingFactory;
 
-@NoJSR250Annotations(unlessNull = { "bus" })
 public class CorbaBindingFactory extends AbstractWSDLBindingFactory
     implements ConduitInitiator, DestinationFactory {
 
@@ -64,40 +58,10 @@ public class CorbaBindingFactory extends
     protected List<String> transportIds = new ArrayList<String>(DEFAULT_NAMESPACES);
     protected OrbConfig orbConfig = new OrbConfig();
 
-    public CorbaBindingFactory(Bus b) {
-        super(b, DEFAULT_NAMESPACES);
-        registerWithDestinationManager();
-        registerWithConduitManager();
+    public CorbaBindingFactory() {
+        super(DEFAULT_NAMESPACES);
     }
 
-    
-    @PostConstruct
-    final void registerWithDestinationManager() {
-        if (null == bus) {
-            return;
-        }
-
-        DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
-        if (null != dfm && activationNamespaces != null) {
-            for (String ns : activationNamespaces) {
-                dfm.registerDestinationFactory(ns, this);
-            }
-        }
-    }
-
-    @PostConstruct
-    final void registerWithConduitManager() {
-        if (null == bus) {
-            return;
-        }
-
-        ConduitInitiatorManager cim = bus.getExtension(ConduitInitiatorManager.class);
-        if (null != cim && activationNamespaces != null) {
-            for (String ns : activationNamespaces) {
-                cim.registerConduitInitiator(ns, this);
-            }
-        }
-    }
 
     public void setOrbClass(String cls) {
         orbConfig.setOrbClass(cls);
@@ -120,17 +84,17 @@ public class CorbaBindingFactory extends
         return binding;
     }
 
-    public Conduit getConduit(EndpointInfo endpointInfo)
+    public Conduit getConduit(EndpointInfo endpointInfo, Bus bus)
         throws IOException {
-        return getConduit(endpointInfo, null);
+        return getConduit(endpointInfo, null, bus);
     }
 
-    public Conduit getConduit(EndpointInfo endpointInfo, EndpointReferenceType target)
+    public Conduit getConduit(EndpointInfo endpointInfo, EndpointReferenceType target, Bus bus)
         throws IOException {
         return new CorbaConduit(endpointInfo, target, orbConfig);
     }
 
-    public Destination getDestination(EndpointInfo endpointInfo)
+    public Destination getDestination(EndpointInfo endpointInfo, Bus bus)
         throws IOException {
         return new CorbaDestination(endpointInfo, orbConfig);
     }

Modified: cxf/trunk/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/CorbaBindingFactoryTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/CorbaBindingFactoryTest.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/CorbaBindingFactoryTest.java (original)
+++ cxf/trunk/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/CorbaBindingFactoryTest.java Tue Jun 25 18:07:10 2013
@@ -104,12 +104,12 @@ public class CorbaBindingFactoryTest ext
                          "SimpleCORBAService", 
                          "SimpleCORBAPort");
         
-        Conduit conduit = factory.getConduit(endpointInfo);
+        Conduit conduit = factory.getConduit(endpointInfo, bus);
         assertNotNull(conduit);   
-        conduit = factory.getConduit(endpointInfo, null);
+        conduit = factory.getConduit(endpointInfo, null, bus);
         assertNotNull(conduit);
         target = EasyMock.createMock(EndpointReferenceType.class);
-        conduit = factory.getConduit(endpointInfo, target);
+        conduit = factory.getConduit(endpointInfo, target, bus);
         assertNotNull(conduit);
     }
             
@@ -120,7 +120,7 @@ public class CorbaBindingFactoryTest ext
                          "SimpleCORBAService", 
                          "SimpleCORBAPort");
         
-        Destination destination = factory.getDestination(endpointInfo);
+        Destination destination = factory.getDestination(endpointInfo, bus);
         assertNotNull(destination);
         target = destination.getAddress();
         assertNotNull(target);

Modified: cxf/trunk/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/TestUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/TestUtils.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/TestUtils.java (original)
+++ cxf/trunk/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/TestUtils.java Tue Jun 25 18:07:10 2013
@@ -63,7 +63,7 @@ public class TestUtils { 
                                                      "ExceptionTestCORBAService",
                                                      "ExceptionTestCORBAPort");
         CorbaBindingFactory corbaBF = factory;
-        return (CorbaDestination)corbaBF.getDestination(endpointInfo);        
+        return (CorbaDestination)corbaBF.getDestination(endpointInfo, bus);        
     }
     
     public CorbaDestination getComplexTypesTestDestination() throws Exception {
@@ -72,7 +72,7 @@ public class TestUtils { 
                                                      "ComplexTypesCORBAService",
                                                      "ComplexTypesCORBAPort");
         CorbaBindingFactory corbaBF = factory;        
-        return (CorbaDestination)corbaBF.getDestination(endpointInfo);
+        return (CorbaDestination)corbaBF.getDestination(endpointInfo, bus);
     }
     public CorbaDestination getComplexTypesTestDestinationYoko() throws Exception {
         endpointInfo = setupServiceInfo("http://cxf.apache.org/bindings/corba/ComplexTypes",
@@ -80,7 +80,7 @@ public class TestUtils { 
                                                      "ComplexTypesCORBAService",
                                                      "ComplexTypesCORBAPort");
         CorbaBindingFactory corbaBF = factory;        
-        return (CorbaDestination)corbaBF.getDestination(endpointInfo);
+        return (CorbaDestination)corbaBF.getDestination(endpointInfo, bus);
     }
 
 }

Modified: cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/LocalServerListener.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/LocalServerListener.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/LocalServerListener.java (original)
+++ cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/LocalServerListener.java Tue Jun 25 18:07:10 2013
@@ -71,7 +71,7 @@ public class LocalServerListener impleme
         
         try {
             // Register a new Destination locally for the Server
-            Destination destination = getDestinationFactory().getDestination(ei);
+            Destination destination = getDestinationFactory().getDestination(ei, bus);
             
             destination.setMessageObserver(new OverrideBindingObserver(endpoint, binding, bus));
         } catch (IOException e1) {
@@ -85,7 +85,7 @@ public class LocalServerListener impleme
         ei.setAddress(uri);
         
         try {
-            Destination destination = getDestinationFactory().getDestination(ei);
+            Destination destination = getDestinationFactory().getDestination(ei, bus);
             
             destination.shutdown();
         } catch (IOException e) {

Modified: cxf/trunk/rt/bindings/object/src/test/java/org/apache/cxf/binding/object/LocalServerRegistrationTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/object/src/test/java/org/apache/cxf/binding/object/LocalServerRegistrationTest.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/object/src/test/java/org/apache/cxf/binding/object/LocalServerRegistrationTest.java (original)
+++ cxf/trunk/rt/bindings/object/src/test/java/org/apache/cxf/binding/object/LocalServerRegistrationTest.java Tue Jun 25 18:07:10 2013
@@ -110,6 +110,6 @@ public class LocalServerRegistrationTest
         ConduitInitiator ci = cim.getConduitInitiator(LocalTransportFactory.TRANSPORT_ID);
         EndpointInfo ei = new EndpointInfo();
         ei.setAddress(string);
-        return ci.getConduit(ei);
+        return ci.getConduit(ei, bus);
     }
 }

Modified: cxf/trunk/rt/bindings/object/src/test/java/org/apache/cxf/binding/object/ObjectBindingTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/object/src/test/java/org/apache/cxf/binding/object/ObjectBindingTest.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/object/src/test/java/org/apache/cxf/binding/object/ObjectBindingTest.java (original)
+++ cxf/trunk/rt/bindings/object/src/test/java/org/apache/cxf/binding/object/ObjectBindingTest.java Tue Jun 25 18:07:10 2013
@@ -166,7 +166,7 @@ public class ObjectBindingTest extends A
         EndpointInfo ei = new EndpointInfo();
         ei.setAddress(string);
 
-        return df.getDestination(ei);
+        return df.getDestination(ei, getBus());
     }
 
     private Conduit getLocalConduit(String string) throws BusException, IOException {
@@ -175,6 +175,6 @@ public class ObjectBindingTest extends A
         ConduitInitiator ci = cim.getConduitInitiator(LocalTransportFactory.TRANSPORT_ID);
         EndpointInfo ei = new EndpointInfo();
         ei.setAddress(string);
-        return ci.getConduit(ei);
+        return ci.getConduit(ei, getBus());
     }
 }

Modified: cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapTransportFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapTransportFactory.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapTransportFactory.java (original)
+++ cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapTransportFactory.java Tue Jun 25 18:07:10 2013
@@ -29,7 +29,6 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 
-import javax.annotation.Resource;
 import javax.wsdl.WSDLException;
 import javax.wsdl.extensions.ExtensionRegistry;
 import javax.wsdl.factory.WSDLFactory;
@@ -58,7 +57,7 @@ import org.apache.cxf.transport.Destinat
 import org.apache.cxf.ws.addressing.EndpointReferenceType;
 import org.apache.cxf.wsdl11.WSDLEndpointFactory;
 
-@NoJSR250Annotations(unlessNull = { "bus" })
+@NoJSR250Annotations
 public class SoapTransportFactory extends AbstractTransportFactory implements DestinationFactory,
     WSDLEndpointFactory, ConduitInitiator {
     
@@ -83,11 +82,7 @@ public class SoapTransportFactory extend
         )));
     
     public SoapTransportFactory() {
-        super(DEFAULT_NAMESPACES, null);
-    }
-
-    public SoapTransportFactory(Bus b) {
-        super(DEFAULT_NAMESPACES, b);
+        super(DEFAULT_NAMESPACES);
     }
     
     public Set<String> getUriPrefixes() {
@@ -114,7 +109,7 @@ public class SoapTransportFactory extend
         return address != null && address.startsWith("jms:") && !"jms://".equals(address);
     }
 
-    public Destination getDestination(EndpointInfo ei) throws IOException {
+    public Destination getDestination(EndpointInfo ei, Bus bus) throws IOException {
         String address = ei.getAddress();
         if (!StringUtils.isEmpty(address) && address.startsWith("soap.tcp")) {
             return new SoapTcpDestination(ei.getTarget(), ei);
@@ -139,7 +134,7 @@ public class SoapTransportFactory extend
             } else {
                 destinationFactory = mgr.getDestinationFactoryForUri(address);
             }
-            return destinationFactory.getDestination(ei);
+            return destinationFactory.getDestination(ei, bus);
         } catch (BusException e) {
             IOException ex = new IOException("Could not find destination factory for transport " + transId);
             ex.initCause(e);
@@ -207,7 +202,7 @@ public class SoapTransportFactory extend
     }
 
 
-    public Conduit getConduit(EndpointInfo ei, EndpointReferenceType target) throws IOException {
+    public Conduit getConduit(EndpointInfo ei, EndpointReferenceType target, Bus bus) throws IOException {
         String address = target == null ? ei.getAddress() : target.getAddress().getValue();
         if (!StringUtils.isEmpty(address) && address.startsWith("soap.tcp://")) {
             //TODO - examine policies and stuff to look for the sun tcp policies
@@ -235,19 +230,14 @@ public class SoapTransportFactory extend
             if (conduitInit == null) {
                 throw new RuntimeException(String.format(CANNOT_GET_CONDUIT_ERROR, address, transId));
             }
-            return conduitInit.getConduit(ei, target);
+            return conduitInit.getConduit(ei, target, bus);
         } catch (BusException e) {
             throw new RuntimeException(String.format(CANNOT_GET_CONDUIT_ERROR, address, transId));
         }
     }
 
-    public Conduit getConduit(EndpointInfo ei) throws IOException {
-        return getConduit(ei, ei.getTarget());
-    }
-
-    @Resource(name = "cxf")
-    public void setBus(Bus bus) {
-        super.setBus(bus);
+    public Conduit getConduit(EndpointInfo ei, Bus b) throws IOException {
+        return getConduit(ei, ei.getTarget(), b);
     }
     
     public void setActivationNamespaces(Collection<String> ans) {

Modified: cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapDestinationFactoryTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapDestinationFactoryTest.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapDestinationFactoryTest.java (original)
+++ cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapDestinationFactoryTest.java Tue Jun 25 18:07:10 2013
@@ -60,7 +60,7 @@ public class SoapDestinationFactoryTest 
         Destination dest = control.createMock(Destination.class);
 
         EasyMock.expect(dfm.getDestinationFactory(transportURI)).andReturn(fooDF);
-        EasyMock.expect(fooDF.getDestination(ei)).andStubReturn(dest);
+        EasyMock.expect(fooDF.getDestination(ei, null)).andStubReturn(dest);
 
         control.replay();
 

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerImpl.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerImpl.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerImpl.java Tue Jun 25 18:07:10 2013
@@ -302,10 +302,11 @@ public class ExtensionManagerImpl implem
         for (Extension ex : all.values()) {
             Class<?> cls = ex.getClassObject(loader);
             if (cls != null 
-                && ex.getLoadedObject() == null 
                 && type.isAssignableFrom(cls)
                 && listener.loadBean(ex.getName(), cls.asSubclass(type))) {
-                loadAndRegister(ex);
+                if (ex.getLoadedObject() == null) {
+                    loadAndRegister(ex);
+                }
                 if (listener.beanLoaded(ex.getName(), type.cast(ex.getLoadedObject()))) {
                     return true;
                 }

Modified: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/AbstractAegisTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/AbstractAegisTest.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/AbstractAegisTest.java (original)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/AbstractAegisTest.java Tue Jun 25 18:07:10 2013
@@ -90,12 +90,11 @@ public abstract class AbstractAegisTest 
         DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
 
         SoapTransportFactory soapDF = new SoapTransportFactory();
-        soapDF.setBus(bus);
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/", soapDF);
         dfm.registerDestinationFactory(SoapBindingConstants.SOAP11_BINDING_ID, soapDF);
         dfm.registerDestinationFactory("http://cxf.apache.org/transports/local", soapDF);
 
-        localTransport = new LocalTransportFactory(bus);
+        localTransport = new LocalTransportFactory();
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/http", localTransport);
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/http", localTransport);
         dfm.registerDestinationFactory("http://cxf.apache.org/bindings/xformat", localTransport);

Modified: cxf/trunk/rt/databinding/jibx/src/test/java/org/apache/cxf/jibx/AbstractJibxTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/jibx/src/test/java/org/apache/cxf/jibx/AbstractJibxTest.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/jibx/src/test/java/org/apache/cxf/jibx/AbstractJibxTest.java (original)
+++ cxf/trunk/rt/databinding/jibx/src/test/java/org/apache/cxf/jibx/AbstractJibxTest.java Tue Jun 25 18:07:10 2013
@@ -55,12 +55,11 @@ public abstract class AbstractJibxTest e
         DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
 
         SoapTransportFactory soapDF = new SoapTransportFactory();
-        soapDF.setBus(bus);
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/", soapDF);
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/", soapDF);
         dfm.registerDestinationFactory("http://cxf.apache.org/transports/local", soapDF);
 
-        localTransport = new LocalTransportFactory(bus);
+        localTransport = new LocalTransportFactory();
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/http", localTransport);
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/http", localTransport);
         dfm.registerDestinationFactory("http://cxf.apache.org/bindings/xformat", localTransport);

Modified: cxf/trunk/rt/databinding/sdo/src/test/java/org/apache/cxf/sdo/AbstractSDOTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/sdo/src/test/java/org/apache/cxf/sdo/AbstractSDOTest.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/sdo/src/test/java/org/apache/cxf/sdo/AbstractSDOTest.java (original)
+++ cxf/trunk/rt/databinding/sdo/src/test/java/org/apache/cxf/sdo/AbstractSDOTest.java Tue Jun 25 18:07:10 2013
@@ -73,12 +73,11 @@ public abstract class AbstractSDOTest ex
         DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
 
         SoapTransportFactory soapDF = new SoapTransportFactory();
-        soapDF.setBus(bus);
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/", soapDF);
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/", soapDF);
         dfm.registerDestinationFactory("http://cxf.apache.org/transports/local", soapDF);
         
-        localTransport = new LocalTransportFactory(bus);
+        localTransport = new LocalTransportFactory();
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/http", localTransport);
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/http", localTransport);
         dfm.registerDestinationFactory("http://cxf.apache.org/bindings/xformat", localTransport);

Modified: cxf/trunk/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/AbstractXmlBeansTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/AbstractXmlBeansTest.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/AbstractXmlBeansTest.java (original)
+++ cxf/trunk/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/AbstractXmlBeansTest.java Tue Jun 25 18:07:10 2013
@@ -73,12 +73,11 @@ public abstract class AbstractXmlBeansTe
         DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
 
         SoapTransportFactory soapDF = new SoapTransportFactory();
-        soapDF.setBus(bus);
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/", soapDF);
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/", soapDF);
         dfm.registerDestinationFactory("http://cxf.apache.org/transports/local", soapDF);
         
-        localTransport = new LocalTransportFactory(bus);
+        localTransport = new LocalTransportFactory();
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/http", localTransport);
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/http", localTransport);
         dfm.registerDestinationFactory("http://cxf.apache.org/bindings/xformat", localTransport);

Modified: cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/AbstractJaxWsTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/AbstractJaxWsTest.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/AbstractJaxWsTest.java (original)
+++ cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/AbstractJaxWsTest.java Tue Jun 25 18:07:10 2013
@@ -61,13 +61,12 @@ public abstract class AbstractJaxWsTest 
         DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
 
         SoapTransportFactory soapDF = new SoapTransportFactory();
-        soapDF.setBus(bus);
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/", soapDF);
         dfm.registerDestinationFactory(SoapBindingConstants.SOAP11_BINDING_ID, soapDF);
         dfm.registerDestinationFactory(SoapBindingConstants.SOAP12_BINDING_ID, soapDF);
         dfm.registerDestinationFactory("http://cxf.apache.org/transports/local", soapDF);
         
-        localTransport = new LocalTransportFactory(bus);
+        localTransport = new LocalTransportFactory();
         localTransport.setUriPrefixes(new HashSet<String>(Arrays.asList("http", "local")));
         dfm.registerDestinationFactory(LocalTransportFactory.TRANSPORT_ID, localTransport);
         dfm.registerDestinationFactory("http://cxf.apache.org/transports/http", localTransport);

Modified: cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java (original)
+++ cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java Tue Jun 25 18:07:10 2013
@@ -339,11 +339,10 @@ public class ConfiguredEndpointTest exte
 
         DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
         SoapTransportFactory soapDF = new SoapTransportFactory();
-        soapDF.setBus(bus);
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/", soapDF);
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/", soapDF);
 
-        LocalTransportFactory localTransport = new LocalTransportFactory(bus);
+        LocalTransportFactory localTransport = new LocalTransportFactory();
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/http", localTransport);
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/http", localTransport);
     }

Modified: cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JaxWsClientTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JaxWsClientTest.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JaxWsClientTest.java (original)
+++ cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JaxWsClientTest.java Tue Jun 25 18:07:10 2013
@@ -68,7 +68,7 @@ public class JaxWsClientTest extends Abs
         EndpointInfo ei = new EndpointInfo(null, "http://schemas.xmlsoap.org/soap/http");
         ei.setAddress(address);
 
-        d = localTransport.getDestination(ei);
+        d = localTransport.getDestination(ei, bus);
     }
 
     @Test

Modified: cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/dispatch/DispatchTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/dispatch/DispatchTest.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/dispatch/DispatchTest.java (original)
+++ cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/dispatch/DispatchTest.java Tue Jun 25 18:07:10 2013
@@ -70,7 +70,7 @@ public class DispatchTest extends Abstra
         EndpointInfo ei = new EndpointInfo(null, "http://schemas.xmlsoap.org/soap/http");
         ei.setAddress(address);
 
-        d = localTransport.getDestination(ei);
+        d = localTransport.getDestination(ei, bus);
     }
 
     @Test

Modified: cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/holder/HolderTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/holder/HolderTest.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/holder/HolderTest.java (original)
+++ cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/holder/HolderTest.java Tue Jun 25 18:07:10 2013
@@ -47,7 +47,7 @@ public class HolderTest extends Abstract
         EndpointInfo ei = new EndpointInfo(null, "http://schemas.xmlsoap.org/soap/http");
         ei.setAddress(address);
 
-        Destination d = localTransport.getDestination(ei);
+        Destination d = localTransport.getDestination(ei, bus);
         d.setMessageObserver(new MessageReplayObserver("/org/apache/cxf/jaxws/holder/echoResponse.xml"));
 
         JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();

Modified: cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ws/PolicyAnnotationTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ws/PolicyAnnotationTest.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ws/PolicyAnnotationTest.java (original)
+++ cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ws/PolicyAnnotationTest.java Tue Jun 25 18:07:10 2013
@@ -69,12 +69,9 @@ public class PolicyAnnotationTest extend
             "http://cxf.apache.org/transports/http/configuration",
             "http://cxf.apache.org/bindings/xformat");
         
-        LocalTransportFactory f = new LocalTransportFactory(bus);
+        LocalTransportFactory f = new LocalTransportFactory();
         f.getUriPrefixes().add("http");
-        f.setTransportIds(tp);
-        f.setBus(bus);
-        f.register();
-        
+        f.setTransportIds(tp);        
         
         Server s = factory.create();
 
@@ -135,11 +132,9 @@ public class PolicyAnnotationTest extend
             "http://cxf.apache.org/transports/http/configuration",
             "http://cxf.apache.org/bindings/xformat");
         
-        LocalTransportFactory f = new LocalTransportFactory(bus);
+        LocalTransportFactory f = new LocalTransportFactory();
         f.getUriPrefixes().add("http");
         f.setTransportIds(tp);
-        f.setBus(bus);
-        f.register();
         
         
         Server s = factory.create();

Modified: cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/AbstractSimpleFrontendTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/AbstractSimpleFrontendTest.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/AbstractSimpleFrontendTest.java (original)
+++ cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/AbstractSimpleFrontendTest.java Tue Jun 25 18:07:10 2013
@@ -42,12 +42,11 @@ public abstract class AbstractSimpleFron
             .registerBindingFactory("http://schemas.xmlsoap.org/wsdl/soap/", bindingFactory);
 
         DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
-        SoapTransportFactory soapTF = new SoapTransportFactory();
-        soapTF.setBus(bus);
+        SoapTransportFactory soapTF = new SoapTransportFactory();        
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/", soapTF);
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/", soapTF);
 
-        LocalTransportFactory localTransport = new LocalTransportFactory(bus);
+        LocalTransportFactory localTransport = new LocalTransportFactory();
         localTransport.getUriPrefixes().add("http");
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/http", localTransport);
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/http", localTransport);

Modified: cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/ServerFactoryTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/ServerFactoryTest.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/ServerFactoryTest.java (original)
+++ cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/ServerFactoryTest.java Tue Jun 25 18:07:10 2013
@@ -105,9 +105,9 @@ public class ServerFactoryTest extends A
 
     public class CustomDestinationFactory extends AbstractTransportFactory implements DestinationFactory {
         public CustomDestinationFactory(Bus b) {
-            super(Arrays.asList("id"), b);
+            super(Arrays.asList("id"));
         }
-        public Destination getDestination(EndpointInfo ei) throws IOException {
+        public Destination getDestination(EndpointInfo ei, Bus b) throws IOException {
             return new CustomDestination();
         }
 

Modified: cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/stax/StaxDatabindingTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/stax/StaxDatabindingTest.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/stax/StaxDatabindingTest.java (original)
+++ cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/stax/StaxDatabindingTest.java Tue Jun 25 18:07:10 2013
@@ -60,12 +60,12 @@ public class StaxDatabindingTest extends
         
         ServerFactoryBean sf = new ServerFactoryBean();
         sf.setServiceBean(new CopyService());
+        sf.setBus(getBus());
         sf.setTransportId(LocalTransportFactory.TRANSPORT_ID);
         sf.setAddress(address);
         sf.setDataBinding(new StaxDataBinding());
         sf.getFeatures().add(new StaxDataBindingFeature());
-
-        sf.create();
+        sf.create().start();
         
         Node res = invoke(address, LocalTransportFactory.TRANSPORT_ID, "req.xml");
         

Modified: cxf/trunk/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduitFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduitFactory.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduitFactory.java (original)
+++ cxf/trunk/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduitFactory.java Tue Jun 25 18:07:10 2013
@@ -271,13 +271,14 @@ public class AsyncHTTPConduitFactory imp
     }
     
     @Override
-    public HTTPConduit createConduit(HTTPTransportFactory f, 
+    public HTTPConduit createConduit(HTTPTransportFactory f,
+                                     Bus bus,
                                      EndpointInfo localInfo,
                                      EndpointReferenceType target) throws IOException {
         if (isShutdown) {
             return null;
         }
-        return new AsyncHTTPConduit(f.getBus(), localInfo, target, this);
+        return new AsyncHTTPConduit(bus, localInfo, target, this);
     }
 
     @Resource 

Modified: cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestinationTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestinationTest.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestinationTest.java (original)
+++ cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestinationTest.java Tue Jun 25 18:07:10 2013
@@ -129,7 +129,9 @@ public class JettyHTTPDestinationTest ex
     }
     @After
     public void tearDown() {
-       
+        if (bus != null) {
+            bus.shutdown(true);
+        }
         bus = null;
         transportFactory = null;
         decoupledBackChannel = null;
@@ -163,14 +165,14 @@ public class JettyHTTPDestinationTest ex
     
     @Test
     public void testRandomPortAllocation() throws Exception {
+        bus = BusFactory.getDefaultBus(true);
         transportFactory = new HTTPTransportFactory();
-        transportFactory.setBus(BusFactory.getDefaultBus());
         ServiceInfo serviceInfo = new ServiceInfo();
         serviceInfo.setName(new QName("bla", "Service"));
         EndpointInfo ei = new EndpointInfo(serviceInfo, "");
         ei.setName(new QName("bla", "Port"));
         
-        Destination d1 = transportFactory.getDestination(ei);
+        Destination d1 = transportFactory.getDestination(ei, bus);
         URL url = new URL(d1.getAddress().getAddress().getValue());
         assertTrue("No random port has been allocated", 
                    url.getPort() > 0);
@@ -215,13 +217,12 @@ public class JettyHTTPDestinationTest ex
                 return httpEngine;
             }
         };
+        Bus b2 = new ExtensionManagerBus();
         transportFactory = new HTTPTransportFactory();
-        transportFactory.setBus(new ExtensionManagerBus());
-        transportFactory.getBus().setExtension(
-            factory, JettyHTTPServerEngineFactory.class);
+        b2.setExtension(factory, JettyHTTPServerEngineFactory.class);
         
         TestJettyDestination testDestination = 
-            new TestJettyDestination(transportFactory.getBus(), 
+            new TestJettyDestination(b2, 
                                      transportFactory.getRegistry(), 
                                      ei,
                                      factory);
@@ -232,24 +233,24 @@ public class JettyHTTPDestinationTest ex
     
     @Test
     public void testGetMultiple() throws Exception {
+        bus = BusFactory.getDefaultBus(true);
         transportFactory = new HTTPTransportFactory();
-        transportFactory.setBus(BusFactory.getDefaultBus(true));
         
         ServiceInfo serviceInfo = new ServiceInfo();
         serviceInfo.setName(new QName("bla", "Service"));        
         EndpointInfo ei = new EndpointInfo(serviceInfo, "");
         ei.setName(new QName("bla", "Port"));
         ei.setAddress("http://foo");
-        Destination d1 = transportFactory.getDestination(ei);
+        Destination d1 = transportFactory.getDestination(ei, bus);
         
-        Destination d2 = transportFactory.getDestination(ei);
+        Destination d2 = transportFactory.getDestination(ei, bus);
         
         // Second get should not generate a new destination. It should just retrieve the existing one
         assertEquals(d1, d2);
         
         d2.shutdown();
         
-        Destination d3 = transportFactory.getDestination(ei);
+        Destination d3 = transportFactory.getDestination(ei, bus);
         // Now a new destination should have been created
         assertNotSame(d1, d3);
     }
@@ -388,10 +389,9 @@ public class JettyHTTPDestinationTest ex
         throws Exception {
         policy = new HTTPServerPolicy();
         address = getEPR("bar/foo");
-        bus = new ExtensionManagerBus();
+        bus = BusFactory.getDefaultBus(true);
         
         transportFactory = new HTTPTransportFactory();
-        transportFactory.setBus(bus);
         
         ServiceInfo serviceInfo = new ServiceInfo();
         serviceInfo.setName(new QName("bla", "Service"));        
@@ -488,11 +488,11 @@ public class JettyHTTPDestinationTest ex
         transportFactory = new HTTPTransportFactory();
 
         final ConduitInitiator ci = new ConduitInitiator() {
-            public Conduit getConduit(EndpointInfo targetInfo) throws IOException {
+            public Conduit getConduit(EndpointInfo targetInfo, Bus b) throws IOException {
                 return decoupledBackChannel;
             }
 
-            public Conduit getConduit(EndpointInfo localInfo, EndpointReferenceType target)
+            public Conduit getConduit(EndpointInfo localInfo, EndpointReferenceType target, Bus b)
                 throws IOException {
                 return decoupledBackChannel;
             }

Modified: cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/ApplicationContextTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/ApplicationContextTest.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/ApplicationContextTest.java (original)
+++ cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/ApplicationContextTest.java Tue Jun 25 18:07:10 2013
@@ -108,7 +108,7 @@ public class ApplicationContextTest exte
         
         DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
         DestinationFactory factory = dfm.getDestinationFactory("http://cxf.apache.org/transports/http");
-        Destination d = factory.getDestination(info);
+        Destination d = factory.getDestination(info, bus);
         assertTrue(d instanceof JettyHTTPDestination);
         JettyHTTPDestination jd = (JettyHTTPDestination) d;        
         assertEquals("foobar", jd.getServer().getContentEncoding());   
@@ -119,16 +119,16 @@ public class ApplicationContextTest exte
         
         ConduitInitiatorManager cim = bus.getExtension(ConduitInitiatorManager.class);
         ConduitInitiator ci = cim.getConduitInitiator("http://cxf.apache.org/transports/http");
-        HTTPConduit conduit = (HTTPConduit) ci.getConduit(info);
+        HTTPConduit conduit = (HTTPConduit) ci.getConduit(info, bus);
         assertEquals(97, conduit.getClient().getConnectionTimeout());
         
         info.setName(new QName("urn:test:ns", "Bar"));
-        conduit = (HTTPConduit) ci.getConduit(info);
+        conduit = (HTTPConduit) ci.getConduit(info, bus);
         assertEquals(79, conduit.getClient().getConnectionTimeout());
 
         JettyHTTPDestination jd2 = 
             (JettyHTTPDestination)factory.getDestination(
-                getEndpointInfo("foo", "bar", "http://localhost:9001"));
+                getEndpointInfo("foo", "bar", "http://localhost:9001"), bus);
         
         engine = (JettyHTTPServerEngine)jd2.getEngine();
         assertEquals(40000, engine.getMaxIdleTime());
@@ -143,7 +143,7 @@ public class ApplicationContextTest exte
         
         JettyHTTPDestination jd3 = 
             (JettyHTTPDestination)factory.getDestination(
-                getEndpointInfo("sna", "foo", "https://localhost:9002"));
+                getEndpointInfo("sna", "foo", "https://localhost:9002"), bus);
         
         engine = (JettyHTTPServerEngine)jd3.getEngine();
         assertEquals(111, engine.getThreadingParameters().getMinThreads());
@@ -153,7 +153,7 @@ public class ApplicationContextTest exte
         
         JettyHTTPDestination jd4 = 
             (JettyHTTPDestination)factory.getDestination(
-                getEndpointInfo("sna", "foo2", "https://localhost:9003"));
+                getEndpointInfo("sna", "foo2", "https://localhost:9003"), bus);
         
         engine = (JettyHTTPServerEngine)jd4.getEngine();
         assertEquals(engine.getTlsServerParameters().getClientAuthentication().isWant(), false);
@@ -161,7 +161,7 @@ public class ApplicationContextTest exte
 
         JettyHTTPDestination jd5 = 
             (JettyHTTPDestination)factory.getDestination(
-                getEndpointInfo("sna", "foo", "http://localhost:9100"));
+                getEndpointInfo("sna", "foo", "http://localhost:9100"), bus);
         
         engine = (JettyHTTPServerEngine)jd5.getEngine();
         String r = "expected fallback thread parameters configured for port 0";

Modified: cxf/trunk/rt/transports/http-netty/netty-client/src/main/java/org/apache/cxf/transport/http/netty/client/NettyHttpConduitFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-netty/netty-client/src/main/java/org/apache/cxf/transport/http/netty/client/NettyHttpConduitFactory.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-netty/netty-client/src/main/java/org/apache/cxf/transport/http/netty/client/NettyHttpConduitFactory.java (original)
+++ cxf/trunk/rt/transports/http-netty/netty-client/src/main/java/org/apache/cxf/transport/http/netty/client/NettyHttpConduitFactory.java Tue Jun 25 18:07:10 2013
@@ -20,10 +20,8 @@
 package org.apache.cxf.transport.http.netty.client;
 
 import java.io.IOException;
-import javax.annotation.Resource;
 import org.apache.cxf.Bus;
 import org.apache.cxf.buslifecycle.BusLifeCycleListener;
-import org.apache.cxf.buslifecycle.BusLifeCycleManager;
 import org.apache.cxf.common.injection.NoJSR250Annotations;
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.transport.http.HTTPConduit;
@@ -31,7 +29,7 @@ import org.apache.cxf.transport.http.HTT
 import org.apache.cxf.transport.http.HTTPTransportFactory;
 import org.apache.cxf.ws.addressing.EndpointReferenceType;
 
-@NoJSR250Annotations(unlessNull = "bus")
+@NoJSR250Annotations
 public class NettyHttpConduitFactory implements BusLifeCycleListener, HTTPConduitFactory {
 
     boolean isShutdown;
@@ -39,24 +37,13 @@ public class NettyHttpConduitFactory imp
     public NettyHttpConduitFactory() {
     }
 
-    public NettyHttpConduitFactory(Bus b) {
-        this();
-        addListener(b);
-    }
-
-    @Resource
-    public void setBus(Bus b) {
-        addListener(b);
-    }
-
-    private void addListener(Bus b) {
-        b.getExtension(BusLifeCycleManager.class).registerLifeCycleListener(this);
-    }
-
     @Override
-    public HTTPConduit createConduit(HTTPTransportFactory f, EndpointInfo localInfo, EndpointReferenceType target)
+    public HTTPConduit createConduit(HTTPTransportFactory f, 
+                                     Bus bus, 
+                                     EndpointInfo localInfo,
+                                     EndpointReferenceType target)
         throws IOException {
-        return new NettyHttpConduit(f.getBus(), localInfo, target, this);
+        return new NettyHttpConduit(bus, localInfo, target, this);
     }
 
     @Override

Modified: cxf/trunk/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/NettyHttpDestinationTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/NettyHttpDestinationTest.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/NettyHttpDestinationTest.java (original)
+++ cxf/trunk/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/NettyHttpDestinationTest.java Tue Jun 25 18:07:10 2013
@@ -129,7 +129,9 @@ public class NettyHttpDestinationTest ex
     }
     @After
     public void tearDown() {
-       
+        if (bus != null) {
+            bus.shutdown(true);
+        }
         bus = null;
         transportFactory = null;
         decoupledBackChannel = null;
@@ -163,14 +165,14 @@ public class NettyHttpDestinationTest ex
     
     @Test
     public void testRandomPortAllocation() throws Exception {
+        bus = BusFactory.getDefaultBus();
         transportFactory = new HTTPTransportFactory();
-        transportFactory.setBus(BusFactory.getDefaultBus());
         ServiceInfo serviceInfo = new ServiceInfo();
         serviceInfo.setName(new QName("bla", "Service"));
         EndpointInfo ei = new EndpointInfo(serviceInfo, "");
         ei.setName(new QName("bla", "Port"));
         
-        Destination d1 = transportFactory.getDestination(ei);
+        Destination d1 = transportFactory.getDestination(ei, bus);
         URL url = new URL(d1.getAddress().getAddress().getValue());
         assertTrue("No random port has been allocated", 
                    url.getPort() > 0);
@@ -217,12 +219,11 @@ public class NettyHttpDestinationTest ex
             }
         };
         transportFactory = new HTTPTransportFactory();
-        transportFactory.setBus(new ExtensionManagerBus());
-        transportFactory.getBus().setExtension(
-            factory, NettyHttpServerEngineFactory.class);
+        bus = BusFactory.getDefaultBus();
+        bus.setExtension(factory, NettyHttpServerEngineFactory.class);
         
         TestJettyDestination testDestination = 
-            new TestJettyDestination(transportFactory.getBus(), 
+            new TestJettyDestination(bus, 
                                      transportFactory.getRegistry(), 
                                      ei,
                                      factory);
@@ -234,23 +235,23 @@ public class NettyHttpDestinationTest ex
     @Test
     public void testGetMultiple() throws Exception {
         transportFactory = new HTTPTransportFactory();
-        transportFactory.setBus(BusFactory.getDefaultBus(true));
+        bus = BusFactory.getDefaultBus();
         
         ServiceInfo serviceInfo = new ServiceInfo();
         serviceInfo.setName(new QName("bla", "Service"));        
         EndpointInfo ei = new EndpointInfo(serviceInfo, "");
         ei.setName(new QName("bla", "Port"));
         ei.setAddress("http://foo");
-        Destination d1 = transportFactory.getDestination(ei);
+        Destination d1 = transportFactory.getDestination(ei, bus);
         
-        Destination d2 = transportFactory.getDestination(ei);
+        Destination d2 = transportFactory.getDestination(ei, bus);
         
         // Second get should not generate a new destination. It should just retrieve the existing one
         assertEquals(d1, d2);
         
         d2.shutdown();
         
-        Destination d3 = transportFactory.getDestination(ei);
+        Destination d3 = transportFactory.getDestination(ei, bus);
         // Now a new destination should have been created
         assertNotSame(d1, d3);
     }
@@ -392,7 +393,6 @@ public class NettyHttpDestinationTest ex
         bus = new ExtensionManagerBus();
         
         transportFactory = new HTTPTransportFactory();
-        transportFactory.setBus(bus);
         
         ServiceInfo serviceInfo = new ServiceInfo();
         serviceInfo.setName(new QName("bla", "Service"));        
@@ -489,11 +489,11 @@ public class NettyHttpDestinationTest ex
         transportFactory = new HTTPTransportFactory();
 
         final ConduitInitiator ci = new ConduitInitiator() {
-            public Conduit getConduit(EndpointInfo targetInfo) throws IOException {
+            public Conduit getConduit(EndpointInfo targetInfo, Bus b) throws IOException {
                 return decoupledBackChannel;
             }
 
-            public Conduit getConduit(EndpointInfo localInfo, EndpointReferenceType target)
+            public Conduit getConduit(EndpointInfo localInfo, EndpointReferenceType target, Bus b)
                 throws IOException {
                 return decoupledBackChannel;
             }

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduitFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduitFactory.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduitFactory.java (original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduitFactory.java Tue Jun 25 18:07:10 2013
@@ -20,6 +20,7 @@ package org.apache.cxf.transport.http;
 
 import java.io.IOException;
 
+import org.apache.cxf.Bus;
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.ws.addressing.EndpointReferenceType;
 
@@ -31,6 +32,7 @@ public interface HTTPConduitFactory {
     
     
     HTTPConduit createConduit(HTTPTransportFactory f,
+                              Bus b,
                               EndpointInfo localInfo,
                               EndpointReferenceType target) throws IOException;
 }
\ No newline at end of file

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPTransportFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPTransportFactory.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPTransportFactory.java (original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPTransportFactory.java Tue Jun 25 18:07:10 2013
@@ -30,8 +30,6 @@ import java.util.Set;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
-import javax.annotation.Resource;
-
 import org.apache.cxf.Bus;
 import org.apache.cxf.common.injection.NoJSR250Annotations;
 import org.apache.cxf.common.logging.LogUtils;
@@ -52,7 +50,7 @@ import org.apache.cxf.wsdl.http.AddressT
 /**
  *
  */
-@NoJSR250Annotations(unlessNull = "bus")
+@NoJSR250Annotations
 public class HTTPTransportFactory 
     extends AbstractTransportFactory 
     implements ConduitInitiator, DestinationFactory {
@@ -82,32 +80,13 @@ public class HTTPTransportFactory 
     public HTTPTransportFactory() {
         this(new DestinationRegistryImpl());
     }
-    public HTTPTransportFactory(Bus b) {
-        this(b, null);
-    }
-    public HTTPTransportFactory(Bus b, DestinationRegistry registry) {
-        super(DEFAULT_NAMESPACES, null);
-        if (registry == null && b != null) {
-            registry = b.getExtension(DestinationRegistry.class);
-        }
+    public HTTPTransportFactory(DestinationRegistry registry) {
+        super(DEFAULT_NAMESPACES);
         if (registry == null) {
             registry = new DestinationRegistryImpl();
         }
         this.registry = registry;
-        bus = b;
-        register();
     }
-
-    public HTTPTransportFactory(DestinationRegistry registry) {
-        super(DEFAULT_NAMESPACES);
-        this.registry = registry;
-    }
-    
-    @Resource 
-    public void setBus(Bus b) {
-        super.setBus(b);
-    }
-
     public DestinationRegistry getRegistry() {
         return registry;
     }
@@ -164,11 +143,11 @@ public class HTTPTransportFactory 
      * 
      * @param bean
      */
-    protected void configure(Object bean) {
-        configure(bean, null, null);
+    protected void configure(Bus b, Object bean) {
+        configure(b, bean, null, null);
     }
     
-    protected void configure(Object bean, String name, String extraName) {
+    protected void configure(Bus bus, Object bean, String name, String extraName) {
         Configurer configurer = bus.getExtension(Configurer.class);
         if (null != configurer) {
             configurer.configureBean(name, bean);
@@ -202,8 +181,8 @@ public class HTTPTransportFactory 
      * This call creates a new HTTPConduit for the endpoint. It is equivalent
      * to calling getConduit without an EndpointReferenceType.
      */
-    public Conduit getConduit(EndpointInfo endpointInfo) throws IOException {
-        return getConduit(endpointInfo, endpointInfo.getTarget());
+    public Conduit getConduit(EndpointInfo endpointInfo, Bus bus) throws IOException {
+        return getConduit(endpointInfo, endpointInfo.getTarget(), bus);
     }
 
     /**
@@ -214,13 +193,14 @@ public class HTTPTransportFactory 
      */
     public Conduit getConduit(
             EndpointInfo endpointInfo,
-            EndpointReferenceType target
+            EndpointReferenceType target,
+            Bus bus
     ) throws IOException {
         
-        HTTPConduitFactory factory = findFactory(endpointInfo);
+        HTTPConduitFactory factory = findFactory(endpointInfo, bus);
         HTTPConduit conduit = null;
         if (factory != null) {
-            conduit = factory.createConduit(this, endpointInfo, target);
+            conduit = factory.createConduit(this, bus, endpointInfo, target);
         }
         if (conduit == null) {
             conduit = new URLConnectionHTTPConduit(bus, endpointInfo, target);
@@ -235,19 +215,19 @@ public class HTTPTransportFactory 
         if (c1 != null) {
             c1.configure(conduit.getBeanName(), address, conduit);
         }
-        configure(conduit, conduit.getBeanName(), address);
+        configure(bus, conduit, conduit.getBeanName(), address);
         conduit.finalizeConfig();
         return conduit;
     }
     
-    protected HTTPConduitFactory findFactory(EndpointInfo endpointInfo) {
+    protected HTTPConduitFactory findFactory(EndpointInfo endpointInfo, Bus bus) {
         HTTPConduitFactory f = endpointInfo.getProperty(HTTPConduitFactory.class.getName(), HTTPConduitFactory.class);
         if (f == null) {
             f = bus.getExtension(HTTPConduitFactory.class);
         }
         return f;
     }
-    public Destination getDestination(EndpointInfo endpointInfo) throws IOException {
+    public Destination getDestination(EndpointInfo endpointInfo, Bus bus) throws IOException {
         if (endpointInfo == null) {
             throw new IllegalArgumentException("EndpointInfo cannot be null");
         }
@@ -270,9 +250,9 @@ public class HTTPTransportFactory 
                     factory = new ServletDestinationFactory();
                 }
                 
-                d = factory.createDestination(endpointInfo, getBus(), registry);
+                d = factory.createDestination(endpointInfo, bus, registry);
                 registry.addDestination(d);
-                configure(d);
+                configure(bus, d);
                 d.finalizeConfig();
             }
             return d;

Modified: cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HTTPTransportFactoryTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HTTPTransportFactoryTest.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HTTPTransportFactoryTest.java (original)
+++ cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HTTPTransportFactoryTest.java Tue Jun 25 18:07:10 2013
@@ -36,7 +36,7 @@ public class HTTPTransportFactoryTest ex
         HTTPTransportFactory factory = bus.getExtension(HTTPTransportFactory.class);
         if (factory != null) {
             try {
-                factory.getDestination(ei);
+                factory.getDestination(ei, bus);
                 fail("Expect exception here.");
             } catch (IOException ex) {
                 assertTrue("We should find some exception related to the HttpDestination"

Modified: cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/spring/HttpConduitConfigurationTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/spring/HttpConduitConfigurationTest.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/spring/HttpConduitConfigurationTest.java (original)
+++ cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/spring/HttpConduitConfigurationTest.java Tue Jun 25 18:07:10 2013
@@ -69,8 +69,8 @@ public class HttpConduitConfigurationTes
     public void testConduitBean() throws Exception {
         SpringBusFactory factory = new SpringBusFactory();
         bus = factory.createBus("org/apache/cxf/transport/http/spring/conduit-bean.xml");
-        HTTPTransportFactory atf = new HTTPTransportFactory(bus);
-        HTTPConduit conduit = (HTTPConduit)atf.getConduit(ei);
+        HTTPTransportFactory atf = new HTTPTransportFactory();
+        HTTPConduit conduit = (HTTPConduit)atf.getConduit(ei, bus);
         
         verifyConduit(conduit);
     }
@@ -79,8 +79,8 @@ public class HttpConduitConfigurationTes
     public void testConduitBeanWithTLSReferences() throws Exception {
         SpringBusFactory factory = new SpringBusFactory();
         bus = factory.createBus("org/apache/cxf/transport/http/spring/conduit-tlsrefs-bean.xml");
-        HTTPTransportFactory atf = new HTTPTransportFactory(bus);
-        HTTPConduit conduit = (HTTPConduit)atf.getConduit(ei);
+        HTTPTransportFactory atf = new HTTPTransportFactory();
+        HTTPConduit conduit = (HTTPConduit)atf.getConduit(ei, bus);
 
         verifyConduit(conduit);
     }

Modified: cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSTransportFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSTransportFactory.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSTransportFactory.java (original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSTransportFactory.java Tue Jun 25 18:07:10 2013
@@ -26,8 +26,6 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
-import javax.annotation.Resource;
-
 import org.apache.cxf.Bus;
 import org.apache.cxf.common.injection.NoJSR250Annotations;
 import org.apache.cxf.service.model.EndpointInfo;
@@ -38,7 +36,7 @@ import org.apache.cxf.transport.Destinat
 import org.apache.cxf.transport.DestinationFactory;
 import org.apache.cxf.ws.addressing.EndpointReferenceType;
 
-@NoJSR250Annotations(unlessNull = { "bus" })
+@NoJSR250Annotations
 public class JMSTransportFactory extends AbstractTransportFactory implements ConduitInitiator,
     DestinationFactory {
 
@@ -58,23 +56,15 @@ public class JMSTransportFactory extends
     public JMSTransportFactory() {
         super(DEFAULT_NAMESPACES);
     }
-    public JMSTransportFactory(Bus b) {
-        super(DEFAULT_NAMESPACES, b);
-    }
     
-    @Resource(name = "cxf")
-    public void setBus(Bus bus) {
-        super.setBus(bus);
-    }
-
-    public Conduit getConduit(EndpointInfo endpointInfo) throws IOException {
-        return getConduit(endpointInfo, endpointInfo.getTarget());
+    public Conduit getConduit(EndpointInfo endpointInfo, Bus b) throws IOException {
+        return getConduit(endpointInfo, endpointInfo.getTarget(), b);
     }
 
     /**
      * {@inheritDoc}
      */
-    public Conduit getConduit(EndpointInfo endpointInfo, EndpointReferenceType target) throws IOException {
+    public Conduit getConduit(EndpointInfo endpointInfo, EndpointReferenceType target, Bus bus) throws IOException {
         JMSOldConfigHolder old = new JMSOldConfigHolder();
         JMSConfiguration jmsConf = old.createJMSConfigurationFromEndpointInfo(bus,
                                                                               endpointInfo,
@@ -86,7 +76,7 @@ public class JMSTransportFactory extends
     /**
      * {@inheritDoc}
      */
-    public Destination getDestination(EndpointInfo endpointInfo) throws IOException {
+    public Destination getDestination(EndpointInfo endpointInfo, Bus bus) throws IOException {
         JMSOldConfigHolder old = new JMSOldConfigHolder();
         JMSConfiguration jmsConf = old.createJMSConfigurationFromEndpointInfo(bus, endpointInfo, null, false);
         return new JMSDestination(bus, endpointInfo, jmsConf);

Modified: cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java (original)
+++ cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java Tue Jun 25 18:07:10 2013
@@ -27,6 +27,7 @@ import java.io.PipedOutputStream;
 import java.util.concurrent.Executor;
 import java.util.logging.Logger;
 
+import org.apache.cxf.Bus;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.io.AbstractWrappedOutputStream;
 import org.apache.cxf.io.CachedOutputStream;
@@ -115,13 +116,12 @@ public class LocalConduit extends Abstra
     private void dispatchViaPipe(final Message message) throws IOException {
         final LocalConduit conduit = this;
         final Exchange exchange = message.getExchange();
-        
+
         if (destination.getMessageObserver() == null) {
             throw new IllegalStateException("Local destination does not have a MessageObserver on address " 
                                             + destination.getAddress().getAddress().getValue());
         }
         
-        
         AbstractWrappedOutputStream cout 
             = new AbstractWrappedOutputStream() {
                 protected void onFirstWrite() throws IOException {
@@ -138,7 +138,9 @@ public class LocalConduit extends Abstra
                     final Runnable receiver = new Runnable() {
                         public void run() {                            
                             ExchangeImpl ex = new ExchangeImpl();
+                            ex.put(Bus.class, destination.getBus());
                             ex.setInMessage(inMsg);
+                            inMsg.setExchange(ex);
                             ex.put(IN_EXCHANGE, exchange);
                             destination.getMessageObserver().onMessage(inMsg);
                         }
@@ -146,7 +148,7 @@ public class LocalConduit extends Abstra
                     Executor ex = message.getExchange() != null
                         ? message.getExchange().get(Executor.class) : null;
                     if (ex == null || SynchronousExecutor.isA(ex)) {
-                        ex = transportFactory.getExecutor();
+                        ex = transportFactory.getExecutor(destination.getBus());
                         if (ex != null) {
                             ex.execute(receiver);
                         } else {

Modified: cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java?rev=1496566&r1=1496565&r2=1496566&view=diff
==============================================================================
--- cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java (original)
+++ cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java Tue Jun 25 18:07:10 2013
@@ -27,6 +27,7 @@ import java.io.PipedOutputStream;
 import java.util.concurrent.Executor;
 import java.util.logging.Logger;
 
+import org.apache.cxf.Bus;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.io.AbstractWrappedOutputStream;
 import org.apache.cxf.io.CachedOutputStream;
@@ -46,15 +47,20 @@ public class LocalDestination extends Ab
 
     private LocalTransportFactory localDestinationFactory;
 
-    public LocalDestination(LocalTransportFactory localDestinationFactory, EndpointReferenceType epr,
-                            EndpointInfo ei) {
-        super(epr, ei);
+    public LocalDestination(LocalTransportFactory localDestinationFactory,
+                            EndpointReferenceType epr,
+                            EndpointInfo ei,
+                            Bus bus) {
+        super(bus, epr, ei);
         this.localDestinationFactory = localDestinationFactory;
     }
 
     public void shutdown() {
         localDestinationFactory.remove(this);
     }
+    public Bus getBus() {
+        return bus;
+    }
 
     protected Logger getLogger() {
         return LOG;
@@ -103,7 +109,11 @@ public class LocalDestination extends Ab
                                 ? message.getExchange().get(Executor.class) : null;
                             // Need to avoid to get the SynchronousExecutor
                             if (ex == null || SynchronousExecutor.isA(ex)) {
-                                ex = localDestinationFactory.getExecutor();
+                                if (exchange == null) {
+                                    ex = localDestinationFactory.getExecutor(bus);
+                                } else {
+                                    ex = localDestinationFactory.getExecutor(exchange.getBus());
+                                }
                                 if (ex != null) {
                                     ex.execute(receiver);
                                 } else {



Mime
View raw message