cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r937409 - in /cxf/trunk: rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ systests/jaxrs/ systests/jaxrs/src/test/resources/jaxrs_soap_rest/WEB-INF/
Date Fri, 23 Apr 2010 17:19:41 GMT
Author: sergeyb
Date: Fri Apr 23 17:19:41 2010
New Revision: 937409

URL: http://svn.apache.org/viewvc?rev=937409&view=rev
Log:
Adding guards to policy interceptors

Modified:
    cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ClientPolicyInFaultInterceptor.java
    cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyInInterceptor.java
    cxf/trunk/systests/jaxrs/pom.xml
    cxf/trunk/systests/jaxrs/src/test/resources/jaxrs_soap_rest/WEB-INF/beans.xml

Modified: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ClientPolicyInFaultInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ClientPolicyInFaultInterceptor.java?rev=937409&r1=937408&r2=937409&view=diff
==============================================================================
--- cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ClientPolicyInFaultInterceptor.java
(original)
+++ cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ClientPolicyInFaultInterceptor.java
Fri Apr 23 17:19:41 2010
@@ -79,10 +79,13 @@ public class ClientPolicyInFaultIntercep
         LOG.fine("ep: " + ep);
         
         List<Interceptor<? extends Message>> faultInterceptors = ep.getFaultInterceptors();
+        
         LOG.fine("faultInterceptors: " + faultInterceptors);
-        for (Interceptor<? extends Message> i : faultInterceptors) {
-            msg.getInterceptorChain().add(i);
-            LOG.log(Level.FINE, "Added interceptor of type {0}", i.getClass().getSimpleName());
+        if (null != faultInterceptors) {
+            for (Interceptor<? extends Message> i : faultInterceptors) {
+                msg.getInterceptorChain().add(i);
+                LOG.log(Level.FINE, "Added interceptor of type {0}", i.getClass().getSimpleName());
+            }
         }
         
         // insert assertions of endpoint's fault vocabulary into message

Modified: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyInInterceptor.java?rev=937409&r1=937408&r2=937409&view=diff
==============================================================================
--- cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyInInterceptor.java
(original)
+++ cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyInInterceptor.java
Fri Apr 23 17:19:41 2010
@@ -93,8 +93,10 @@ public class PolicyInInterceptor extends
                 EndpointPolicy ep = pe.getClientEndpointPolicy(ei, conduit);
                 
                 List<Interceptor<? extends Message>> interceptors = ep.getInterceptors();
-                for (Interceptor<? extends Message> i : interceptors) {
-                    msg.getInterceptorChain().add(i);
+                if (null != interceptors) {
+                    for (Interceptor<? extends Message> i : interceptors) {
+                        msg.getInterceptorChain().add(i);
+                    }
                 }
                 
                 // insert assertions of endpoint's vocabulary into message
@@ -111,8 +113,10 @@ public class PolicyInInterceptor extends
                 EffectivePolicy ep = pe.getEffectiveClientResponsePolicy(ei, boi);
         
                 List<Interceptor<? extends Message>> interceptors = ep.getInterceptors();
-                for (Interceptor<? extends Message> i : interceptors) {
-                    msg.getInterceptorChain().add(i);
+                if (null != interceptors) {
+                    for (Interceptor<? extends Message> i : interceptors) {
+                        msg.getInterceptorChain().add(i);
+                    }
                 }
                 // insert assertions of endpoint's vocabulary into message
                 if (ep.getPolicy() != null) {
@@ -129,9 +133,11 @@ public class PolicyInInterceptor extends
             EndpointPolicy ep = pe.getServerEndpointPolicy(ei, destination);
             
             List<Interceptor<? extends Message>> interceptors = ep.getInterceptors();
-            for (Interceptor<? extends Message> i : interceptors) {
-                msg.getInterceptorChain().add(i);
-                LOG.log(Level.FINE, "Added interceptor of type {0}", i.getClass().getSimpleName());
+            if (null != interceptors) {
+                for (Interceptor<? extends Message> i : interceptors) {
+                    msg.getInterceptorChain().add(i);
+                    LOG.log(Level.FINE, "Added interceptor of type {0}", i.getClass().getSimpleName());
+                }
             }
             
             // insert assertions of endpoint's vocabulary into message

Modified: cxf/trunk/systests/jaxrs/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/pom.xml?rev=937409&r1=937408&r2=937409&view=diff
==============================================================================
--- cxf/trunk/systests/jaxrs/pom.xml (original)
+++ cxf/trunk/systests/jaxrs/pom.xml Fri Apr 23 17:19:41 2010
@@ -115,6 +115,11 @@
         </dependency>
         <dependency>
             <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-ws-policy</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-rt-frontend-js</artifactId>
             <version>${project.version}</version>
         </dependency>

Modified: cxf/trunk/systests/jaxrs/src/test/resources/jaxrs_soap_rest/WEB-INF/beans.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/resources/jaxrs_soap_rest/WEB-INF/beans.xml?rev=937409&r1=937408&r2=937409&view=diff
==============================================================================
--- cxf/trunk/systests/jaxrs/src/test/resources/jaxrs_soap_rest/WEB-INF/beans.xml (original)
+++ cxf/trunk/systests/jaxrs/src/test/resources/jaxrs_soap_rest/WEB-INF/beans.xml Fri Apr
23 17:19:41 2010
@@ -38,6 +38,11 @@ http://cxf.apache.org/schemas/jaxrs.xsd"
   <import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
   <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
 
+  <bean id="org.apache.cxf.ws.policy.PolicyEngine" class="org.apache.cxf.ws.policy.PolicyEngineImpl">
+      <property name="bus" ref="cxf"/>
+      <property name="enabled" value="true"/>
+   </bean>
+
   <jaxrs:client id="restClient"
          address="http://localhost:9092/test/services/rest"
          serviceClass="org.apache.cxf.systest.jaxrs.BookStoreJaxrsJaxws"



Mime
View raw message