You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by as...@apache.org on 2016/01/27 14:08:20 UTC
[1/3] cxf git commit: [CXF-6738] Replace synchronized blocks with DCL
to reduce contention
Repository: cxf
Updated Branches:
refs/heads/3.1.x-fixes 48aa8e93e -> e7a75b695
[CXF-6738] Replace synchronized blocks with DCL to reduce contention
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/0384a69b
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/0384a69b
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/0384a69b
Branch: refs/heads/3.1.x-fixes
Commit: 0384a69b7bc0b4846e89469f974ace534e7734d7
Parents: 48aa8e9
Author: Alessio Soldano <as...@redhat.com>
Authored: Thu Jan 7 22:51:53 2016 +0100
Committer: Alessio Soldano <as...@redhat.com>
Committed: Wed Jan 27 13:58:56 2016 +0100
----------------------------------------------------------------------
.../apache/cxf/ws/policy/PolicyEngineImpl.java | 158 +++++++++++--------
1 file changed, 91 insertions(+), 67 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/0384a69b/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
----------------------------------------------------------------------
diff --git a/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java b/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
index 511a26c..e3af4c9 100644
--- a/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
+++ b/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
@@ -194,19 +194,22 @@ public class PolicyEngineImpl implements PolicyEngine, BusExtension {
public EffectivePolicy getEffectiveClientRequestPolicy(EndpointInfo ei, BindingOperationInfo boi,
Conduit c, Message m) {
- synchronized (ei) {
- EffectivePolicy effectivePolicy = (EffectivePolicy)boi.getProperty(POLICY_INFO_REQUEST_CLIENT);
- if (null == effectivePolicy) {
- EffectivePolicyImpl epi = createOutPolicyInfo();
- Assertor assertor = PolicyUtils.createAsserter(c);
- if (m != null) {
- boi.setProperty(POLICY_INFO_REQUEST_CLIENT, epi);
+ EffectivePolicy effectivePolicy = (EffectivePolicy)boi.getProperty(POLICY_INFO_REQUEST_CLIENT);
+ if (effectivePolicy == null) {
+ synchronized (ei) {
+ effectivePolicy = (EffectivePolicy)boi.getProperty(POLICY_INFO_REQUEST_CLIENT);
+ if (null == effectivePolicy) {
+ EffectivePolicyImpl epi = createOutPolicyInfo();
+ Assertor assertor = PolicyUtils.createAsserter(c);
+ epi.initialise(ei, boi, this, assertor, true, true, m);
+ if (m != null) {
+ boi.setProperty(POLICY_INFO_REQUEST_CLIENT, epi);
+ }
+ effectivePolicy = epi;
}
- epi.initialise(ei, boi, this, assertor, true, true, m);
- effectivePolicy = epi;
}
- return effectivePolicy;
}
+ return effectivePolicy;
}
public void setEffectiveClientRequestPolicy(EndpointInfo ei, BindingOperationInfo boi,
@@ -220,19 +223,22 @@ public class PolicyEngineImpl implements PolicyEngine, BusExtension {
List<List<Assertion>> incoming,
Message m) {
if (incoming == null) {
- synchronized (ei) {
- EffectivePolicy effectivePolicy = (EffectivePolicy)boi.getProperty(POLICY_INFO_RESPONSE_SERVER);
- if (null == effectivePolicy) {
- EffectivePolicyImpl epi = createOutPolicyInfo();
- Assertor assertor = PolicyUtils.createAsserter(d);
- if (m != null) {
- boi.setProperty(POLICY_INFO_RESPONSE_SERVER, epi);
+ EffectivePolicy effectivePolicy = (EffectivePolicy)boi.getProperty(POLICY_INFO_RESPONSE_SERVER);
+ if (effectivePolicy == null) {
+ synchronized (ei) {
+ effectivePolicy = (EffectivePolicy)boi.getProperty(POLICY_INFO_RESPONSE_SERVER);
+ if (null == effectivePolicy) {
+ EffectivePolicyImpl epi = createOutPolicyInfo();
+ Assertor assertor = PolicyUtils.createAsserter(d);
+ epi.initialise(ei, boi, this, assertor, false, false, null);
+ if (m != null) {
+ boi.setProperty(POLICY_INFO_RESPONSE_SERVER, epi);
+ }
+ effectivePolicy = epi;
}
- epi.initialise(ei, boi, this, assertor, false, false, null);
- effectivePolicy = epi;
}
- return effectivePolicy;
- }
+ }
+ return effectivePolicy;
}
EffectivePolicyImpl epi = createOutPolicyInfo();
Assertor assertor = PolicyUtils.createAsserter(d);
@@ -258,19 +264,22 @@ public class PolicyEngineImpl implements PolicyEngine, BusExtension {
return epi;
}
bfi = mapToWrappedBindingFaultInfo(bfi);
- synchronized (ei) {
- EffectivePolicy effectivePolicy = (EffectivePolicy)bfi.getProperty(POLICY_INFO_FAULT_SERVER);
- if (null == effectivePolicy) {
- EffectivePolicyImpl epi = createOutPolicyInfo();
- Assertor assertor = PolicyUtils.createAsserter(d);
- if (m != null) {
- bfi.setProperty(POLICY_INFO_FAULT_SERVER, epi);
+ EffectivePolicy effectivePolicy = (EffectivePolicy)bfi.getProperty(POLICY_INFO_FAULT_SERVER);
+ if (effectivePolicy == null) {
+ synchronized (ei) {
+ effectivePolicy = (EffectivePolicy)bfi.getProperty(POLICY_INFO_FAULT_SERVER);
+ if (null == effectivePolicy) {
+ EffectivePolicyImpl epi = createOutPolicyInfo();
+ Assertor assertor = PolicyUtils.createAsserter(d);
+ epi.initialise(ei, boi, bfi, this, assertor, m);
+ if (m != null) {
+ bfi.setProperty(POLICY_INFO_FAULT_SERVER, epi);
+ }
+ effectivePolicy = epi;
}
- epi.initialise(ei, boi, bfi, this, assertor, m);
- effectivePolicy = epi;
}
- return effectivePolicy;
}
+ return effectivePolicy;
}
private BindingFaultInfo mapToWrappedBindingFaultInfo(BindingFaultInfo bfi) {
@@ -299,19 +308,23 @@ public class PolicyEngineImpl implements PolicyEngine, BusExtension {
return getEndpointPolicy(ei, false, assertor, m);
}
- private EndpointPolicy getEndpointPolicy(
+ private EndpointPolicy getEndpointPolicy(//NOPMD
EndpointInfo ei,
boolean isRequestor,
Assertor assertor,
Message m) {
- synchronized (ei) {
- EndpointPolicy ep = (EndpointPolicy)ei.getProperty(isRequestor ? POLICY_INFO_ENDPOINT_CLIENT
- : POLICY_INFO_ENDPOINT_SERVER);
- if (null != ep) {
- return ep;
+ EndpointPolicy ep = (EndpointPolicy)ei.getProperty(isRequestor
+ ? POLICY_INFO_ENDPOINT_CLIENT : POLICY_INFO_ENDPOINT_SERVER);
+ if (ep == null) {
+ synchronized (ei) {
+ ep = (EndpointPolicy)ei.getProperty(isRequestor
+ ? POLICY_INFO_ENDPOINT_CLIENT : POLICY_INFO_ENDPOINT_SERVER);
+ if (ep == null) {
+ ep = createEndpointPolicyInfo(ei, isRequestor, assertor, m);
+ }
}
- return createEndpointPolicyInfo(ei, isRequestor, assertor, m);
}
+ return ep;
}
public void setClientEndpointPolicy(EndpointInfo ei, EndpointPolicy ep) {
@@ -325,18 +338,21 @@ public class PolicyEngineImpl implements PolicyEngine, BusExtension {
public EffectivePolicy getEffectiveServerRequestPolicy(EndpointInfo ei,
BindingOperationInfo boi,
Message m) {
- synchronized (ei) {
- EffectivePolicy effectivePolicy = (EffectivePolicy)boi.getProperty(POLICY_INFO_REQUEST_SERVER);
- if (null == effectivePolicy) {
- EffectivePolicyImpl epi = createOutPolicyInfo();
- if (m != null) {
- boi.setProperty(POLICY_INFO_REQUEST_SERVER, epi);
+ EffectivePolicy effectivePolicy = (EffectivePolicy)boi.getProperty(POLICY_INFO_REQUEST_SERVER);
+ if (effectivePolicy == null) {
+ synchronized (ei) {
+ effectivePolicy = (EffectivePolicy)boi.getProperty(POLICY_INFO_REQUEST_SERVER);
+ if (null == effectivePolicy) {
+ EffectivePolicyImpl epi = createOutPolicyInfo();
+ epi.initialise(ei, boi, this, false, true, m);
+ if (m != null) {
+ boi.setProperty(POLICY_INFO_REQUEST_SERVER, epi);
+ }
+ effectivePolicy = epi;
}
- epi.initialise(ei, boi, this, false, true, m);
- effectivePolicy = epi;
}
- return effectivePolicy;
}
+ return effectivePolicy;
}
public void setEffectiveServerRequestPolicy(EndpointInfo ei, BindingOperationInfo boi,
@@ -347,18 +363,21 @@ public class PolicyEngineImpl implements PolicyEngine, BusExtension {
public EffectivePolicy getEffectiveClientResponsePolicy(EndpointInfo ei,
BindingOperationInfo boi,
Message m) {
- synchronized (ei) {
- EffectivePolicy effectivePolicy = (EffectivePolicy)boi.getProperty(POLICY_INFO_RESPONSE_CLIENT);
- if (null == effectivePolicy) {
- EffectivePolicyImpl epi = createOutPolicyInfo();
- if (m != null) {
- boi.setProperty(POLICY_INFO_RESPONSE_CLIENT, epi);
+ EffectivePolicy effectivePolicy = (EffectivePolicy)boi.getProperty(POLICY_INFO_RESPONSE_CLIENT);
+ if (effectivePolicy == null) {
+ synchronized (ei) {
+ effectivePolicy = (EffectivePolicy)boi.getProperty(POLICY_INFO_RESPONSE_CLIENT);
+ if (null == effectivePolicy) {
+ EffectivePolicyImpl epi = createOutPolicyInfo();
+ epi.initialise(ei, boi, this, true, false, m);
+ if (m != null) {
+ boi.setProperty(POLICY_INFO_RESPONSE_CLIENT, epi);
+ }
+ effectivePolicy = epi;
}
- epi.initialise(ei, boi, this, true, false, m);
- effectivePolicy = epi;
}
- return effectivePolicy;
}
+ return effectivePolicy;
}
public void setEffectiveClientResponsePolicy(EndpointInfo ei, BindingOperationInfo boi,
@@ -370,21 +389,26 @@ public class PolicyEngineImpl implements PolicyEngine, BusExtension {
BindingOperationInfo boi,
BindingFaultInfo bfi,
Message m) {
- synchronized (ei) {
- EffectivePolicy effectivePolicy = null;
- if (bfi != null) {
- effectivePolicy = (EffectivePolicy)bfi.getProperty(POLICY_INFO_FAULT_CLIENT);
- }
- if (null == effectivePolicy) {
- EffectivePolicyImpl epi = createOutPolicyInfo();
+ EffectivePolicy effectivePolicy = null;
+ if (bfi != null) {
+ effectivePolicy = (EffectivePolicy)bfi.getProperty(POLICY_INFO_FAULT_CLIENT);
+ }
+ if (effectivePolicy == null) {
+ synchronized (ei) {
if (bfi != null) {
- bfi.setProperty(POLICY_INFO_FAULT_CLIENT, epi);
+ effectivePolicy = (EffectivePolicy)bfi.getProperty(POLICY_INFO_FAULT_CLIENT);
+ }
+ if (null == effectivePolicy) {
+ EffectivePolicyImpl epi = createOutPolicyInfo();
+ epi.initialisePolicy(ei, boi, bfi, this, m);
+ if (bfi != null) {
+ bfi.setProperty(POLICY_INFO_FAULT_CLIENT, epi);
+ }
+ effectivePolicy = epi;
}
- epi.initialisePolicy(ei, boi, bfi, this, m);
- effectivePolicy = epi;
}
- return effectivePolicy;
}
+ return effectivePolicy;
}
public void setEffectiveClientFaultPolicy(EndpointInfo ei, BindingFaultInfo bfi, EffectivePolicy ep) {
[2/3] cxf git commit: [CXF-6738] Minor refactoring
Posted by as...@apache.org.
[CXF-6738] Minor refactoring
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/a0ab1ae5
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/a0ab1ae5
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/a0ab1ae5
Branch: refs/heads/3.1.x-fixes
Commit: a0ab1ae5797eace72c563d0e2ae15d15e20d4d1f
Parents: 0384a69
Author: Alessio Soldano <as...@redhat.com>
Authored: Tue Jan 26 23:52:22 2016 +0100
Committer: Alessio Soldano <as...@redhat.com>
Committed: Wed Jan 27 13:59:07 2016 +0100
----------------------------------------------------------------------
.../apache/cxf/ws/policy/PolicyEngineImpl.java | 38 ++++++++++----------
1 file changed, 19 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/a0ab1ae5/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
----------------------------------------------------------------------
diff --git a/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java b/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
index e3af4c9..6155a38 100644
--- a/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
+++ b/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
@@ -313,18 +313,7 @@ public class PolicyEngineImpl implements PolicyEngine, BusExtension {
boolean isRequestor,
Assertor assertor,
Message m) {
- EndpointPolicy ep = (EndpointPolicy)ei.getProperty(isRequestor
- ? POLICY_INFO_ENDPOINT_CLIENT : POLICY_INFO_ENDPOINT_SERVER);
- if (ep == null) {
- synchronized (ei) {
- ep = (EndpointPolicy)ei.getProperty(isRequestor
- ? POLICY_INFO_ENDPOINT_CLIENT : POLICY_INFO_ENDPOINT_SERVER);
- if (ep == null) {
- ep = createEndpointPolicyInfo(ei, isRequestor, assertor, m);
- }
- }
- }
- return ep;
+ return createEndpointPolicyInfo(ei, isRequestor, assertor, m);
}
public void setClientEndpointPolicy(EndpointInfo ei, EndpointPolicy ep) {
@@ -600,16 +589,27 @@ public class PolicyEngineImpl implements PolicyEngine, BusExtension {
return vocabulary;
}
- EndpointPolicyImpl createEndpointPolicyInfo(EndpointInfo ei,
- boolean isRequestor,
+ EndpointPolicy createEndpointPolicyInfo(EndpointInfo ei,
+ boolean isRequestor,
Assertor assertor,
Message m) {
- EndpointPolicyImpl epi = new EndpointPolicyImpl(ei, this, isRequestor, assertor);
- epi.initialize(m);
- if (m != null) {
- ei.setProperty(isRequestor ? POLICY_INFO_ENDPOINT_CLIENT : POLICY_INFO_ENDPOINT_SERVER, epi);
+ EndpointPolicy ep = (EndpointPolicy)ei.getProperty(isRequestor
+ ? POLICY_INFO_ENDPOINT_CLIENT : POLICY_INFO_ENDPOINT_SERVER);
+ if (ep == null) {
+ synchronized (ei) {
+ ep = (EndpointPolicy)ei.getProperty(isRequestor
+ ? POLICY_INFO_ENDPOINT_CLIENT : POLICY_INFO_ENDPOINT_SERVER);
+ if (ep == null) {
+ EndpointPolicyImpl epi = new EndpointPolicyImpl(ei, this, isRequestor, assertor);
+ epi.initialize(m);
+ if (m != null) {
+ ei.setProperty(isRequestor ? POLICY_INFO_ENDPOINT_CLIENT : POLICY_INFO_ENDPOINT_SERVER, epi);
+ }
+ ep = epi;
+ }
+ }
}
- return epi;
+ return ep;
}
[3/3] cxf git commit: Recording .gitmergeinfo Changes
Posted by as...@apache.org.
Recording .gitmergeinfo Changes
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/e7a75b69
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/e7a75b69
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/e7a75b69
Branch: refs/heads/3.1.x-fixes
Commit: e7a75b695afd3c64e42a2dcdf26b1febfa1250a6
Parents: a0ab1ae
Author: Alessio Soldano <as...@redhat.com>
Authored: Wed Jan 27 14:00:17 2016 +0100
Committer: Alessio Soldano <as...@redhat.com>
Committed: Wed Jan 27 14:00:17 2016 +0100
----------------------------------------------------------------------
.gitmergeinfo | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/e7a75b69/.gitmergeinfo
----------------------------------------------------------------------
diff --git a/.gitmergeinfo b/.gitmergeinfo
index 7c7ed88..f781818 100644
--- a/.gitmergeinfo
+++ b/.gitmergeinfo
@@ -22,5 +22,7 @@ B fb30f8bffc85fcc3208fcc0e1eda4b54a89b5d37
M 0222768baf6b60742c4a8332308edf2be0f4a2e4
M 2e8219cf3d047abc3a7e2611bf284aadbc20b7d6
M 8583a24ac541dc373503d7a6c59cd90890acdae3
+M 8e650cfe3efd63a06c25b7e912d9d4db61598eb1
M 9a9e0a8a37608195c4ef6fbf386728d13d025d2d
+M a1710bdd783afcd667d9e72ccb031480d3806850
M fe89bf0fb8379428667f66312e6942e906142d6f