You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by da...@apache.org on 2007/04/22 01:34:16 UTC

svn commit: r531126 [1/2] - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/feature/ api/src/main/java/org/apache/cxf/ws/ api/src/main/java/org/apache/cxf/ws/policy/ common/common/src/main/java/org/apache/cxf/configuration/spring/ distributio...

Author: dandiep
Date: Sat Apr 21 16:34:13 2007
New Revision: 531126

URL: http://svn.apache.org/viewvc?view=rev&rev=531126
Log:
Flesh out the Feature concept in CXF and try to bring together Features & Policy.

I added 3 Feature implementations in this commit:
- LoggingFeature. This simply adds the logging interceptors to the specifed endpoint.
- WSAddressingFeature
- WSPolicyFeature

The most interesting of these is probably the WSPolicyFeature. This allows inlining
of WS-Policy inside Spring configurations. This eliminates the need for an external 
policy file when using Policy. For instance:

<endpoint>
  <features>
    <Policy><UsingAddressing/></Policy>
  </features>
<endpoint>

Or you can also reference policies in a Spring config and create <beans>:

<Policy wsu:Id="FooPolicy">...</Policy>

<endpoint>
  <features>
    <ref bean="FooPolicy"/>
    <bean class="org.apache.cxf.feature.LoggingFeature"/>
  </features>
<endpoint>

One of the things this made painfully clear (after an hour or two of banging 
my head against the desk), is that we need to have different spring IDs for
both <endpoint> and <client>. Otherwise they clash. So I changed the syntax to 
this:

<jaxws:client id="...FooPort" createdFromAPI="true"/>
<jaxws:server id="...FooPort" createdFromAPI="true"/>

What this does is signal to the DefinitionParser that we should append
".jaxws-client" or ".jaxws-endpoint" to the id internally. I would love a
better name than  "createdFromAPI" if you have any ideas. I didn't 
automatically append ".jaxws-foo" when abstract=true because that would
break "pure spring" users who are doing parent/child relationships with
their beans.


Added:
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/feature/
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/feature/AbstractFeature.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/feature/
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/feature/LoggingFeature.java   (with props)
    incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/WSAddressingFeature.java   (with props)
    incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/spring/
    incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/spring/AddressingBeanDefinitionParser.java   (with props)
    incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/spring/NamespaceHandler.java   (with props)
    incubator/cxf/trunk/rt/ws/addr/src/main/resources/META-INF/spring.handlers   (with props)
    incubator/cxf/trunk/rt/ws/addr/src/main/resources/META-INF/spring.schemas   (with props)
    incubator/cxf/trunk/rt/ws/addr/src/main/resources/schemas/ws-addr-conf.xsd   (with props)
    incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/spring/
    incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/spring/WSAFeatureTest.java   (with props)
    incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/spring/WSAFeatureXmlTest.java   (with props)
    incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/spring/server.xml   (with props)
    incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/WSPolicyFeature.java   (with props)
    incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/ServiceModelPolicyProvider.java   (with props)
    incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/spring/NamespaceHandler.java   (with props)
    incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/spring/PolicyFeatureBeanDefinitionParser.java   (with props)
    incubator/cxf/trunk/rt/ws/policy/src/main/resources/META-INF/spring.handlers   (with props)
    incubator/cxf/trunk/rt/ws/policy/src/main/resources/META-INF/spring.schemas   (with props)
    incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/spring/
    incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/spring/PolicyFeatureTest.java   (with props)
    incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/spring/server.xml   (with props)
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/policy/AddressingInlinePolicyTest.java   (with props)
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/policy/addr-inline-policy.xml   (with props)
Removed:
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/AbstractWSFeature.java
Modified:
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/PolicyEngine.java
    incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java
    incubator/cxf/trunk/distribution/src/main/release/samples/hello_world/cxf.xml
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/JaxWsProxyFactoryBeanDefinitionParser.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/ServerBeanDefinitionParser.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/resources/org/apache/cxf/jaxws/spring/jaxws.xsd
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/configured-endpoints.xml
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/soapServiceConfig.xml
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractEndpointFactory.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientFactoryBean.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java
    incubator/cxf/trunk/rt/ws/addr/pom.xml
    incubator/cxf/trunk/rt/ws/policy/pom.xml
    incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
    incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/AbstractPolicyProvider.java
    incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/spring/InitializingPolicyEngine.java
    incubator/cxf/trunk/rt/ws/policy/src/main/resources/META-INF/cxf/cxf-extension-policy.xml
    incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java
    incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyExtensionsTest.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/schema_validation/cxf-config.xml
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/policy/HTTPClientPolicyTest.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/policy/http-server.xml

Added: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/feature/AbstractFeature.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/feature/AbstractFeature.java?view=auto&rev=531126
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/feature/AbstractFeature.java (added)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/feature/AbstractFeature.java Sat Apr 21 16:34:13 2007
@@ -0,0 +1,42 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.feature;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.endpoint.Client;
+import org.apache.cxf.endpoint.Server;
+import org.apache.cxf.interceptor.InterceptorProvider;
+
+public abstract class AbstractFeature {
+    public void initialize(Server server, Bus bus) {
+        initializeProvider(server.getEndpoint(), bus);
+    }
+    
+    public void initialize(Client client, Bus bus) {
+        initializeProvider(client, bus);
+    }
+    
+    public void initialize(Bus bus) {
+        initializeProvider(bus, bus);
+    }
+    
+    protected void initializeProvider(InterceptorProvider provider, Bus bus) {
+        
+    }
+}

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/PolicyEngine.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/PolicyEngine.java?view=diff&rev=531126&r1=531125&r2=531126
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/PolicyEngine.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/PolicyEngine.java Sat Apr 21 16:34:13 2007
@@ -33,6 +33,8 @@
 
     boolean isEnabled();
     
+    void setEnabled(boolean e);
+    
     // available throughout the outbound path
     
     EffectivePolicy getEffectiveClientRequestPolicy(EndpointInfo ei, BindingOperationInfo boi, Conduit c);

Modified: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java?view=diff&rev=531126&r1=531125&r2=531126
==============================================================================
--- incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java (original)
+++ incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java Sat Apr 21 16:34:13 2007
@@ -29,8 +29,10 @@
 import org.w3c.dom.NodeList;
 
 import org.apache.cxf.helpers.DOMUtils;
+import org.springframework.beans.factory.BeanDefinitionStoreException;
 import org.springframework.beans.factory.config.BeanDefinition;
 import org.springframework.beans.factory.config.BeanDefinitionHolder;
+import org.springframework.beans.factory.support.AbstractBeanDefinition;
 import org.springframework.beans.factory.support.BeanDefinitionBuilder;
 import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser;
 import org.springframework.beans.factory.xml.BeanDefinitionParserDelegate;
@@ -39,6 +41,23 @@
 
 public abstract class AbstractBeanDefinitionParser extends AbstractSingleBeanDefinitionParser {
 
+    @Override
+    protected String resolveId(Element el, AbstractBeanDefinition arg1, 
+                               ParserContext arg2) throws BeanDefinitionStoreException {
+        String id = el.getAttribute("id");
+        String createdFromAPI = el.getAttribute("createdFromAPI");
+        
+        if (createdFromAPI != null && "true".equals(createdFromAPI.toLowerCase())) {
+            return id + getSuffix();
+        }
+        
+        return super.resolveId(el, arg1, arg2);
+    }
+
+    protected String getSuffix() {
+        return "";
+    }
+
     protected void setFirstChildAsProperty(Element element, ParserContext ctx, 
                                          BeanDefinitionBuilder bean, String propertyName) {
         String id = getAndRegisterFirstChild(element, ctx, bean, propertyName);
@@ -58,9 +77,23 @@
         String id;
         BeanDefinition child;
         if (first.getNamespaceURI().equals(BeanDefinitionParserDelegate.BEANS_NAMESPACE_URI)) {
-            BeanDefinitionHolder bdh = ctx.getDelegate().parseBeanDefinitionElement(first);
-            child = bdh.getBeanDefinition();
-            id = bdh.getBeanName();
+            String name = first.getLocalName();
+            if ("ref".equals(name)) {
+                id = first.getAttribute("bean");
+                if (id == null) {
+                    throw new IllegalStateException("<ref> elements must have a \"bean\" attribute!");
+                }
+                return id;
+            } else if ("bean".equals(name)) {
+                BeanDefinitionHolder bdh = ctx.getDelegate().parseBeanDefinitionElement(first);
+                child = bdh.getBeanDefinition();
+                id = bdh.getBeanName();
+            } else {
+                throw new UnsupportedOperationException("Elements with the name " + name  
+                                                        + " are not currently "
+                                                        + "supported as sub elements of " 
+                                                        + element.getLocalName());
+            }
             
         } else {
             child = ctx.getDelegate().parseCustomElement(first, bean.getBeanDefinition());

Modified: incubator/cxf/trunk/distribution/src/main/release/samples/hello_world/cxf.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/hello_world/cxf.xml?view=diff&rev=531126&r1=531125&r2=531126
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/hello_world/cxf.xml (original)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/hello_world/cxf.xml Sat Apr 21 16:34:13 2007
@@ -16,7 +16,7 @@
     </bean>
 
     <jaxws:endpoint id="{http://apache.org/hello_world_soap_http}SoapPort"
-		abstract="true">
+		createdFromAPI="true">
 		<jaxws:properties>
 			<entry key="schema-validation-enabled" value="true" />
 		</jaxws:properties>

Added: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/feature/LoggingFeature.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/feature/LoggingFeature.java?view=auto&rev=531126
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/feature/LoggingFeature.java (added)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/feature/LoggingFeature.java Sat Apr 21 16:34:13 2007
@@ -0,0 +1,38 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.feature;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.interceptor.InterceptorProvider;
+import org.apache.cxf.interceptor.LoggingInInterceptor;
+import org.apache.cxf.interceptor.LoggingOutInterceptor;
+
+public class LoggingFeature extends AbstractFeature {
+    private static final LoggingInInterceptor IN = new LoggingInInterceptor();
+    private static final LoggingOutInterceptor OUT = new LoggingOutInterceptor();
+    
+    @Override
+    protected void initializeProvider(InterceptorProvider provider, Bus bus) {
+        provider.getInInterceptors().add(IN);
+        provider.getInFaultInterceptors().add(IN);
+        provider.getOutInterceptors().add(OUT);
+        provider.getOutFaultInterceptors().add(OUT);
+    }
+
+}

Propchange: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/feature/LoggingFeature.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/feature/LoggingFeature.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/feature/LoggingFeature.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java?view=diff&rev=531126&r1=531125&r2=531126
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java Sat Apr 21 16:34:13 2007
@@ -20,6 +20,7 @@
 package org.apache.cxf.jaxws;
 
 import java.security.AccessController;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.CopyOnWriteArrayList;
@@ -41,13 +42,13 @@
 import org.apache.cxf.configuration.Configurer;
 import org.apache.cxf.endpoint.Server;
 import org.apache.cxf.endpoint.ServerImpl;
+import org.apache.cxf.feature.AbstractFeature;
 import org.apache.cxf.interceptor.Interceptor;
 import org.apache.cxf.interceptor.InterceptorProvider;
 import org.apache.cxf.jaxws.context.WebServiceContextResourceResolver;
 import org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilder;
 import org.apache.cxf.jaxws.support.JaxWsEndpointImpl;
 import org.apache.cxf.jaxws.support.JaxWsImplementorInfo;
-import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
 import org.apache.cxf.resource.DefaultResourceManager;
 import org.apache.cxf.resource.ResourceManager;
 import org.apache.cxf.resource.ResourceResolver;
@@ -84,6 +85,7 @@
     private QName endpointName;
     private QName serviceName;
     
+    private List<AbstractFeature> features;
     private List<Interceptor> in = new CopyOnWriteArrayList<Interceptor>();
     private List<Interceptor> out = new CopyOnWriteArrayList<Interceptor>();
     private List<Interceptor> outFault  = new CopyOnWriteArrayList<Interceptor>();
@@ -92,30 +94,6 @@
     public EndpointImpl(Object implementor) {
         this(BusFactory.getDefaultBus(), implementor);
     }
-    
-    @Deprecated
-    public EndpointImpl(Bus b, Object implementor, JaxWsServiceFactoryBean serviceFactory) {
-        this(b, implementor, serviceFactory, null);
-    }
-    
-    /**
-     * If you're using this method you should switch to passing in a JaxWsServerFactoryBean
-     * or using the new getters/setters on EndpointImpl before our next release.
-     * @param b
-     * @param implementor
-     * @param serviceFactory
-     * @param bindingUri
-     */
-    @Deprecated
-    public EndpointImpl(Bus b, Object implementor, 
-                        JaxWsServiceFactoryBean serviceFactory, String bindingUri) {
-        this.bus = b;
-        this.bindingUri = bindingUri;
-        this.serverFactory = new JaxWsServerFactoryBean(serviceFactory);
-        this.implementor = implementor;
-        
-        doInit = true;
-    }
    
     public EndpointImpl(Bus b, Object implementor, 
                         JaxWsServerFactoryBean sf) {
@@ -246,7 +224,7 @@
 
     
     public String getBeanName() {
-        return endpointName.toString();
+        return endpointName.toString() + ".jaxws-endpoint";
     }
 
     protected void checkProperties() {
@@ -281,6 +259,7 @@
         serverFactory.setEndpointName(endpointName);
         serverFactory.setServiceBean(implementor);
         serverFactory.setBus(bus);
+        serverFactory.setFeatures(features);
         
         // Be careful not to override any serverfactory settings as a user might
         // have supplied their own.
@@ -451,6 +430,17 @@
 
     public void setOutFaultInterceptors(List<Interceptor> interceptors) {
         outFault = interceptors;
+    }
+
+    public List<AbstractFeature> getFeatures() {
+        return features;
+    }
+
+    public void setFeatures(List<AbstractFeature> features) {
+        if (features == null) {
+            features = new ArrayList<AbstractFeature>();
+        }
+        this.features = features;
     }
     
     /*

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java?view=diff&rev=531126&r1=531125&r2=531126
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java Sat Apr 21 16:34:13 2007
@@ -302,7 +302,7 @@
             clientFac.setBindingId(portInfo.getBindingID());
             clientFac.setAddress(portInfo.getAddress());
         }
-        configureObject(portName.toString() + ".jaxwsProxyFactory", proxyFac);
+        configureObject(portName.toString() + ".jaxws-client.proxyFactory", proxyFac);
         
         Object obj = proxyFac.create();
         

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java?view=diff&rev=531126&r1=531125&r2=531126
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java Sat Apr 21 16:34:13 2007
@@ -43,8 +43,12 @@
     private static final String IMPLEMENTOR = "implementor";
 
     @Override
-    protected void doParse(Element element, ParserContext ctx, BeanDefinitionBuilder bean) {
+    protected String getSuffix() {
+        return ".jaxws-endpoint";
+    }
 
+    @Override
+    protected void doParse(Element element, ParserContext ctx, BeanDefinitionBuilder bean) {
         NamedNodeMap atts = element.getAttributes();
         for (int i = 0; i < atts.getLength(); i++) {
             Attr node = (Attr) atts.item(i);
@@ -52,7 +56,9 @@
             String pre = node.getPrefix();
             String name = node.getLocalName();
 
-            if (isAttribute(pre, name) && !"publish".equals(name)) {
+            if ("createdFromAPI".equals(name)) {
+                bean.setAbstract(true);
+            } else if (isAttribute(pre, name) && !"publish".equals(name)) {
                 if ("endpointName".equals(name) || "serviceName".equals(name)) {
                     QName q = parseQName(element, val);
                     bean.addPropertyValue(name, q);
@@ -75,14 +81,15 @@
                     Map map = ctx.getDelegate().parseMapElement((Element) n, bean.getBeanDefinition());
                     bean.addPropertyValue("properties", map);
                 } else if ("inInterceptors".equals(name) || "inFaultInterceptors".equals(name)
-                    || "outInterceptors".equals(name) || "outFaultInterceptors".equals(name)) {
+                    || "outInterceptors".equals(name) || "outFaultInterceptors".equals(name)
+                    || "features".equals(name)) {
                     List list = ctx.getDelegate().parseListElement((Element) n, bean.getBeanDefinition());
-                    bean.addPropertyValue(n.getLocalName(), list);
+                    bean.addPropertyValue(name, list);
                 } else if (IMPLEMENTOR.equals(name)) {
                     ctx.getDelegate()
                         .parseConstructorArgElement(getFirstChild(element), bean.getBeanDefinition());
                 } else {
-                    setFirstChildAsProperty((Element) n, ctx, bean, n.getLocalName());
+                    setFirstChildAsProperty((Element) n, ctx, bean, name);
                 }
             }
         }

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/JaxWsProxyFactoryBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/JaxWsProxyFactoryBeanDefinitionParser.java?view=diff&rev=531126&r1=531125&r2=531126
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/JaxWsProxyFactoryBeanDefinitionParser.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/JaxWsProxyFactoryBeanDefinitionParser.java Sat Apr 21 16:34:13 2007
@@ -37,18 +37,30 @@
 public class JaxWsProxyFactoryBeanDefinitionParser extends AbstractBeanDefinitionParser {
 
     @Override
+    protected String getSuffix() {
+        return ".jaxws-client";
+    }
+
+    @Override
     protected void doParse(Element element, ParserContext ctx, BeanDefinitionBuilder clientBean) {
         
         BeanDefinitionBuilder bean = BeanDefinitionBuilder.rootBeanDefinition(JaxWsProxyFactoryBean.class);
 
         NamedNodeMap atts = element.getAttributes();
         String id = null;
+        boolean createdFromAPI = false;
+        
         for (int i = 0; i < atts.getLength(); i++) {
             Attr node = (Attr) atts.item(i);
             String val = node.getValue();
             String pre = node.getPrefix();
             String name = node.getLocalName();
-            if (!"id".equals(name) && isAttribute(pre, name)) {
+            
+            if ("createdFromAPI".equals(name)) {
+                bean.setAbstract(true);
+                clientBean.setAbstract(true);
+                createdFromAPI = true;
+            } else if (!"id".equals(name) && isAttribute(pre, name)) {
                 if ("endpointName".equals(name) || "serviceName".equals(name)) {
                     QName q = parseQName(element, val);
                     bean.addPropertyValue(name, q);
@@ -73,7 +85,8 @@
                     Map map = ctx.getDelegate().parseMapElement((Element) n, bean.getBeanDefinition());
                     bean.addPropertyValue("properties", map);
                 } else if ("inInterceptors".equals(name) || "inFaultInterceptors".equals(name)
-                    || "outInterceptors".equals(name) || "outFaultInterceptors".equals(name)) {
+                    || "outInterceptors".equals(name) || "outFaultInterceptors".equals(name)
+                    || "features".equals(name)) {
                     List list = ctx.getDelegate().parseListElement((Element) n, bean.getBeanDefinition());
                     bean.addPropertyValue(n.getLocalName(), list);
                 } else {
@@ -81,8 +94,11 @@
                 }
             }
         }
+        if (createdFromAPI) {
+            id = id + getSuffix();
+        }
+        String factoryId = id + ".proxyFactory";
         
-        String factoryId = id + ".jaxwsProxyFactory";
         ctx.getRegistry().registerBeanDefinition(factoryId, bean.getBeanDefinition());
         
         clientBean.getBeanDefinition().setAttribute("id", id);

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/ServerBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/ServerBeanDefinitionParser.java?view=diff&rev=531126&r1=531125&r2=531126
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/ServerBeanDefinitionParser.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/ServerBeanDefinitionParser.java Sat Apr 21 16:34:13 2007
@@ -45,11 +45,16 @@
         for (int i = 0; i < atts.getLength(); i++) {
             Attr node = (Attr) atts.item(i);
             String val = node.getValue();
+            String name = node.getLocalName();
             
-            if (IMPLEMENTOR.equals(node.getLocalName())) {
+            if ("createdFromAPI".equals(name)) {
+                bean.setAbstract(true);
+            } else if (IMPLEMENTOR.equals(name)) {
                 loadImplementor(bean, val);
+            } else if ("abstract".equals(name)) {
+                bean.setAbstract(true);
             } else {
-                mapToProperty(bean, node.getLocalName(), val);
+                mapToProperty(bean, name, val);
             }
         }
         
@@ -68,7 +73,8 @@
                 } else if ("binding".equals(n.getLocalName())) {
                     setFirstChildAsProperty((Element) n, ctx, bean, "bindingConfig");
                 }  else if ("inInterceptors".equals(name) || "inFaultInterceptors".equals(name)
-                    || "outInterceptors".equals(name) || "outFaultInterceptors".equals(name)) {
+                    || "outInterceptors".equals(name) || "outFaultInterceptors".equals(name)
+                    || "features".equals(name)) {
                     List list = ctx.getDelegate().parseListElement((Element) n, bean.getBeanDefinition());
                     bean.addPropertyValue(n.getLocalName(), list);
                 } else {

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/resources/org/apache/cxf/jaxws/spring/jaxws.xsd
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/resources/org/apache/cxf/jaxws/spring/jaxws.xsd?view=diff&rev=531126&r1=531125&r2=531126
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/resources/org/apache/cxf/jaxws/spring/jaxws.xsd (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/resources/org/apache/cxf/jaxws/spring/jaxws.xsd Sat Apr 21 16:34:13 2007
@@ -17,6 +17,7 @@
           <xsd:sequence>
             <xsd:element name="binding" type="xsd:anyType" minOccurs="0"/>
             <xsd:element name="executor" type="xsd:anyType" minOccurs="0"/>
+            <xsd:element name="features" type="xsd:anyType" minOccurs="0"/>
             <xsd:element name="implementor" type="xsd:anyType" minOccurs="0"/>
             <xsd:element name="inInterceptors" type="xsd:anyType" minOccurs="0"/>
             <xsd:element name="inFaultInterceptors" type="xsd:anyType" minOccurs="0"/>
@@ -26,6 +27,7 @@
             <xsd:element name="serviceFactory" type="xsd:anyType" minOccurs="0"/>
           </xsd:sequence>
           <xsd:attribute name="address" type="xsd:string" />
+          <xsd:attribute name="createdFromAPI" type="xsd:string" />
           <xsd:attribute name="bindingUri" type="xsd:string" />
           <xsd:attribute name="bus" type="xsd:string" />
           <xsd:attribute name="implementor" type="xsd:string"/>
@@ -45,6 +47,7 @@
           <xsd:sequence>
             <xsd:element name="binding" type="xsd:anyType" minOccurs="0"/>
             <xsd:element name="executor" type="xsd:anyType" minOccurs="0"/>
+            <xsd:element name="features" type="xsd:anyType" minOccurs="0"/>
             <xsd:element name="implementor" type="xsd:anyType" minOccurs="0"/>
             <xsd:element name="inInterceptors" type="xsd:anyType" minOccurs="0"/>
             <xsd:element name="inFaultInterceptors" type="xsd:anyType" minOccurs="0"/>
@@ -57,6 +60,7 @@
           </xsd:sequence>
           <xsd:attribute name="address" type="xsd:string" />
           <xsd:attribute name="bus" type="xsd:string" />
+          <xsd:attribute name="createdFromAPI" type="xsd:string" />
           <xsd:attribute name="serviceClass" type="xsd:string"/>
           <xsd:attribute name="serviceBean" type="xsd:string"/>
           <xsd:attribute name="start" type="xsd:boolean" default="true"/>
@@ -73,6 +77,7 @@
         <xsd:extension base="beans:identifiedType">
           <xsd:sequence>
             <xsd:element name="binding" type="xsd:anyType" minOccurs="0"/>
+            <xsd:element name="features" type="xsd:anyType" minOccurs="0"/>
             <xsd:element name="inInterceptors" type="xsd:anyType" minOccurs="0"/>
             <xsd:element name="inFaultInterceptors" type="xsd:anyType" minOccurs="0"/>
             <xsd:element name="outInterceptors" type="xsd:anyType" minOccurs="0"/>
@@ -83,6 +88,7 @@
           <xsd:attribute name="address" type="xsd:string" />
           <xsd:attribute name="bindingUri" type="xsd:string" />
           <xsd:attribute name="bus" type="xsd:string" />
+          <xsd:attribute name="createdFromAPI" type="xsd:string" />
           <xsd:attribute name="endpointName" type="xsd:QName" />
           <xsd:attribute name="password" type="xsd:string" />
           <xsd:attribute name="serviceClass" type="xsd:QName" />

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/configured-endpoints.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/configured-endpoints.xml?view=diff&rev=531126&r1=531125&r2=531126
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/configured-endpoints.xml (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/configured-endpoints.xml Sat Apr 21 16:34:13 2007
@@ -64,7 +64,7 @@
 	</bean>
 
 	<jaxws:endpoint id="{http://apache.org/hello_world_soap_http}SoapPort"
-		abstract="true">
+		createdFromAPI="true">
 		<jaxws:inInterceptors>
 			<bean class="org.apache.cxf.jaxws.ConfiguredEndpointTest$TestInterceptor">
 				<property name="name" value="endpoint-in" />

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/soapServiceConfig.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/soapServiceConfig.xml?view=diff&rev=531126&r1=531125&r2=531126
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/soapServiceConfig.xml (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/soapServiceConfig.xml Sat Apr 21 16:34:13 2007
@@ -27,7 +27,7 @@
 http://cxf.apache.org/jaxws http://cxf.apache.org/schema/jaxws.xsd">
 
   
-  <jaxws:client id="{http://apache.org/hello_world_soap_http}SoapPort" abstract="true">
+  <jaxws:client id="{http://apache.org/hello_world_soap_http}SoapPort" createdFromAPI="true">
      <jaxws:properties>
       <entry key="foo" value="bar"/>
     </jaxws:properties>

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java?view=diff&rev=531126&r1=531125&r2=531126
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java Sat Apr 21 16:34:13 2007
@@ -142,7 +142,7 @@
         ClassPathXmlApplicationContext ctx = 
             new ClassPathXmlApplicationContext(new String[] {"/org/apache/cxf/jaxws/spring/clients.xml"});
 
-        Object bean = ctx.getBean("client1.jaxwsProxyFactory");
+        Object bean = ctx.getBean("client1.proxyFactory");
         assertNotNull(bean);
         
         Greeter greeter = (Greeter) ctx.getBean("client1");

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractEndpointFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractEndpointFactory.java?view=diff&rev=531126&r1=531125&r2=531126
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractEndpointFactory.java (original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractEndpointFactory.java Sat Apr 21 16:34:13 2007
@@ -18,10 +18,12 @@
  */
 package org.apache.cxf.frontend;
 
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 import java.util.logging.Logger;
+
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.Bus;
@@ -37,6 +39,7 @@
 import org.apache.cxf.endpoint.ConduitSelector;
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.endpoint.EndpointException;
+import org.apache.cxf.feature.AbstractFeature;
 import org.apache.cxf.interceptor.AbstractBasicInterceptorProvider;
 import org.apache.cxf.service.Service;
 import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
@@ -47,7 +50,6 @@
 import org.apache.cxf.transport.DestinationFactory;
 import org.apache.cxf.transport.DestinationFactoryManager;
 import org.apache.cxf.transport.local.LocalTransportFactory;
-import org.apache.cxf.ws.AbstractWSFeature;
 import org.apache.cxf.ws.addressing.EndpointReferenceType;
 import org.apache.cxf.wsdl11.WSDLEndpointFactory;
 
@@ -64,7 +66,7 @@
     private ReflectionServiceFactoryBean serviceFactory;
     private QName endpointName;
     private Map<String, Object> properties;
-    private List<AbstractWSFeature> features;
+    private List<AbstractFeature> features;
     private BindingConfiguration bindingConfig;
     private EndpointReferenceType endpointReference;
     private ConduitSelector conduitSelector;
@@ -335,11 +337,14 @@
         this.properties = properties;
     }
 
-    public List<AbstractWSFeature> getFeatures() {
+    public List<AbstractFeature> getFeatures() {
+        if (features == null) {
+            features = new ArrayList<AbstractFeature>();
+        }
         return features;
     }
 
-    public void setFeatures(List<AbstractWSFeature> features) {
+    public void setFeatures(List<AbstractFeature> features) {
         this.features = features;
     }
 

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientFactoryBean.java?view=diff&rev=531126&r1=531125&r2=531126
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientFactoryBean.java (original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientFactoryBean.java Sat Apr 21 16:34:13 2007
@@ -23,9 +23,9 @@
 import org.apache.cxf.endpoint.ClientImpl;
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.endpoint.EndpointException;
+import org.apache.cxf.feature.AbstractFeature;
 import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
 import org.apache.cxf.service.factory.ServiceConstructionException;
-import org.apache.cxf.ws.AbstractWSFeature;
 
 public class ClientFactoryBean extends AbstractEndpointFactory {
     private Client client;
@@ -62,8 +62,8 @@
 
     protected void applyFeatures() {
         if (getFeatures() != null) {
-            for (AbstractWSFeature feature : getFeatures()) {
-                feature.initialize(client);
+            for (AbstractFeature feature : getFeatures()) {
+                feature.initialize(client, getBus());
             }
         }
     }

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java?view=diff&rev=531126&r1=531125&r2=531126
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java (original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java Sat Apr 21 16:34:13 2007
@@ -19,7 +19,9 @@
 package org.apache.cxf.frontend;
 
 import java.lang.reflect.Proxy;
+import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import javax.xml.namespace.QName;
@@ -28,6 +30,7 @@
 import org.apache.cxf.configuration.security.AuthorizationPolicy;
 import org.apache.cxf.endpoint.Client;
 import org.apache.cxf.endpoint.ConduitSelector;
+import org.apache.cxf.feature.AbstractFeature;
 import org.apache.cxf.interceptor.AbstractBasicInterceptorProvider;
 import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
 
@@ -50,6 +53,7 @@
     private String password;
     private Map<String, Object> properties;
     private Bus bus;
+    private List<AbstractFeature> features;
     
     public ClientProxyFactoryBean() {
         super();
@@ -68,6 +72,7 @@
             properties.put(AuthorizationPolicy.class.getName(), authPolicy);
         }
         
+        clientFactoryBean.setFeatures(features);
         clientFactoryBean.setProperties(properties);
         
         if (bus != null) {
@@ -189,4 +194,16 @@
     public void setProperties(Map<String, Object> properties) {
         this.properties = properties;
     }
+
+    public List<AbstractFeature> getFeatures() {
+        if (features == null) {
+            features = new ArrayList<AbstractFeature>();
+        }
+        return features;
+    }
+
+    public void setFeatures(List<AbstractFeature> features) {
+        this.features = features;
+    }
+    
 }

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java?view=diff&rev=531126&r1=531125&r2=531126
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java (original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java Sat Apr 21 16:34:13 2007
@@ -25,11 +25,11 @@
 import org.apache.cxf.endpoint.EndpointException;
 import org.apache.cxf.endpoint.Server;
 import org.apache.cxf.endpoint.ServerImpl;
+import org.apache.cxf.feature.AbstractFeature;
 import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
 import org.apache.cxf.service.factory.ServiceConstructionException;
 import org.apache.cxf.service.invoker.BeanInvoker;
 import org.apache.cxf.service.invoker.Invoker;
-import org.apache.cxf.ws.AbstractWSFeature;
 
 /**
  * This class helps take a {@link org.apache.cxf.service.Service} and 
@@ -109,8 +109,8 @@
 
     protected void applyFeatures() {
         if (getFeatures() != null) {
-            for (AbstractWSFeature feature : getFeatures()) {
-                feature.initialize(server);
+            for (AbstractFeature feature : getFeatures()) {
+                feature.initialize(server, getBus());
             }
         }
     }

Modified: incubator/cxf/trunk/rt/ws/addr/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/addr/pom.xml?view=diff&rev=531126&r1=531125&r2=531126
==============================================================================
--- incubator/cxf/trunk/rt/ws/addr/pom.xml (original)
+++ incubator/cxf/trunk/rt/ws/addr/pom.xml Sat Apr 21 16:34:13 2007
@@ -63,18 +63,34 @@
             <artifactId>cxf-rt-bindings-soap</artifactId>
             <version>${project.version}</version>
         </dependency>
-
+        
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-activation_1.1_spec</artifactId>
+        </dependency>
+        
+		<!-- Test stuff -->
         <dependency>
             <groupId>org.apache.cxf</groupId>
-            <artifactId>cxf-testutils</artifactId>
+            <artifactId>cxf-rt-frontend-jaxws</artifactId>
             <version>${project.version}</version>
             <scope>test</scope>
         </dependency>
         
         <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-activation_1.1_spec</artifactId>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-transports-http-jetty</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-testutils</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
         </dependency>
+
     </dependencies>
 
     <scm>

Added: incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/WSAddressingFeature.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/WSAddressingFeature.java?view=auto&rev=531126
==============================================================================
--- incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/WSAddressingFeature.java (added)
+++ incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/WSAddressingFeature.java Sat Apr 21 16:34:13 2007
@@ -0,0 +1,53 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.ws.addressing;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.feature.AbstractFeature;
+import org.apache.cxf.interceptor.InterceptorProvider;
+import org.apache.cxf.ws.addressing.soap.MAPCodec;
+
+public class WSAddressingFeature extends AbstractFeature {
+
+    private MAPAggregator mapAggregator = new MAPAggregator();
+    private MAPCodec mapCodec = new MAPCodec();
+    
+    @Override
+    protected void initializeProvider(InterceptorProvider provider, Bus bus) {
+        provider.getInInterceptors().add(mapAggregator);
+        provider.getInInterceptors().add(mapCodec);
+        
+        provider.getOutInterceptors().add(mapAggregator);
+        provider.getOutInterceptors().add(mapCodec);
+        
+        provider.getInFaultInterceptors().add(mapAggregator);
+        provider.getInFaultInterceptors().add(mapCodec);
+        
+        provider.getOutFaultInterceptors().add(mapAggregator);
+        provider.getOutFaultInterceptors().add(mapCodec);
+    }
+
+    public void setAllowDuplicates(boolean allow) {
+        mapAggregator.setAllowDuplicates(allow);
+    }
+    
+    public boolean isAllowDuplicates() {
+        return mapAggregator.allowDuplicates();
+    }
+}

Propchange: incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/WSAddressingFeature.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/WSAddressingFeature.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/WSAddressingFeature.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/spring/AddressingBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/spring/AddressingBeanDefinitionParser.java?view=auto&rev=531126
==============================================================================
--- incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/spring/AddressingBeanDefinitionParser.java (added)
+++ incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/spring/AddressingBeanDefinitionParser.java Sat Apr 21 16:34:13 2007
@@ -0,0 +1,33 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.ws.addressing.spring;
+
+import org.w3c.dom.Element;
+
+import org.apache.cxf.ws.addressing.WSAddressingFeature;
+import org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser;
+
+public class AddressingBeanDefinitionParser extends AbstractSimpleBeanDefinitionParser {
+
+    @Override
+    protected Class getBeanClass(Element arg0) {
+        return WSAddressingFeature.class;
+    }
+
+}

Propchange: incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/spring/AddressingBeanDefinitionParser.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/spring/AddressingBeanDefinitionParser.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/spring/AddressingBeanDefinitionParser.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/spring/NamespaceHandler.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/spring/NamespaceHandler.java?view=auto&rev=531126
==============================================================================
--- incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/spring/NamespaceHandler.java (added)
+++ incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/spring/NamespaceHandler.java Sat Apr 21 16:34:13 2007
@@ -0,0 +1,27 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.ws.addressing.spring;
+
+import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
+
+public class NamespaceHandler extends NamespaceHandlerSupport {
+    public void init() {
+        registerBeanDefinitionParser("addressing", new AddressingBeanDefinitionParser());        
+    }
+}

Propchange: incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/spring/NamespaceHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/spring/NamespaceHandler.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/spring/NamespaceHandler.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/rt/ws/addr/src/main/resources/META-INF/spring.handlers
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/addr/src/main/resources/META-INF/spring.handlers?view=auto&rev=531126
==============================================================================
--- incubator/cxf/trunk/rt/ws/addr/src/main/resources/META-INF/spring.handlers (added)
+++ incubator/cxf/trunk/rt/ws/addr/src/main/resources/META-INF/spring.handlers Sat Apr 21 16:34:13 2007
@@ -0,0 +1 @@
+http\://cxf.apache.org/ws/addressing=org.apache.cxf.ws.addressing.spring.NamespaceHandler
\ No newline at end of file

Propchange: incubator/cxf/trunk/rt/ws/addr/src/main/resources/META-INF/spring.handlers
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/cxf/trunk/rt/ws/addr/src/main/resources/META-INF/spring.schemas
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/addr/src/main/resources/META-INF/spring.schemas?view=auto&rev=531126
==============================================================================
--- incubator/cxf/trunk/rt/ws/addr/src/main/resources/META-INF/spring.schemas (added)
+++ incubator/cxf/trunk/rt/ws/addr/src/main/resources/META-INF/spring.schemas Sat Apr 21 16:34:13 2007
@@ -0,0 +1 @@
+http\://cxf.apache.org/schemas/ws/addressing.xsd=schemas/ws-addr-conf.xsd
\ No newline at end of file

Propchange: incubator/cxf/trunk/rt/ws/addr/src/main/resources/META-INF/spring.schemas
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/cxf/trunk/rt/ws/addr/src/main/resources/schemas/ws-addr-conf.xsd
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/addr/src/main/resources/schemas/ws-addr-conf.xsd?view=auto&rev=531126
==============================================================================
--- incubator/cxf/trunk/rt/ws/addr/src/main/resources/schemas/ws-addr-conf.xsd (added)
+++ incubator/cxf/trunk/rt/ws/addr/src/main/resources/schemas/ws-addr-conf.xsd Sat Apr 21 16:34:13 2007
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<xs:schema
+    targetNamespace="http://cxf.apache.org/ws/addressing" 
+    xmlns:tns="http://cxf.apache.org/ws/addressing"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    elementFormDefault="qualified"
+    attributeFormDefault="unqualified" >
+
+    <xs:element name="addressing">
+        <xs:complexType>
+           <xs:attribute name="allowDuplicates" type="xs:boolean"/>
+        </xs:complexType>
+    </xs:element>
+    
+</xs:schema>

Propchange: incubator/cxf/trunk/rt/ws/addr/src/main/resources/schemas/ws-addr-conf.xsd
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/ws/addr/src/main/resources/schemas/ws-addr-conf.xsd
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/ws/addr/src/main/resources/schemas/ws-addr-conf.xsd
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/rt/ws/addr/src/main/resources/schemas/ws-addr-conf.xsd
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/spring/WSAFeatureTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/spring/WSAFeatureTest.java?view=auto&rev=531126
==============================================================================
--- incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/spring/WSAFeatureTest.java (added)
+++ incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/spring/WSAFeatureTest.java Sat Apr 21 16:34:13 2007
@@ -0,0 +1,58 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.ws.addressing.spring;
+
+import org.apache.cxf.endpoint.Endpoint;
+import org.apache.cxf.endpoint.Server;
+import org.apache.cxf.interceptor.Interceptor;
+import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
+import org.apache.cxf.test.AbstractCXFTest;
+import org.apache.cxf.ws.addressing.MAPAggregator;
+import org.apache.cxf.ws.addressing.WSAddressingFeature;
+import org.apache.cxf.ws.addressing.soap.MAPCodec;
+import org.apache.hello_world_soap_http.GreeterImpl;
+import org.junit.Test;
+
+public class WSAFeatureTest extends AbstractCXFTest {
+    @Test
+    public void testServerFactory() {
+        JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
+        sf.getFeatures().add(new WSAddressingFeature());
+        sf.setServiceBean(new GreeterImpl());
+        sf.setAddress("http://localhost/test");
+        sf.setStart(false);
+        sf.setBus(getBus());
+        
+        Server server = sf.create();
+        
+        Endpoint endpoint = server.getEndpoint();
+        boolean hasAg = false;
+        boolean hasCodec = false;
+        
+        for (Interceptor i : endpoint.getInInterceptors()) {
+            if (i instanceof MAPAggregator) {
+                hasAg = true;
+            } else if (i instanceof MAPCodec) {
+                hasCodec = true;
+            }
+        }
+        assertTrue(hasAg);
+        assertTrue(hasCodec);
+    }
+}

Propchange: incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/spring/WSAFeatureTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/spring/WSAFeatureTest.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/spring/WSAFeatureTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/spring/WSAFeatureXmlTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/spring/WSAFeatureXmlTest.java?view=auto&rev=531126
==============================================================================
--- incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/spring/WSAFeatureXmlTest.java (added)
+++ incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/spring/WSAFeatureXmlTest.java Sat Apr 21 16:34:13 2007
@@ -0,0 +1,69 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.ws.addressing.spring;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusException;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.configuration.Configurer;
+import org.apache.cxf.endpoint.Endpoint;
+import org.apache.cxf.endpoint.Server;
+import org.apache.cxf.interceptor.Interceptor;
+import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
+import org.apache.cxf.test.AbstractCXFTest;
+import org.apache.cxf.ws.addressing.MAPAggregator;
+import org.apache.cxf.ws.addressing.soap.MAPCodec;
+import org.apache.hello_world_soap_http.GreeterImpl;
+import org.junit.Test;
+
+public class WSAFeatureXmlTest extends AbstractCXFTest {
+    
+    @Override
+    protected Bus createBus() throws BusException {
+        return new SpringBusFactory().createBus("/org/apache/cxf/ws/addressing/spring/server.xml");
+    }
+
+    @Test
+    public void testServerFactory() {
+        JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
+        sf.setServiceBean(new GreeterImpl());
+        sf.setAddress("http://localhost/test");
+        sf.setStart(false);
+        sf.setBus(getBus());
+        
+        Configurer c = getBus().getExtension(Configurer.class);
+        c.configureBean("test", sf);
+        
+        Server server = sf.create();
+        
+        Endpoint endpoint = server.getEndpoint();
+        boolean hasAg = false;
+        boolean hasCodec = false;
+        
+        for (Interceptor i : endpoint.getInInterceptors()) {
+            if (i instanceof MAPAggregator) {
+                hasAg = true;
+            } else if (i instanceof MAPCodec) {
+                hasCodec = true;
+            }
+        }
+        assertTrue(hasAg);
+        assertTrue(hasCodec);
+    }
+}

Propchange: incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/spring/WSAFeatureXmlTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/spring/WSAFeatureXmlTest.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/spring/WSAFeatureXmlTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/spring/server.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/spring/server.xml?view=auto&rev=531126
==============================================================================
--- incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/spring/server.xml (added)
+++ incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/spring/server.xml Sat Apr 21 16:34:13 2007
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:http="http://cxf.apache.org/transports/http/configuration"
+       xmlns:wsa="http://cxf.apache.org/ws/addressing"
+       xmlns:jaxws="http://cxf.apache.org/jaxws"
+       xsi:schemaLocation="
+http://cxf.apache.org/ws/addressing http://cxf.apache.org/schema/ws/addressing.xsd
+http://cxf.apache.org/jaxws http://cxf.apache.org/schema/jaxws.xsd
+http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schema/transports/http.xsd
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+  
+  <jaxws:server id="test" abstract="true">
+    <jaxws:features>
+      <wsa:addressing allowDuplicates="false"/>
+    </jaxws:features>
+  </jaxws:server>
+  
+</beans>

Propchange: incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/spring/server.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/spring/server.xml
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/spring/server.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/spring/server.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: incubator/cxf/trunk/rt/ws/policy/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/pom.xml?view=diff&rev=531126&r1=531125&r2=531126
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/pom.xml (original)
+++ incubator/cxf/trunk/rt/ws/policy/pom.xml Sat Apr 21 16:34:13 2007
@@ -44,10 +44,10 @@
             <groupId>javax.xml.ws</groupId>
             <artifactId>jaxws-api</artifactId>
         </dependency>
-	<dependency>
-        <groupId>org.apache.geronimo.specs</groupId>
-        <artifactId>geronimo-annotation_1.0_spec</artifactId>
-	</dependency>
+		<dependency>
+	        <groupId>org.apache.geronimo.specs</groupId>
+	        <artifactId>geronimo-annotation_1.0_spec</artifactId>
+		</dependency>
         <dependency>
             <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-common-utilities</artifactId>
@@ -62,6 +62,26 @@
             <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-rt-core</artifactId>
             <version>${project.version}</version>
+        </dependency>
+        <!-- Test stuff -->
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-frontend-jaxws</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-transports-http-jetty</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-testutils</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>junit</groupId>

Modified: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java?view=diff&rev=531126&r1=531125&r2=531126
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java Sat Apr 21 16:34:13 2007
@@ -57,7 +57,8 @@
     private PolicyRegistry registry;
     private Collection<PolicyProvider> policyProviders;
     private boolean enabled;
-
+    private boolean addedBusInterceptors;
+    
     private Map<BindingOperation, EffectivePolicy> clientRequestInfo;
     
     private Map<BindingOperation, EffectivePolicy> clientResponseInfo;
@@ -106,8 +107,12 @@
         return registry;
     }
 
-    public void setEnabled(boolean e) {
+    public synchronized void setEnabled(boolean e) {
         enabled = e;
+        
+        if (!addedBusInterceptors) {
+            addBusInterceptors();
+        }
     }
     
     // BusExtension interface
@@ -326,6 +331,8 @@
         PolicyVerificationInFaultInterceptor verifyInFault = new PolicyVerificationInFaultInterceptor();
         verifyInFault.setBus(bus);
         bus.getInFaultInterceptors().add(verifyInFault);
+        
+        addedBusInterceptors = true;
     }  
     
     Policy getAggregatedServicePolicy(ServiceInfo si) {
@@ -334,7 +341,7 @@
             Policy p = pp.getEffectivePolicy(si);
             if (null == aggregated) {
                 aggregated = p;
-            } else {
+            } else if (p != null) {
                 aggregated = aggregated.merge(p);
             }
         }
@@ -347,7 +354,7 @@
             Policy p = pp.getEffectivePolicy(ei);
             if (null == aggregated) {
                 aggregated = p;
-            } else {
+            } else if (p != null) {
                 aggregated = aggregated.merge(p);
             }
         }
@@ -360,7 +367,7 @@
             Policy p = pp.getEffectivePolicy(boi);
             if (null == aggregated) {
                 aggregated = p;
-            } else {
+            } else if (p != null) {
                 aggregated = aggregated.merge(p);
             }
         }
@@ -373,7 +380,7 @@
             Policy p = pp.getEffectivePolicy(bmi);
             if (null == aggregated) {
                 aggregated = p;
-            } else {
+            } else if (p != null) {
                 aggregated = aggregated.merge(p);
             }
         }
@@ -386,7 +393,7 @@
             Policy p = pp.getEffectivePolicy(bfi);
             if (null == aggregated) {
                 aggregated = p;
-            } else {
+            } else if (p != null) {
                 aggregated = aggregated.merge(p);
             }
         }

Added: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/WSPolicyFeature.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/WSPolicyFeature.java?view=auto&rev=531126
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/WSPolicyFeature.java (added)
+++ incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/WSPolicyFeature.java Sat Apr 21 16:34:13 2007
@@ -0,0 +1,135 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.ws.policy;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+import org.w3c.dom.Element;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.endpoint.Client;
+import org.apache.cxf.endpoint.Endpoint;
+import org.apache.cxf.endpoint.Server;
+import org.apache.cxf.feature.AbstractFeature;
+import org.apache.cxf.service.model.ServiceInfo;
+import org.apache.neethi.Policy;
+
+/**
+ * Configures a Server, Client, Bus with the specified policies. If a series of 
+ * Policy <code>Element</code>s are supplied, these will be loaded into a Policy
+ * class using the <code>PolicyBuilder</code> extension on the bus. If the 
+ * PolicyEngine has not been started, this feature will start it.
+ *
+ * @see PolicyBuilder
+ * @see AbstractFeature
+ */
+public class WSPolicyFeature extends AbstractFeature {
+    private Collection<Policy> policies;
+    private Collection<Element> policyElements;
+    
+    public WSPolicyFeature() {
+        super();
+    }
+
+    public WSPolicyFeature(Policy... ps) {
+        super();
+        policies = new ArrayList<Policy>();
+        Collections.addAll(policies, ps);
+    }
+
+    @Override
+    public void initialize(Client client, Bus bus) {
+        Endpoint endpoint = client.getEndpoint();
+        
+        intializeEndpoint(endpoint, bus);
+    }
+
+    @Override
+    public void initialize(Server server, Bus bus) {
+        Endpoint endpoint = server.getEndpoint();
+        
+        intializeEndpoint(endpoint, bus);
+    }
+
+    private void intializeEndpoint(Endpoint endpoint, Bus bus) {
+        Collection<Policy> loadedPolicies = null;
+        if (policyElements != null) {
+            loadedPolicies = new ArrayList<Policy>();
+            PolicyBuilder builder = bus.getExtension(PolicyBuilder.class);
+            
+            for (Element e : policyElements) {
+                loadedPolicies.add(builder.getPolicy(e));
+            }
+        } 
+        
+        ensurePolicyEngineActivated(bus);
+        
+        List<ServiceInfo> sis = endpoint.getService().getServiceInfos();
+        for (ServiceInfo si : sis) {
+            if (policies != null) {
+                for (Policy p : policies) {
+                    si.addExtensor(p);
+                }
+            }
+            
+            if (loadedPolicies != null) {
+                for (Policy p : loadedPolicies) {
+                    si.addExtensor(p);
+                }
+            }
+        }
+    }
+
+    private void ensurePolicyEngineActivated(Bus bus) {
+        PolicyEngine pe = bus.getExtension(PolicyEngine.class);
+        
+        // Create a PolicyEngine and enable it if there isn't one
+        if (pe == null) {
+            PolicyEngineImpl pei = new PolicyEngineImpl();
+            pei.setBus(bus);
+            bus.setExtension(pei, PolicyEngine.class);
+            pe = pei;
+        }
+        
+        synchronized (pe) {
+            if (!pe.isEnabled()) {
+                pe.setEnabled(true);
+            }
+        }
+    }
+
+    public Collection<Policy> getPolicies() {
+        return policies;
+    }
+
+    public void setPolicies(Collection<Policy> policies) {
+        this.policies = policies;
+    }
+
+    public Collection<Element> getPolicyElements() {
+        return policyElements;
+    }
+
+    public void setPolicyElements(Collection<Element> policyElements) {
+        this.policyElements = policyElements;
+    }
+}

Propchange: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/WSPolicyFeature.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/WSPolicyFeature.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/WSPolicyFeature.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/AbstractPolicyProvider.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/AbstractPolicyProvider.java?view=diff&rev=531126&r1=531125&r2=531126
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/AbstractPolicyProvider.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/AbstractPolicyProvider.java Sat Apr 21 16:34:13 2007
@@ -29,6 +29,7 @@
 import org.apache.cxf.ws.policy.PolicyBuilder;
 import org.apache.cxf.ws.policy.PolicyEngine;
 import org.apache.cxf.ws.policy.PolicyException;
+import org.apache.cxf.ws.policy.PolicyProvider;
 import org.apache.cxf.ws.policy.attachment.reference.ReferenceResolver;
 import org.apache.cxf.ws.policy.attachment.reference.RemoteReferenceResolver;
 import org.apache.neethi.Policy;
@@ -38,7 +39,7 @@
 /**
  * 
  */
-public class AbstractPolicyProvider {
+public abstract class AbstractPolicyProvider implements PolicyProvider {
     
     private static final ResourceBundle BUNDLE = BundleUtils.getBundle(AbstractPolicyProvider.class);
     

Added: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/ServiceModelPolicyProvider.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/ServiceModelPolicyProvider.java?view=auto&rev=531126
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/ServiceModelPolicyProvider.java (added)
+++ incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/ServiceModelPolicyProvider.java Sat Apr 21 16:34:13 2007
@@ -0,0 +1,56 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.ws.policy.attachment;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.service.model.BindingFaultInfo;
+import org.apache.cxf.service.model.BindingMessageInfo;
+import org.apache.cxf.service.model.BindingOperationInfo;
+import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.service.model.ServiceInfo;
+import org.apache.neethi.Policy;
+
+public class ServiceModelPolicyProvider extends AbstractPolicyProvider {
+
+    public ServiceModelPolicyProvider(Bus b) {
+        super(b);
+    }
+
+    public Policy getEffectivePolicy(BindingFaultInfo bfi) {
+        return bfi.getExtensor(Policy.class);
+    }
+
+    public Policy getEffectivePolicy(BindingMessageInfo bmi) {
+        return bmi.getExtensor(Policy.class);
+    }
+
+    public Policy getEffectivePolicy(BindingOperationInfo bi) {
+        return bi.getExtensor(Policy.class);
+    }
+
+    public Policy getEffectivePolicy(EndpointInfo ei) {
+        return ei.getExtensor(Policy.class);
+    }
+
+    public Policy getEffectivePolicy(ServiceInfo si) {
+        return si.getExtensor(Policy.class);
+    }
+
+}

Propchange: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/ServiceModelPolicyProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/ServiceModelPolicyProvider.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/ServiceModelPolicyProvider.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/spring/InitializingPolicyEngine.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/spring/InitializingPolicyEngine.java?view=diff&rev=531126&r1=531125&r2=531126
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/spring/InitializingPolicyEngine.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/spring/InitializingPolicyEngine.java Sat Apr 21 16:34:13 2007
@@ -46,4 +46,5 @@
         }
         super.setPolicyProviders(providers);
     }
+    
 }

Added: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/spring/NamespaceHandler.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/spring/NamespaceHandler.java?view=auto&rev=531126
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/spring/NamespaceHandler.java (added)
+++ incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/spring/NamespaceHandler.java Sat Apr 21 16:34:13 2007
@@ -0,0 +1,27 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.ws.policy.spring;
+
+import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
+
+public class NamespaceHandler extends NamespaceHandlerSupport {
+    public void init() {
+        registerBeanDefinitionParser("Policy", new PolicyFeatureBeanDefinitionParser());        
+    }
+}

Propchange: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/spring/NamespaceHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/spring/NamespaceHandler.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/spring/NamespaceHandler.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date