cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1154627 - in /cxf/branches/2.4.x-fixes: ./ rt/bindings/coloc/src/main/java/org/apache/cxf/binding/coloc/ rt/bindings/coloc/src/test/java/org/apache/cxf/binding/coloc/ rt/bindings/jbi/src/test/java/org/apache/cxf/binding/jbi/interceptor/ rt...
Date Sun, 07 Aug 2011 00:14:43 GMT
Author: ema
Date: Sun Aug  7 00:14:42 2011
New Revision: 1154627

URL: http://svn.apache.org/viewvc?rev=1154627&view=rev
Log:
Merged revisions 1154466 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1154466 | ema | 2011-08-06 16:54:43 +0800 (Sat, 06 Aug 2011) | 1 line
  
  [CXF-3716]:Move bus.getExtension(ClassLoader.class) to the constructor
........

Modified:
    cxf/branches/2.4.x-fixes/   (props changed)
    cxf/branches/2.4.x-fixes/rt/bindings/coloc/src/main/java/org/apache/cxf/binding/coloc/ColocMessageObserver.java
    cxf/branches/2.4.x-fixes/rt/bindings/coloc/src/test/java/org/apache/cxf/binding/coloc/ColocMessageObserverTest.java
    cxf/branches/2.4.x-fixes/rt/bindings/jbi/src/test/java/org/apache/cxf/binding/jbi/interceptor/JBIOperationInInterceptorTest.java
    cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractFaultChainInitiatorObserver.java
    cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/ChainInitiationObserver.java
    cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientMessageObserver.java
    cxf/branches/2.4.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java
    cxf/branches/2.4.x-fixes/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestinationTest.java
    cxf/branches/2.4.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFNonSpringServlet.java
    cxf/branches/2.4.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
    cxf/branches/2.4.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/JMSContinuation.java

Propchange: cxf/branches/2.4.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Aug  7 00:14:42 2011
@@ -1 +1 @@
-/cxf/trunk:1154143,1154149,1154158,1154229,1154232
+/cxf/trunk:1154143,1154149,1154158,1154229,1154232,1154466

Propchange: cxf/branches/2.4.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.4.x-fixes/rt/bindings/coloc/src/main/java/org/apache/cxf/binding/coloc/ColocMessageObserver.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/bindings/coloc/src/main/java/org/apache/cxf/binding/coloc/ColocMessageObserver.java?rev=1154627&r1=1154626&r2=1154627&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/bindings/coloc/src/main/java/org/apache/cxf/binding/coloc/ColocMessageObserver.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/bindings/coloc/src/main/java/org/apache/cxf/binding/coloc/ColocMessageObserver.java
Sun Aug  7 00:14:42 2011
@@ -51,16 +51,16 @@ import org.apache.cxf.transport.ChainIni
 public class ColocMessageObserver extends ChainInitiationObserver {
     private static final Logger LOG = LogUtils.getL7dLogger(ColocMessageObserver.class);
     private static final String COLOCATED = Message.class.getName() + ".COLOCATED";
-
+    private ClassLoader loader;
     public ColocMessageObserver(Endpoint endpoint, Bus bus) {
         super(endpoint, bus);
+        loader = bus.getExtension(ClassLoader.class);
     }
 
     public void onMessage(Message m) {
         Bus origBus = BusFactory.getThreadDefaultBus(false);
         ClassLoader origLoader = Thread.currentThread().getContextClassLoader();
         try {
-            ClassLoader loader = bus.getExtension(ClassLoader.class);
             if (loader != null) {
                 Thread.currentThread().setContextClassLoader(loader);
             }

Modified: cxf/branches/2.4.x-fixes/rt/bindings/coloc/src/test/java/org/apache/cxf/binding/coloc/ColocMessageObserverTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/bindings/coloc/src/test/java/org/apache/cxf/binding/coloc/ColocMessageObserverTest.java?rev=1154627&r1=1154626&r2=1154627&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/bindings/coloc/src/test/java/org/apache/cxf/binding/coloc/ColocMessageObserverTest.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/bindings/coloc/src/test/java/org/apache/cxf/binding/coloc/ColocMessageObserverTest.java
Sun Aug  7 00:14:42 2011
@@ -77,10 +77,8 @@ public class ColocMessageObserverTest ex
 
     @Test
     public void testSetExchangeProperties() throws Exception {
-        observer = new ColocMessageObserver(ep, bus);
         QName opName = new QName("A", "B");
-        msg.put(Message.WSDL_OPERATION, opName);
-
+        msg.put(Message.WSDL_OPERATION, opName);    
         EasyMock.expect(ep.getService()).andReturn(srv);
         Binding binding = control.createMock(Binding.class);
         EasyMock.expect(ep.getBinding()).andReturn(binding);
@@ -91,8 +89,9 @@ public class ColocMessageObserverTest ex
         BindingOperationInfo boi = control.createMock(BindingOperationInfo.class);
         EasyMock.expect(bi.getOperation(opName)).andReturn(boi);
         EasyMock.expect(boi.getOperationInfo()).andReturn(oi);        
-
+        EasyMock.expect(bus.getExtension(ClassLoader.class)).andReturn(this.getClass().getClassLoader());
         control.replay();
+        observer = new ColocMessageObserver(ep, bus);
         observer.setExchangeProperties(ex, msg);
         control.verify();
 
@@ -112,7 +111,6 @@ public class ColocMessageObserverTest ex
 
     @Test
     public void testObserverOnMessage() throws Exception {
-        observer = new TestColocMessageObserver(ep, bus);
         msg.setExchange(ex);
         
         Binding binding = control.createMock(Binding.class);
@@ -131,8 +129,9 @@ public class ColocMessageObserverTest ex
         EasyMock.expect(bus.getInInterceptors()).andReturn(new ArrayList<Interceptor<?
extends Message>>());
         EasyMock.expect(ep.getInInterceptors()).andReturn(new ArrayList<Interceptor<?
extends Message>>());
         EasyMock.expect(srv.getInInterceptors()).andReturn(new ArrayList<Interceptor<?
extends Message>>());
-
+        EasyMock.expect(bus.getExtension(ClassLoader.class)).andReturn(this.getClass().getClassLoader());
         control.replay();
+        observer = new TestColocMessageObserver(ep, bus);
         observer.onMessage(msg);
         control.verify();
 

Modified: cxf/branches/2.4.x-fixes/rt/bindings/jbi/src/test/java/org/apache/cxf/binding/jbi/interceptor/JBIOperationInInterceptorTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/bindings/jbi/src/test/java/org/apache/cxf/binding/jbi/interceptor/JBIOperationInInterceptorTest.java?rev=1154627&r1=1154626&r2=1154627&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/bindings/jbi/src/test/java/org/apache/cxf/binding/jbi/interceptor/JBIOperationInInterceptorTest.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/bindings/jbi/src/test/java/org/apache/cxf/binding/jbi/interceptor/JBIOperationInInterceptorTest.java
Sun Aug  7 00:14:42 2011
@@ -25,6 +25,8 @@ import java.util.logging.Logger;
 import javax.jbi.messaging.MessageExchange;
 import javax.xml.namespace.QName;
 
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
 import org.apache.cxf.binding.jbi.JBIBindingInfo;
 import org.apache.cxf.binding.jbi.JBIConstants;
 import org.apache.cxf.binding.jbi.JBIMessage;
@@ -60,12 +62,16 @@ public class JBIOperationInInterceptorTe
         MessageExchange me = EasyMock.createMock(MessageExchange.class);
         EasyMock.expect(me.getOperation()).andReturn(new QName("urn:test", "SayHi")).times(4);
         EasyMock.replay(me);
+
         msg.put(MessageExchange.class, me);
         EndpointInfo endpointInfo = new EndpointInfo();
         endpointInfo.setBinding(new JBIBindingInfo(null, JBIConstants.NS_JBI_BINDING));
-        Endpoint ep = new EndpointImpl(null, null, endpointInfo);
+        Bus bus = BusFactory.getThreadDefaultBus();
+        bus.setExtension(this.getClass().getClassLoader(), ClassLoader.class);
+        Endpoint ep = new EndpointImpl(bus, null, endpointInfo);
         msg.setExchange(new ExchangeImpl());
         msg.getExchange().put(Endpoint.class, ep);
+
         try { 
             interceptor.handleMessage(msg);
             fail("shouldn't found SayHi operation");

Modified: cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractFaultChainInitiatorObserver.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractFaultChainInitiatorObserver.java?rev=1154627&r1=1154626&r2=1154627&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractFaultChainInitiatorObserver.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractFaultChainInitiatorObserver.java
Sun Aug  7 00:14:42 2011
@@ -41,9 +41,11 @@ public abstract class AbstractFaultChain
     private static final Logger LOG = LogUtils.getL7dLogger(AbstractFaultChainInitiatorObserver.class);
     
     private Bus bus;
+    private ClassLoader loader;
 
     public AbstractFaultChainInitiatorObserver(Bus bus) {
         this.bus = bus;
+        loader = bus.getExtension(ClassLoader.class);
     }
 
     public void onMessage(Message message) {
@@ -54,7 +56,6 @@ public abstract class AbstractFaultChain
         BusFactory.setThreadDefaultBus(bus);
         ClassLoader origLoader = Thread.currentThread().getContextClassLoader();
         try {
-            ClassLoader loader = bus.getExtension(ClassLoader.class);
             if (loader != null) {
                 Thread.currentThread().setContextClassLoader(loader);
             }

Modified: cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/ChainInitiationObserver.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/ChainInitiationObserver.java?rev=1154627&r1=1154626&r2=1154627&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/ChainInitiationObserver.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/ChainInitiationObserver.java
Sun Aug  7 00:14:42 2011
@@ -46,6 +46,7 @@ import org.apache.cxf.service.model.Endp
 public class ChainInitiationObserver implements MessageObserver {
     protected Endpoint endpoint;
     protected Bus bus;
+    protected ClassLoader loader;
     
     private PhaseChainCache chainCache = new PhaseChainCache();
 
@@ -53,6 +54,9 @@ public class ChainInitiationObserver imp
         super();
         this.endpoint = endpoint;
         this.bus = bus;
+        if (bus != null) {
+            loader = bus.getExtension(ClassLoader.class);
+        }
     }
 
     public void onMessage(Message m) {
@@ -60,7 +64,6 @@ public class ChainInitiationObserver imp
         BusFactory.setThreadDefaultBus(bus);
         ClassLoader origLoader = Thread.currentThread().getContextClassLoader();
         try {
-            ClassLoader loader = bus.getExtension(ClassLoader.class);
             if (loader != null) {
                 Thread.currentThread().setContextClassLoader(loader);
             }

Modified: cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientMessageObserver.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientMessageObserver.java?rev=1154627&r1=1154626&r2=1154627&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientMessageObserver.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientMessageObserver.java
Sun Aug  7 00:14:42 2011
@@ -27,10 +27,12 @@ import org.apache.cxf.transport.MessageO
 
 class ClientMessageObserver implements MessageObserver {
 
-    private ClientConfiguration cfg; 
+    private ClientConfiguration cfg;
+    private ClassLoader loader;
     
     public ClientMessageObserver(ClientConfiguration cfg) {
         this.cfg = cfg;
+        loader = cfg.getBus().getExtension(ClassLoader.class);
     }
     
     public void onMessage(Message m) {
@@ -45,7 +47,6 @@ class ClientMessageObserver implements M
         BusFactory.setThreadDefaultBus(cfg.getBus());
         ClassLoader origLoader = Thread.currentThread().getContextClassLoader();
         try {
-            ClassLoader loader = cfg.getBus().getExtension(ClassLoader.class);
             if (loader != null) {
                 Thread.currentThread().setContextClassLoader(loader);
             }

Modified: cxf/branches/2.4.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java?rev=1154627&r1=1154626&r2=1154627&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java
Sun Aug  7 00:14:42 2011
@@ -62,6 +62,7 @@ public class JettyHTTPDestination extend
     protected JettyHTTPServerEngineFactory serverEngineFactory;
     protected ServletContext servletContext;
     protected URL nurl;
+    protected ClassLoader loader;
     
     /**
      * This variable signifies that finalizeConfig() has been called.
@@ -90,6 +91,7 @@ public class JettyHTTPDestination extend
         super(bus, registry, ei, getAddressValue(ei, true).getAddress(), true);
         this.serverEngineFactory = serverEngineFactory;
         nurl = new URL(endpointInfo.getAddress());
+        loader = bus.getExtension(ClassLoader.class);
     }
 
     protected Logger getLogger() {
@@ -278,7 +280,6 @@ public class JettyHTTPDestination extend
         // REVISIT: service on executor if associated with endpoint
         ClassLoader origLoader = Thread.currentThread().getContextClassLoader();
         try {
-            ClassLoader loader = bus.getExtension(ClassLoader.class);
             if (loader != null) {
                 Thread.currentThread().setContextClassLoader(loader);
             }

Modified: cxf/branches/2.4.x-fixes/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestinationTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestinationTest.java?rev=1154627&r1=1154626&r2=1154627&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestinationTest.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestinationTest.java
Sun Aug  7 00:14:42 2011
@@ -571,8 +571,10 @@ public class JettyHTTPDestinationTest ex
             bus = EasyMock.createMock(Bus.class);
             bus.getExtension(EndpointResolverRegistry.class);
             EasyMock.expectLastCall().andReturn(null);
-            bus.getExtension(PolicyEngine.class);
+            bus.getExtension(PolicyEngine.class);          
             EasyMock.expectLastCall().andReturn(null);
+            bus.getExtension(ClassLoader.class);
+            EasyMock.expectLastCall().andReturn(this.getClass().getClassLoader());
             EasyMock.replay(bus);
         }
         

Modified: cxf/branches/2.4.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFNonSpringServlet.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFNonSpringServlet.java?rev=1154627&r1=1154626&r2=1154627&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFNonSpringServlet.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFNonSpringServlet.java
Sun Aug  7 00:14:42 2011
@@ -40,6 +40,7 @@ public class CXFNonSpringServlet extends
     private DestinationRegistry destinationRegistry;
     private Bus bus;
     private ServletController controller;
+    private ClassLoader loader;
     
     public CXFNonSpringServlet() {
     }
@@ -54,7 +55,7 @@ public class CXFNonSpringServlet extends
         if (this.bus == null) {
             loadBus(sc);
         }
-
+        loader = bus.getExtension(ClassLoader.class);
         ResourceManager resourceManager = bus.getExtension(ResourceManager.class);
         resourceManager.addResourceResolver(new ServletContextResourceResolver(
                                                sc.getServletContext()));
@@ -106,7 +107,6 @@ public class CXFNonSpringServlet extends
     protected void invoke(HttpServletRequest request, HttpServletResponse response) throws
ServletException {
         ClassLoader origLoader = Thread.currentThread().getContextClassLoader();
         try {
-            ClassLoader loader = bus.getExtension(ClassLoader.class);
             if (loader != null) {
                 Thread.currentThread().setContextClassLoader(loader);
             }

Modified: cxf/branches/2.4.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java?rev=1154627&r1=1154626&r2=1154627&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
Sun Aug  7 00:14:42 2011
@@ -81,6 +81,7 @@ public class JMSDestination extends Abst
     private AbstractMessageListenerContainer jmsListener;
     private Collection<JMSContinuation> continuations = 
         new ConcurrentLinkedQueue<JMSContinuation>();
+    private ClassLoader loader;
 
     public JMSDestination(Bus b, EndpointInfo info, JMSConfiguration jmsConfig) {
         super(b, getTargetReference(info, b), info);
@@ -88,6 +89,7 @@ public class JMSDestination extends Abst
         this.ei = info;
         this.jmsConfig = jmsConfig;
         info.setProperty(OneWayProcessorInterceptor.USE_ORIGINAL_THREAD, Boolean.TRUE);
+        loader = bus.getExtension(ClassLoader.class);
     }
 
     /**
@@ -183,7 +185,6 @@ public class JMSDestination extends Abst
     public void onMessage(javax.jms.Message message, Session session) {
         ClassLoader origLoader = Thread.currentThread().getContextClassLoader();
         try {
-            ClassLoader loader = bus.getExtension(ClassLoader.class);
             if (loader != null) {
                 Thread.currentThread().setContextClassLoader(loader);
             }

Modified: cxf/branches/2.4.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/JMSContinuation.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/JMSContinuation.java?rev=1154627&r1=1154626&r2=1154627&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/JMSContinuation.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/JMSContinuation.java
Sun Aug  7 00:14:42 2011
@@ -50,6 +50,7 @@ public class JMSContinuation implements 
     private volatile boolean isResumed;
     private volatile boolean isCanceled;
     private WorkQueue workQueue;
+    private ClassLoader loader;
     
     public JMSContinuation(Bus b, Message m, MessageObserver observer,
                            Collection<JMSContinuation> cList, 
@@ -70,6 +71,7 @@ public class JMSContinuation implements 
         } else {
             LOG.warning("ERROR_GETTING_WORK_QUEUE");
         }
+        loader = bus.getExtension(ClassLoader.class);
     }
     
     public Object getObject() {
@@ -110,7 +112,6 @@ public class JMSContinuation implements 
         ClassLoader origLoader = Thread.currentThread().getContextClassLoader();
         try {
             BusFactory.setThreadDefaultBus(bus);
-            ClassLoader loader = bus.getExtension(ClassLoader.class);
             if (loader != null) {
                 Thread.currentThread().setContextClassLoader(loader);
             }



Mime
View raw message