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 2009/03/08 21:58:58 UTC
svn commit: r751527 - in /cxf/trunk:
api/src/main/java/org/apache/cxf/service/model/
rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/
rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/
rt/ws/policy/src/test/java/org/apache/cxf/w...
Author: dkulp
Date: Sun Mar 8 20:58:58 2009
New Revision: 751527
URL: http://svn.apache.org/viewvc?rev=751527&view=rev
Log:
Updates so JAX-RS services will work if Policy engine is turned on
Modified:
cxf/trunk/api/src/main/java/org/apache/cxf/service/model/EndpointInfo.java
cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProvider.java
cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java
Modified: cxf/trunk/api/src/main/java/org/apache/cxf/service/model/EndpointInfo.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/EndpointInfo.java?rev=751527&r1=751526&r2=751527&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/service/model/EndpointInfo.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/service/model/EndpointInfo.java Sun Mar 8 20:58:58 2009
@@ -52,6 +52,9 @@
}
public InterfaceInfo getInterface() {
+ if (service == null) {
+ return null;
+ }
return service.getInterface();
}
Modified: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java?rev=751527&r1=751526&r2=751527&view=diff
==============================================================================
--- cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java (original)
+++ cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java Sun Mar 8 20:58:58 2009
@@ -73,6 +73,10 @@
public PolicyEngineImpl() {
init();
}
+ public PolicyEngineImpl(boolean en) {
+ enabled = en;
+ init();
+ }
// configuration
@@ -338,6 +342,9 @@
}
Policy getAggregatedServicePolicy(ServiceInfo si) {
+ if (si == null) {
+ return new Policy();
+ }
Policy aggregated = null;
for (PolicyProvider pp : getPolicyProviders()) {
Policy p = pp.getEffectivePolicy(si);
Modified: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProvider.java?rev=751527&r1=751526&r2=751527&view=diff
==============================================================================
--- cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProvider.java (original)
+++ cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProvider.java Sun Mar 8 20:58:58 2009
@@ -157,12 +157,13 @@
}
Policy getElementPolicy(AbstractDescriptionElement adh, boolean includeAttributes) {
+ if (adh == null) {
+ return null;
+ }
return getElementPolicy(adh, includeAttributes, adh.getDescription());
}
Policy getElementPolicy(Extensible ex, boolean includeAttributes, DescriptionInfo di) {
-
-
if (null == ex || null == di) {
return null;
}
Modified: cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java?rev=751527&r1=751526&r2=751527&view=diff
==============================================================================
--- cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java (original)
+++ cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java Sun Mar 8 20:58:58 2009
@@ -84,7 +84,7 @@
@Test
public void testAccessors() throws Exception {
- engine = new PolicyEngineImpl();
+ engine = new PolicyEngineImpl(false);
assertNotNull(engine.getRegistry());
assertNull(engine.getBus());
assertNull(engine.getPolicyProviders());