Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 80a5fea83 -> 5321861b2


[CXF-7285] Open up InvocationContext for subclasses of FailoverTargetSelector, 
patch from Hugo Trippaers applied, This closes #245


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/5321861b
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/5321861b
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/5321861b

Branch: refs/heads/3.0.x-fixes
Commit: 5321861b2bad0b6641f7f0256e48e65af8297a9d
Parents: 80a5fea
Author: Sergey Beryozkin <[email protected]>
Authored: Wed Mar 15 12:37:27 2017 +0000
Committer: Sergey Beryozkin <[email protected]>
Committed: Wed Mar 15 12:58:02 2017 +0000

----------------------------------------------------------------------
 .../cxf/clustering/FailoverTargetSelector.java  | 39 +++++++++++---------
 1 file changed, 22 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/5321861b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/FailoverTargetSelector.java
----------------------------------------------------------------------
diff --git 
a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/FailoverTargetSelector.java
 
b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/FailoverTargetSelector.java
index 61fce66..4a590c1 100644
--- 
a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/FailoverTargetSelector.java
+++ 
b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/FailoverTargetSelector.java
@@ -392,6 +392,11 @@ public class FailoverTargetSelector extends 
AbstractConduitSelector {
         this.supportNotAvailableErrorsOnly = support;
     }
 
+
+    protected InvocationKey getInvocationKey(Exchange e) {
+        return new InvocationKey(e);
+    }
+
     /**
      * Used to wrap an Exchange for usage as a Map key. The raw Exchange
      * is not a suitable key type, as the hashCode is computed from its
@@ -400,9 +405,9 @@ public class FailoverTargetSelector extends 
AbstractConduitSelector {
      */
     protected static class InvocationKey {
         private Exchange exchange;
-        
-        InvocationKey(Exchange ex) {
-            exchange = ex;     
+
+        protected InvocationKey(Exchange ex) {
+            exchange = ex;
         }
         
         @Override
@@ -429,7 +434,7 @@ public class FailoverTargetSelector extends 
AbstractConduitSelector {
         private Map<String, Object> context;
         private List<Endpoint> alternateEndpoints;
         private List<String> alternateAddresses;
-        
+
         InvocationContext(Endpoint endpoint,
                           BindingOperationInfo boi,
                           Object[] prms, 
@@ -441,7 +446,7 @@ public class FailoverTargetSelector extends 
AbstractConduitSelector {
             context = ctx;
         }
 
-        Endpoint retrieveOriginalEndpoint(Endpoint endpoint) {
+        public Endpoint retrieveOriginalEndpoint(Endpoint endpoint) {
             if (endpoint != null) {
                 if (endpoint != originalEndpoint) {
                     getLogger().log(Level.INFO,
@@ -457,36 +462,36 @@ public class FailoverTargetSelector extends 
AbstractConduitSelector {
             }
             return originalEndpoint;
         }
-        
-        BindingOperationInfo getBindingOperationInfo() {
+
+        public BindingOperationInfo getBindingOperationInfo() {
             return bindingOperationInfo;
         }
-        
-        Object[] getParams() {
+
+        public Object[] getParams() {
             return params;
         }
-        
-        Map<String, Object> getContext() {
+
+        public Map<String, Object> getContext() {
             return context;
         }
-        
-        List<Endpoint> getAlternateEndpoints() {
+
+        public List<Endpoint> getAlternateEndpoints() {
             return alternateEndpoints;
         }
 
-        List<String> getAlternateAddresses() {
+        public List<String> getAlternateAddresses() {
             return alternateAddresses;
         }
 
-        void setAlternateEndpoints(List<Endpoint> alternates) {
+        protected void setAlternateEndpoints(List<Endpoint> alternates) {
             alternateEndpoints = alternates;
         }
 
-        void setAlternateAddresses(List<String> alternates) {
+        protected void setAlternateAddresses(List<String> alternates) {
             alternateAddresses = alternates;
         }
 
-        boolean hasAlternates() {
+        public boolean hasAlternates() {
             return !(alternateEndpoints == null && alternateAddresses == null);
         }
     }    

Reply via email to