Repository: cxf Updated Branches: refs/heads/master 037da2d96 -> 82606afa2
Minor optimisation Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/82606afa Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/82606afa Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/82606afa Branch: refs/heads/master Commit: 82606afa235a9b50544017ac91028093c92788a9 Parents: 037da2d Author: Colm O hEigeartaigh <[email protected]> Authored: Wed Jun 4 16:53:01 2014 +0100 Committer: Colm O hEigeartaigh <[email protected]> Committed: Wed Jun 4 16:53:01 2014 +0100 ---------------------------------------------------------------------- .../wss4j/AbstractWSS4JStaxInterceptor.java | 23 +++++++++++++------- .../PolicyBasedWSS4JStaxOutInterceptor.java | 1 - 2 files changed, 15 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/82606afa/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractWSS4JStaxInterceptor.java ---------------------------------------------------------------------- diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractWSS4JStaxInterceptor.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractWSS4JStaxInterceptor.java index 630e8dc..bc54fed 100644 --- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractWSS4JStaxInterceptor.java +++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractWSS4JStaxInterceptor.java @@ -24,6 +24,7 @@ import java.net.URI; import java.net.URL; import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.HashSet; import java.util.Map; import java.util.Properties; @@ -81,9 +82,9 @@ public abstract class AbstractWSS4JStaxInterceptor implements SoapInterceptor, private static final Logger LOG = LogUtils.getL7dLogger(AbstractWSS4JStaxInterceptor.class); - private Map<String, Object> properties = new ConcurrentHashMap<String, Object>(); + private final Map<String, Object> properties; + private final WSSSecurityProperties userSecurityProperties; private Map<String, Crypto> cryptos = new ConcurrentHashMap<String, Crypto>(); - private WSSSecurityProperties userSecurityProperties; private final Set<String> before = new HashSet<String>(); private final Set<String> after = new HashSet<String>(); private String phase; @@ -93,17 +94,21 @@ public abstract class AbstractWSS4JStaxInterceptor implements SoapInterceptor, super(); id = getClass().getName(); userSecurityProperties = securityProperties; + properties = null; } public AbstractWSS4JStaxInterceptor(Map<String, Object> properties) { super(); id = getClass().getName(); this.properties = properties; + userSecurityProperties = null; } public AbstractWSS4JStaxInterceptor() { super(); id = getClass().getName(); + userSecurityProperties = null; + properties = null; } protected WSSSecurityProperties createSecurityProperties() { @@ -261,13 +266,12 @@ public abstract class AbstractWSS4JStaxInterceptor implements SoapInterceptor, } public Object getOption(String key) { - return properties.get(key); + if (properties != null) { + return properties.get(key); + } + return null; } - public void setProperty(String key, String value) { - properties.put(key, value); - } - public String getPassword(Object msgContext) { return (String)((Message)msgContext).getContextualProperty("password"); } @@ -301,7 +305,10 @@ public abstract class AbstractWSS4JStaxInterceptor implements SoapInterceptor, } public Map<String, Object> getProperties() { - return properties; + if (properties != null) { + return properties; + } + return Collections.emptyMap(); } public Set<String> getAfter() { http://git-wip-us.apache.org/repos/asf/cxf/blob/82606afa/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JStaxOutInterceptor.java ---------------------------------------------------------------------- diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JStaxOutInterceptor.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JStaxOutInterceptor.java index f5093c4..eedf4f4 100644 --- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JStaxOutInterceptor.java +++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JStaxOutInterceptor.java @@ -49,7 +49,6 @@ public class PolicyBasedWSS4JStaxOutInterceptor extends WSS4JStaxOutInterceptor boolean enableStax = MessageUtils.isTrue(msg.getContextualProperty(SecurityConstants.ENABLE_STREAMING_SECURITY)); if (aim != null && enableStax) { - getProperties().clear(); super.handleMessage(msg); } }
