cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r789711 - in /cxf/branches/2.2.x-fixes: ./ rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/ rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/spring/ rt/ws/policy/src/main/resources/META-INF/cxf/
Date Tue, 30 Jun 2009 13:23:54 GMT
Author: dkulp
Date: Tue Jun 30 13:23:54 2009
New Revision: 789711

URL: http://svn.apache.org/viewvc?rev=789711&view=rev
Log:
Merged revisions 789530 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r789530 | dkulp | 2009-06-29 21:25:03 -0400 (Mon, 29 Jun 2009) | 4 lines
  
  Update policy spring config to configure existing engine instead of
  creating new one.
  Have PolicyProviders register themselves instead of scanning application
  context.
........

Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/AbstractPolicyProvider.java
    cxf/branches/2.2.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/spring/InitializingPolicyEngine.java
    cxf/branches/2.2.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/spring/PolicyEngineBeanDefinitionParser.java
    cxf/branches/2.2.x-fixes/rt/ws/policy/src/main/resources/META-INF/cxf/cxf-extension-policy.xml

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jun 30 13:23:54 2009
@@ -1 +1 @@
-/cxf/trunk:782728-782730,783097,783294,783396,784059,784181-784184,784893,784895,785279-785282,785468,785621,785624,785651,785734,785866,786142,786271-786272,786395,786512,786514,786582-786583,786638,786647,786850,787200,787269,787277-787279,787290-787291,787305,787323,787366,787849,788030,788060,788187,788444,788451,788703,788752,788774,788819-788820,789013,789371,789387,789420,789527-789529
+/cxf/trunk:782728-782730,783097,783294,783396,784059,784181-784184,784893,784895,785279-785282,785468,785621,785624,785651,785734,785866,786142,786271-786272,786395,786512,786514,786582-786583,786638,786647,786850,787200,787269,787277-787279,787290-787291,787305,787323,787366,787849,788030,788060,788187,788444,788451,788703,788752,788774,788819-788820,789013,789371,789387,789420,789527-789530

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.2.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/AbstractPolicyProvider.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/AbstractPolicyProvider.java?rev=789711&r1=789710&r2=789711&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/AbstractPolicyProvider.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/AbstractPolicyProvider.java
Tue Jun 30 13:23:54 2009
@@ -28,6 +28,7 @@
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.ws.policy.PolicyBuilder;
 import org.apache.cxf.ws.policy.PolicyEngine;
+import org.apache.cxf.ws.policy.PolicyEngineImpl;
 import org.apache.cxf.ws.policy.PolicyException;
 import org.apache.cxf.ws.policy.PolicyProvider;
 import org.apache.cxf.ws.policy.attachment.reference.ReferenceResolver;
@@ -73,6 +74,8 @@
             setBuilder(bus.getExtension(PolicyBuilder.class));
             PolicyEngine pe = (PolicyEngine)bus.getExtension(PolicyEngine.class);
             setRegistry(pe.getRegistry());
+            
+            ((PolicyEngineImpl)pe).getPolicyProviders().add(this);
         }
     }
     

Modified: cxf/branches/2.2.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/spring/InitializingPolicyEngine.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/spring/InitializingPolicyEngine.java?rev=789711&r1=789710&r2=789711&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/spring/InitializingPolicyEngine.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/spring/InitializingPolicyEngine.java
Tue Jun 30 13:23:54 2009
@@ -19,32 +19,9 @@
 
 package org.apache.cxf.ws.policy.spring;
 
-import java.util.ArrayList;
-import java.util.List;
-
 import org.apache.cxf.ws.policy.PolicyEngineImpl;
-import org.apache.cxf.ws.policy.PolicyProvider;
-import org.springframework.beans.BeansException;
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationContextAware;
-
-public class InitializingPolicyEngine extends PolicyEngineImpl implements InitializingBean,

-    ApplicationContextAware  {
-
-    private ApplicationContext context;
-    
-    public void setApplicationContext(ApplicationContext c) throws BeansException {
-        context = c;  
-    }
 
-    public void afterPropertiesSet() throws Exception {
-        String[] beanNames = context.getBeanNamesForType(PolicyProvider.class);
-        List<PolicyProvider> providers = new ArrayList<PolicyProvider>();
-        for (String bn : beanNames) {
-            providers.add((PolicyProvider)context.getBean(bn));            
-        }
-        super.setPolicyProviders(providers);
-    }
+@Deprecated
+public class InitializingPolicyEngine extends PolicyEngineImpl {
     
 }

Modified: cxf/branches/2.2.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/spring/PolicyEngineBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/spring/PolicyEngineBeanDefinitionParser.java?rev=789711&r1=789710&r2=789711&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/spring/PolicyEngineBeanDefinitionParser.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/spring/PolicyEngineBeanDefinitionParser.java
Tue Jun 30 13:23:54 2009
@@ -22,7 +22,9 @@
 import org.w3c.dom.Element;
 
 import org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser;
+import org.apache.cxf.ws.policy.AlternativeSelector;
 import org.apache.cxf.ws.policy.PolicyEngine;
+import org.apache.cxf.ws.policy.PolicyEngineImpl;
 import org.springframework.beans.factory.BeanDefinitionStoreException;
 import org.springframework.beans.factory.support.AbstractBeanDefinition;
 import org.springframework.beans.factory.support.BeanDefinitionBuilder;
@@ -30,6 +32,11 @@
 
 
 public class PolicyEngineBeanDefinitionParser extends AbstractBeanDefinitionParser {
+    protected void doParse(Element element, ParserContext ctx, BeanDefinitionBuilder bean)
{
+        bean.addConstructorArgReference(PolicyEngine.class.getName());
+        super.doParse(element, ctx, bean);
+    }
+    
     
     @Override
     protected void mapElement(ParserContext ctx, BeanDefinitionBuilder bean, Element e, String
name) {
@@ -40,16 +47,42 @@
 
     @Override
     protected Class getBeanClass(Element el) {
-        return InitializingPolicyEngine.class;
+        return PolicyEngineConfig.class;
     }
 
     @Override
     protected String resolveId(Element e, AbstractBeanDefinition abd, ParserContext ctx)

         throws BeanDefinitionStoreException {
-        return PolicyEngine.class.getName();
+        return PolicyEngineConfig.class.getName();
     }
-    
-    
 
+    
+    public static class PolicyEngineConfig {
+        
+        private PolicyEngineImpl engine;
+        
+        public PolicyEngineConfig(PolicyEngine e) {
+            engine = (PolicyEngineImpl)e;
+        }
+        
+        public boolean getEnabled() {
+            return engine.isEnabled();
+        }
+        public void setEnabled(boolean enabled) {
+            engine.setEnabled(enabled);
+        }
+        public boolean getIgnoreUnknownAssertions() {
+            return engine.isIgnoreUnknownAssertions();
+        }
+        public void setIgnoreUnknownAssertions(boolean ignoreUnknownAssertions) {
+            engine.setIgnoreUnknownAssertions(ignoreUnknownAssertions);
+        }
+        public AlternativeSelector getAlternativeSelector() {
+            return engine.getAlternativeSelector();
+        }
+        public void setAlternativeSelector(AlternativeSelector alternativeSelector) {
+            engine.setAlternativeSelector(alternativeSelector);
+        }
+    }
 
 }
\ No newline at end of file

Modified: cxf/branches/2.2.x-fixes/rt/ws/policy/src/main/resources/META-INF/cxf/cxf-extension-policy.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/ws/policy/src/main/resources/META-INF/cxf/cxf-extension-policy.xml?rev=789711&r1=789710&r2=789711&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/ws/policy/src/main/resources/META-INF/cxf/cxf-extension-policy.xml
(original)
+++ cxf/branches/2.2.x-fixes/rt/ws/policy/src/main/resources/META-INF/cxf/cxf-extension-policy.xml
Tue Jun 30 13:23:54 2009
@@ -58,7 +58,7 @@
         <property name="assertionBuilderRegistry" ref="org.apache.cxf.ws.policy.AssertionBuilderRegistry"/>
     </bean>
   
-    <bean id="org.apache.cxf.ws.policy.PolicyEngine" class="org.apache.cxf.ws.policy.spring.InitializingPolicyEngine">
+    <bean id="org.apache.cxf.ws.policy.PolicyEngine" class="org.apache.cxf.ws.policy.PolicyEngineImpl">
        <property name="bus" ref="cxf"/>
     </bean>
     



Mime
View raw message