Author: dkulp
Date: Thu Apr 2 19:23:39 2009
New Revision: 761390
URL: http://svn.apache.org/viewvc?rev=761390&view=rev
Log:
Make sure request opertation policies can provide interceptors
Modified:
cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java
Modified:
cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java?rev=761390&r1=761389&r2=761390&view=diff
==============================================================================
---
cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java
(original)
+++
cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java
Thu Apr 2 19:23:39 2009
@@ -177,16 +177,15 @@
}
// vocabulary of alternative chosen for endpoint
- if (getChosenAlternative() == null) {
- return;
- }
- for (PolicyAssertion a : getChosenAlternative()) {
- if (a.isOptional()) {
- continue;
- }
- vocabulary.add(a);
- if (null != faultVocabulary) {
- faultVocabulary.add(a);
+ if (getChosenAlternative() != null) {
+ for (PolicyAssertion a : getChosenAlternative()) {
+ if (a.isOptional()) {
+ continue;
+ }
+ vocabulary.add(a);
+ if (null != faultVocabulary) {
+ faultVocabulary.add(a);
+ }
}
}
@@ -282,16 +281,31 @@
initializeInterceptors(reg, out, a, false);
}
}
- interceptors = new ArrayList<Interceptor>(out);
- if (!requestor) {
- return;
- }
- out.clear();
- for (PolicyAssertion a : getChosenAlternative()) {
- initializeInterceptors(reg, out, a, true);
+ if (requestor) {
+ interceptors = new ArrayList<Interceptor>(out);
+ out.clear();
+ for (PolicyAssertion a : getChosenAlternative()) {
+ initializeInterceptors(reg, out, a, true);
+ }
+ faultInterceptors = new ArrayList<Interceptor>(out);
+ } else if (ei != null && ei.getBinding() != null) {
+ for (BindingOperationInfo boi : ei.getBinding().getOperations()) {
+ EffectivePolicy p = engine.getEffectiveServerRequestPolicy(ei,
boi);
+ if (p == null || p.getPolicy() == null ||
p.getPolicy().isEmpty()) {
+ continue;
+ }
+ Collection<PolicyAssertion> c = engine.getAssertions(p, true);
+ if (c != null) {
+ for (PolicyAssertion a : c) {
+ initializeInterceptors(reg, out, a, true);
+ }
+ }
+ }
+ interceptors = new ArrayList<Interceptor>(out);
+ } else {
+ interceptors = new ArrayList<Interceptor>(out);
}
- faultInterceptors = new ArrayList<Interceptor>(out);
}
// for test