You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2014/06/04 17:11:04 UTC

[5/7] git commit: Fix some race conditions in the EndpointPolicyImpl

Fix some race conditions in the EndpointPolicyImpl

Conflicts:
	rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java


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

Branch: refs/heads/2.7.x-fixes
Commit: 5eea93321f5e6041df90ebf8f11ef055c112a31d
Parents: 6346140
Author: Daniel Kulp <dk...@apache.org>
Authored: Wed Jun 4 09:59:24 2014 -0400
Committer: Daniel Kulp <dk...@apache.org>
Committed: Wed Jun 4 10:54:13 2014 -0400

----------------------------------------------------------------------
 .../org/apache/cxf/ws/policy/EndpointPolicyImpl.java    | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/5eea9332/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java
----------------------------------------------------------------------
diff --git a/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java b/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java
index f9a6bf9..3f68e98 100644
--- a/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java
+++ b/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java
@@ -189,7 +189,11 @@ public class EndpointPolicyImpl implements EndpointPolicy {
         }
     }
     
-    void initializeVocabulary() {
+    synchronized void initializeVocabulary() {
+        if (vocabulary != null) {
+            return;
+        }
+
         vocabulary = new ArrayList<Assertion>();
         if (requestor) {
             faultVocabulary = new ArrayList<Assertion>();
@@ -269,7 +273,11 @@ public class EndpointPolicyImpl implements EndpointPolicy {
         }
     }
 
-    void initializeInterceptors() {
+    synchronized void initializeInterceptors() {
+        if (interceptors != null) {
+            return;
+        }
+
         if (engine == null || engine.getBus() == null
             || engine.getBus().getExtension(PolicyInterceptorProviderRegistry.class) == null) {
             return;