cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1441034 - in /cxf/trunk/rt: features/clustering/src/main/java/org/apache/cxf/clustering/FailoverTargetSelector.java frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientConfiguration.java
Date Thu, 31 Jan 2013 16:03:18 GMT
Author: sergeyb
Date: Thu Jan 31 16:03:18 2013
New Revision: 1441034

URL: http://svn.apache.org/viewvc?rev=1441034&view=rev
Log:
[CXF-4796] Minor updates to protect against NPE when conduit is accessed on JAX-RS ClientConfiguration
in the failover mode

Modified:
    cxf/trunk/rt/features/clustering/src/main/java/org/apache/cxf/clustering/FailoverTargetSelector.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientConfiguration.java

Modified: cxf/trunk/rt/features/clustering/src/main/java/org/apache/cxf/clustering/FailoverTargetSelector.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/features/clustering/src/main/java/org/apache/cxf/clustering/FailoverTargetSelector.java?rev=1441034&r1=1441033&r2=1441034&view=diff
==============================================================================
--- cxf/trunk/rt/features/clustering/src/main/java/org/apache/cxf/clustering/FailoverTargetSelector.java
(original)
+++ cxf/trunk/rt/features/clustering/src/main/java/org/apache/cxf/clustering/FailoverTargetSelector.java
Thu Jan 31 16:03:18 2013
@@ -74,6 +74,9 @@ public class FailoverTargetSelector exte
      * @param message the current Message
      */
     public void prepare(Message message) {
+        if (message.getContent(List.class) == null) {
+            return;
+        }
         Exchange exchange = message.getExchange();
         InvocationKey key = new InvocationKey(exchange);
         if (!inProgress.containsKey(key)) {

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientConfiguration.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientConfiguration.java?rev=1441034&r1=1441033&r2=1441034&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientConfiguration.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientConfiguration.java
Thu Jan 31 16:03:18 2013
@@ -28,6 +28,7 @@ import org.apache.cxf.common.logging.Log
 import org.apache.cxf.common.util.ModCountCopyOnWriteArrayList;
 import org.apache.cxf.endpoint.ConduitSelector;
 import org.apache.cxf.endpoint.ConduitSelectorHolder;
+import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.interceptor.Interceptor;
 import org.apache.cxf.interceptor.InterceptorProvider;
@@ -194,6 +195,9 @@ public class ClientConfiguration impleme
         Exchange exchange = new ExchangeImpl();
         message.setExchange(exchange);
         exchange.put(MessageObserver.class, new ClientMessageObserver(this));
+        if (conduitSelector != null) {
+            exchange.put(Endpoint.class, conduitSelector.getEndpoint());
+        }
         exchange.put(Bus.class, bus);
         prepareConduitSelector(message);
         return getConduitSelector().selectConduit(message);



Mime
View raw message