cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1229777 - /cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/WSPolicyFeature.java
Date Tue, 10 Jan 2012 22:45:32 GMT
Author: dkulp
Date: Tue Jan 10 22:45:31 2012
New Revision: 1229777

URL: http://svn.apache.org/viewvc?rev=1229777&view=rev
Log:
Remove spring requirement for WSPolicyFeature

Modified:
    cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/WSPolicyFeature.java

Modified: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/WSPolicyFeature.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/WSPolicyFeature.java?rev=1229777&r1=1229776&r2=1229777&view=diff
==============================================================================
--- cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/WSPolicyFeature.java (original)
+++ cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/WSPolicyFeature.java Tue
Jan 10 22:45:31 2012
@@ -29,6 +29,7 @@ import org.apache.cxf.Bus;
 import org.apache.cxf.common.i18n.BundleUtils;
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.injection.NoJSR250Annotations;
+import org.apache.cxf.configuration.ConfiguredBeanLocator;
 import org.apache.cxf.endpoint.Client;
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.endpoint.Server;
@@ -40,9 +41,6 @@ import org.apache.cxf.ws.policy.attachme
 import org.apache.neethi.Policy;
 import org.apache.neethi.PolicyReference;
 import org.apache.neethi.PolicyRegistry;
-import org.springframework.beans.BeansException;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationContextAware;
 
 
 /**
@@ -55,7 +53,7 @@ import org.springframework.context.Appli
  * @see AbstractFeature
  */
 @NoJSR250Annotations
-public class WSPolicyFeature extends AbstractFeature implements ApplicationContextAware {
+public class WSPolicyFeature extends AbstractFeature {
     
     private static final ResourceBundle BUNDLE = BundleUtils.getBundle(WSPolicyFeature.class);
     
@@ -64,7 +62,6 @@ public class WSPolicyFeature extends Abs
     private Collection<Element> policyReferenceElements;
     private boolean ignoreUnknownAssertions;
     private AlternativeSelector alternativeSelector; 
-    private ApplicationContext context;
     private boolean enabled = true;
   
        
@@ -87,10 +84,6 @@ public class WSPolicyFeature extends Abs
         this.enabled = enabled;
     }
     
-    public void setApplicationContext(ApplicationContext c) throws BeansException {
-        context = c;  
-    }
-    
     @Override
     public void initialize(Bus bus) {
         
@@ -243,7 +236,8 @@ public class WSPolicyFeature extends Abs
         }
         ReferenceResolver resolver = new ReferenceResolver() {
             public Policy resolveReference(String uri) {
-                PolicyBean pb = (PolicyBean)context.getBean(uri);
+                PolicyBean pb = bus.getExtension(ConfiguredBeanLocator.class)
+                        .getBeanOfType(uri, PolicyBean.class);
                 if (null != pb) {
                     PolicyBuilder builder = bus.getExtension(PolicyBuilder.class);
                     return builder.getPolicy(pb.getElement()); 



Mime
View raw message