From 0265a5528be30279a9f64b16c245803d4243ca6f Mon Sep 17 00:00:00 2001 From: Hugo Trippaers Date: Wed, 15 Mar 2017 08:47:13 +0100 Subject: [PATCH] CXF-7285 Open up InvocationContext for subclasses of FailoverTargetSelector --- .../clustering/FailoverTargetSelector.java | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) 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 cf8d7919927..de8abf1638d 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 @@ -432,6 +432,10 @@ public void setClientBootstrapAddress(String clientBootstrapAddress) { this.clientBootstrapAddress = clientBootstrapAddress; } + 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 @@ -441,7 +445,7 @@ public void setClientBootstrapAddress(String clientBootstrapAddress) { protected static class InvocationKey { private Exchange exchange; - InvocationKey(Exchange ex) { + protected InvocationKey(Exchange ex) { exchange = ex; } @@ -469,8 +473,7 @@ protected class InvocationContext { private Map context; private List alternateEndpoints; private List alternateAddresses; - - InvocationContext(Endpoint endpoint, + protected InvocationContext(Endpoint endpoint, BindingOperationInfo boi, Object[] prms, Map ctx) { @@ -481,7 +484,7 @@ protected class InvocationContext { context = ctx; } - Endpoint retrieveOriginalEndpoint(Endpoint endpoint) { + public Endpoint retrieveOriginalEndpoint(Endpoint endpoint) { if (endpoint != null) { if (endpoint != originalEndpoint) { getLogger().log(Level.INFO, @@ -498,35 +501,35 @@ Endpoint retrieveOriginalEndpoint(Endpoint endpoint) { return originalEndpoint; } - BindingOperationInfo getBindingOperationInfo() { + public BindingOperationInfo getBindingOperationInfo() { return bindingOperationInfo; } - Object[] getParams() { + public Object[] getParams() { return params; } - Map getContext() { + public Map getContext() { return context; } - List getAlternateEndpoints() { + public List getAlternateEndpoints() { return alternateEndpoints; } - List getAlternateAddresses() { + public List getAlternateAddresses() { return alternateAddresses; } - void setAlternateEndpoints(List alternates) { + protected void setAlternateEndpoints(List alternates) { alternateEndpoints = alternates; } - void setAlternateAddresses(List alternates) { + protected void setAlternateAddresses(List alternates) { alternateAddresses = alternates; } - boolean hasAlternates() { + public boolean hasAlternates() { return !(alternateEndpoints == null && alternateAddresses == null); } }