You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by an...@apache.org on 2007/02/12 17:58:01 UTC

svn commit: r506536 - in /incubator/cxf/trunk: api/ api/src/main/java/org/apache/cxf/endpoint/ api/src/main/java/org/apache/cxf/io/ api/src/main/java/org/apache/cxf/message/ api/src/main/java/org/apache/cxf/phase/ api/src/main/java/org/apache/cxf/servi...

Author: andreasmyth
Date: Mon Feb 12 08:57:58 2007
New Revision: 506536

URL: http://svn.apache.org/viewvc?view=rev&rev=506536
Log:
Extended policy APIs and removed dependency of addressing and rm modules on policy module.
Fixed javadoc warnings in api module.

Added:
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/PolicyBuilder.java   (with props)
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/PolicyConstants.java
      - copied unchanged from r506363, incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyConstants.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/builders/
      - copied from r506363, incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/builders/
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/util/
      - copied from r506363, incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/util/
    incubator/cxf/trunk/api/src/test/java/org/apache/cxf/ws/
    incubator/cxf/trunk/api/src/test/java/org/apache/cxf/ws/policy/
    incubator/cxf/trunk/api/src/test/java/org/apache/cxf/ws/policy/builders/
    incubator/cxf/trunk/api/src/test/java/org/apache/cxf/ws/policy/builders/jaxb/
    incubator/cxf/trunk/api/src/test/java/org/apache/cxf/ws/policy/builders/jaxb/JaxbAssertionBuilderTest.java
      - copied, changed from r506363, incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/builders/jaxb/JaxbAssertionBuilderTest.java
    incubator/cxf/trunk/api/src/test/java/org/apache/cxf/ws/policy/builders/jaxb/JaxbAssertionTest.java
      - copied unchanged from r506363, incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/builders/jaxb/JaxbAssertionTest.java
    incubator/cxf/trunk/api/src/test/java/org/apache/cxf/ws/policy/builders/jaxb/foo.xml
      - copied unchanged from r506363, incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/builders/jaxb/foo.xml
    incubator/cxf/trunk/api/src/test/java/org/apache/cxf/ws/policy/builders/primitive/
    incubator/cxf/trunk/api/src/test/java/org/apache/cxf/ws/policy/builders/primitive/NestedPrimitiveAssertionBuilderTest.java   (with props)
    incubator/cxf/trunk/api/src/test/resources/schemas/foo.xsd
      - copied unchanged from r506363, incubator/cxf/trunk/rt/ws/policy/src/test/resources/schemas/foo.xsd
    incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyBuilderImpl.java
      - copied, changed from r506363, incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyBuilder.java
Removed:
    incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyBuilder.java
    incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyConstants.java
    incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/builders/
    incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/util/
    incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/builders/jaxb/
    incubator/cxf/trunk/rt/ws/policy/src/test/resources/schemas/foo.xsd
    incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/policy/
Modified:
    incubator/cxf/trunk/api/pom.xml
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/Client.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/io/AbstractCachedOutputStream.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Attachment.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Exchange.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Message.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptor.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractMessageContainer.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractPropertiesHolder.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/BindingInfo.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/InterfaceInfo.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/WSAContextUtils.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/builders/jaxb/JaxbAssertionBuilder.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/builders/primitive/NestedPrimitiveAssertionBuilder.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/builders/xml/XmlPrimitiveAssertion.java
    incubator/cxf/trunk/rt/ws/addr/pom.xml
    incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/policy/AddressingAssertionBuilder.java
    incubator/cxf/trunk/rt/ws/addr/src/main/resources/META-INF/cxf/cxf-extension-addr.xml
    incubator/cxf/trunk/rt/ws/policy/pom.xml
    incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngine.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/NormalizeTest.java
    incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyBuilderTest.java
    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/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProviderTest.java
    incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/builders/primitive/NestedPrimitiveAssertionTest.java
    incubator/cxf/trunk/rt/ws/rm/pom.xml

Modified: incubator/cxf/trunk/api/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/pom.xml?view=diff&rev=506536&r1=506535&r2=506536
==============================================================================
--- incubator/cxf/trunk/api/pom.xml (original)
+++ incubator/cxf/trunk/api/pom.xml Mon Feb 12 08:57:58 2007
@@ -133,6 +133,9 @@
                                         <deleteDir>${basedir}/target/generated/src/test/java/org/apache/cxf/wsdl</deleteDir>
                                     </deleteDirs>
                                 </xsdOption>
+                                <xsdOption>
+                                    <xsd>${basedir}/src/test/resources/schemas/foo.xsd</xsd>
+                                </xsdOption>
                             </xsdOptions>
                         </configuration>
                         <goals>

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/Client.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/Client.java?view=diff&rev=506536&r1=506535&r2=506536
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/Client.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/Client.java Mon Feb 12 08:57:58 2007
@@ -33,7 +33,7 @@
     
     /**
      * Invokes an operation syncronously
-     * @param oi  The name of the operation to be invoked. The service namespace will be used
+     * @param operationName The name of the operation to be invoked. The service namespace will be used
      * when looking up the BindingOperationInfo.
      * @param params  The params that matches the parts of the input message of the operation
      * @return The return values that matche the parts of the output message of the operation
@@ -43,7 +43,7 @@
 
     /**
      * Invokes an operation syncronously
-     * @param oi  The name of the operation to be invoked
+     * @param operationName The name of the operation to be invoked
      * @param params  The params that matches the parts of the input message of the operation
      * @return The return values that matche the parts of the output message of the operation
      */

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/io/AbstractCachedOutputStream.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/io/AbstractCachedOutputStream.java?view=diff&rev=506536&r1=506535&r2=506536
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/io/AbstractCachedOutputStream.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/io/AbstractCachedOutputStream.java Mon Feb 12 08:57:58 2007
@@ -119,13 +119,14 @@
     }
 
     /**
-     * Replace the original stream with the new one, when with Attachment, needs
-     * to replace the xml writer stream with the stream used by
-     * AttachmentSerializer Or Copy the cached output stream to the "real"
+     * Replace the original stream with the new one, optionally copying the content of the old one
+     * into the new one.
+     * When with Attachment, needs to replace the xml writer stream with the stream used by
+     * AttachmentSerializer or copy the cached output stream to the "real"
      * output stream, i.e. onto the wire.
      * 
-     * @param realOS
-     *            the real output stream
+     * @param out the new output stream
+     * @param copyOldContent flag indicating if the old content should be copied
      * @throws IOException
      */
     public void resetOut(OutputStream out, boolean copyOldContent) throws IOException {

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Attachment.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Attachment.java?view=diff&rev=506536&r1=506535&r2=506536
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Attachment.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Attachment.java Mon Feb 12 08:57:58 2007
@@ -43,7 +43,7 @@
      * serialization of the attachment. If true, it will be serialized
      * as binary data, and not Base64Binary.
      * 
-     * @return
+     * @return true iff this attachment is an XOP package
      */
     boolean isXOP();
 }

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Exchange.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Exchange.java?view=diff&rev=506536&r1=506535&r2=506536
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Exchange.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Exchange.java Mon Feb 12 08:57:58 2007
@@ -74,15 +74,15 @@
     /**
      * Convenience method for storing/retrieving typed objects from the map.
      * equivalent to:  (T)get(key.getName());
-     * @param <T> key
-     * @return
+     * @param key the key
+     * @return the value
      */
     <T> T get(Class<T> key);
     /**
      * Convenience method for storing/retrieving typed objects from the map.
      * equivalent to:  put(key.getName(), value);
-     * @param <T> key
-     * @return
+     * @param key the key
+     * @param value the value
      */
     <T> void put(Class<T> key, T value);
 }

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Message.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Message.java?view=diff&rev=506536&r1=506535&r2=506536
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Message.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Message.java Mon Feb 12 08:57:58 2007
@@ -114,15 +114,15 @@
     /**
      * Convenience method for storing/retrieving typed objects from the map.
      * equivalent to:  (T)get(key.getName());
-     * @param <T> key
-     * @return
+     * @param key the key
+     * @return the value
      */
     <T> T get(Class<T> key);
     /**
      * Convenience method for storing/retrieving typed objects from the map.
      * equivalent to:  put(key.getName(), value);
-     * @param <T> key
-     * @return
+     * @param key the key
+     * @param value the value
      */
     <T> void put(Class<T> key, T value);
     

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptor.java?view=diff&rev=506536&r1=506535&r2=506536
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptor.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptor.java Mon Feb 12 08:57:58 2007
@@ -36,23 +36,27 @@
 public interface PhaseInterceptor<T extends Message> extends Interceptor<T> {
 
     /**
-     * A Set of IDs that this interceptor needs to run after.
-     * @return
+     * Returns a set of IDs specifying the interceptors that should be run after this interceptor.
+     * @return the ids of the interceptors to be run after
      */
     Set<String> getAfter();
 
     /**
-     * A Set of IDs that this interceptor needs to run before.
-     * @return
+     * Returns a set of IDs specifying the interceptors that should be run before this interceptor.
+     * @return the ids of the interceptors to be run before
      */
     Set<String> getBefore();
 
     /**
-     * The ID of the interceptor.
-     * @return
+     * The ID of this interceptor.
+     * @return the id
      */
     String getId();
 
+    /**
+     * The phase of this interceptor.
+     * @return the phase
+     */
     String getPhase();
 
 }

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java?view=diff&rev=506536&r1=506535&r2=506536
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java Mon Feb 12 08:57:58 2007
@@ -150,9 +150,9 @@
     
 
     /**
-     * Invokes each phase's handler in turn.
+     * Intercept a message, invoking each phase's handlers in turn.
      * 
-     * @param context
+     * @param message the message 
      * @throws Exception
      */
     @SuppressWarnings("unchecked")
@@ -205,10 +205,11 @@
     }
     
     /**
-     * Invokes each phase's handler in turn. Start after the Interceptor
-     * specified
+     * Intercept a message, invoking each phase's handlers in turn,
+     * starting after the specified interceptor.
      * 
-     * @param context
+     * @param message the message
+     * @param startingAfterInterceptorID the id of the interceptor 
      * @throws Exception
      */
     @SuppressWarnings("unchecked")
@@ -223,11 +224,11 @@
     }
     
     /**
-     * Invokes following inteceptors in a sub chain until the last chain in the
-     * sub chain calls finishSubChain, which makes the flow continues in the
+     * Invokes the following inteceptors in a sub chain until the last chain in the
+     * sub chain calls finishSubChain, which makes the flow continue in the
      * main chain.
      * 
-     * @param context
+     * @param message the message
      * @throws Exception
      */
     @SuppressWarnings("unchecked")

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractMessageContainer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractMessageContainer.java?view=diff&rev=506536&r1=506535&r2=506536
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractMessageContainer.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractMessageContainer.java Mon Feb 12 08:57:58 2007
@@ -61,8 +61,8 @@
     /**
      * Adds a message part to this container.
      *
-     * @param name  the qualified name of the message part.
-     * @param clazz the type of the message part.
+     * @param name  the qualified name of the message part
+     * @return name  the newly created <code>MessagePartInfo</code> object
      */
     public MessagePartInfo addMessagePart(QName name) {
         if (name == null) {

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractPropertiesHolder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractPropertiesHolder.java?view=diff&rev=506536&r1=506535&r2=506536
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractPropertiesHolder.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractPropertiesHolder.java Mon Feb 12 08:57:58 2007
@@ -105,11 +105,9 @@
      * (i.e. an EndpointInfo or ServiceInfo), or it may be a property on the Bus itself.
      * If no value is found, the defaultValue is returned.
      * 
-     * @param <T>
-     * @param props
-     * @param defaultValue
-     * @param type
-     * @return
+     * @param defaultValue the default value
+     * @param type the extensor type
+     * @return the configuration value or the default
      */
     public <T> T getTraversedExtensor(T defaultValue, Class<T> type) {
         T extensor = getExtensor(type);

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/BindingInfo.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/BindingInfo.java?view=diff&rev=506536&r1=506535&r2=506536
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/BindingInfo.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/BindingInfo.java Mon Feb 12 08:57:58 2007
@@ -105,7 +105,7 @@
     /**
      * Returns the operation info with the given name, if found.
      *
-     * @param name the name.
+     * @param oname the name.
      * @return the operation; or <code>null</code> if not found.
      */
     public BindingOperationInfo getOperation(QName oname) {

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/InterfaceInfo.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/InterfaceInfo.java?view=diff&rev=506536&r1=506535&r2=506536
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/InterfaceInfo.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/InterfaceInfo.java Mon Feb 12 08:57:58 2007
@@ -60,7 +60,7 @@
     /**
      * Adds an operation to this service.
      *
-     * @param name the qualified name of the operation.
+     * @param oname the qualified name of the operation.
      * @return the operation.
      */
     public OperationInfo addOperation(QName oname) {
@@ -90,7 +90,7 @@
     /**
      * Returns the operation info with the given name, if found.
      *
-     * @param name the name.
+     * @param oname the name.
      * @return the operation; or <code>null</code> if not found.
      */
     public OperationInfo getOperation(QName oname) {

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java?view=diff&rev=506536&r1=506535&r2=506536
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java Mon Feb 12 08:57:58 2007
@@ -47,7 +47,7 @@
         return pname;
     }
     /**
-     * @param name The name to set.
+     * @param n The name to set.
      */
     public void setName(QName n) {
         pname = n;

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/WSAContextUtils.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/WSAContextUtils.java?view=diff&rev=506536&r1=506535&r2=506536
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/WSAContextUtils.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/WSAContextUtils.java Mon Feb 12 08:57:58 2007
@@ -55,8 +55,8 @@
     /**
      * Retrieve UsingAddressing override flag from the context
      *
-     * @param override true if UsingAddressing should be overridden
      * @param message the current message
+     * @return true if UsingAddressing should be overridden
      */   
     public static boolean retrieveUsingAddressing(Message message) {
         Boolean override = (Boolean)message.get(USING_PROPERTY);
@@ -79,7 +79,7 @@
      *
      * @param conduit the Conduit if available
      * @param message the current message
-     * @returned the retrieved EPR
+     * @return the retrieved EPR
      */
     public static EndpointReferenceType retrieveTo(Conduit conduit,
                                                    Message message) {
@@ -108,7 +108,7 @@
      *
      * @param conduit the Conduit if available
      * @param message the current message
-     * @returned the retrieved EPR
+     * @return the retrieved EPR
      */
     public static EndpointReferenceType retrieveReplyTo(Conduit conduit,
                                                         Message message) {

Added: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/PolicyBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/PolicyBuilder.java?view=auto&rev=506536
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/PolicyBuilder.java (added)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/PolicyBuilder.java Mon Feb 12 08:57:58 2007
@@ -0,0 +1,48 @@
+/**
+ * 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 org.w3c.dom.Element;
+
+import org.apache.neethi.Policy;
+import org.apache.neethi.PolicyReference;
+
+
+/**
+ * PolicyBuilder provides methods to create Policy and PolicyReferenceObjects
+ * from DOM elements.
+ */
+public interface PolicyBuilder {
+    /**
+     * Creates a PolicyReference object from a DOM element.
+     * 
+     * @param element the element
+     * @return the PolicyReference object constructed from the element
+     */
+    PolicyReference getPolicyReference(Element element);
+    
+    /**
+     * Creates a Policy object from an DOM element.
+     * 
+     * @param element the element
+     * @return the Policy object constructed from the element
+     */
+    Policy getPolicy(Element element);
+}

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

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

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/builders/jaxb/JaxbAssertionBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/builders/jaxb/JaxbAssertionBuilder.java?view=diff&rev=506536&r1=506363&r2=506536
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/builders/jaxb/JaxbAssertionBuilder.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/builders/jaxb/JaxbAssertionBuilder.java Mon Feb 12 08:57:58 2007
@@ -70,7 +70,7 @@
     
     /**
     * Constructs a JAXBAssertionBuilder from the specified class and schema type. 
-    * @param class the class to which the schema type is mapped
+    * @param type the class to which the schema type is mapped
     * @param qn the schema type
     * @throws JAXBException
     * @throws ClassNotFoundException

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/builders/primitive/NestedPrimitiveAssertionBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/builders/primitive/NestedPrimitiveAssertionBuilder.java?view=diff&rev=506536&r1=506363&r2=506536
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/builders/primitive/NestedPrimitiveAssertionBuilder.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/builders/primitive/NestedPrimitiveAssertionBuilder.java Mon Feb 12 08:57:58 2007
@@ -21,20 +21,20 @@
 
 import org.w3c.dom.Element;
 
-import org.apache.cxf.ws.policy.PolicyEngine;
+import org.apache.cxf.ws.policy.PolicyBuilder;
 import org.apache.neethi.Assertion;
 
 public class NestedPrimitiveAssertionBuilder extends PrimitiveAssertionBuilder {
 
-    private PolicyEngine engine;
+    private PolicyBuilder builder;
     
-    public void setPolicyEngine(PolicyEngine e) {
-        engine = e;
+    public void setPolicyBuilder(PolicyBuilder b) {
+        builder = b;
     }
     
     @Override
     public Assertion build(Element elem) {
-        return new NestedPrimitiveAssertion(elem, engine.getBuilder());      
+        return new NestedPrimitiveAssertion(elem, builder); 
     }
     
     

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/builders/xml/XmlPrimitiveAssertion.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/builders/xml/XmlPrimitiveAssertion.java?view=diff&rev=506536&r1=506363&r2=506536
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/builders/xml/XmlPrimitiveAssertion.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/builders/xml/XmlPrimitiveAssertion.java Mon Feb 12 08:57:58 2007
@@ -39,7 +39,7 @@
     /**
      * Constructs a XmlPrimitiveAssertion from an xml element.
      * 
-     * @param element the xml element
+     * @param e the xml element
      */
     public XmlPrimitiveAssertion(Element e) {
         super(e);

Copied: incubator/cxf/trunk/api/src/test/java/org/apache/cxf/ws/policy/builders/jaxb/JaxbAssertionBuilderTest.java (from r506363, incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/builders/jaxb/JaxbAssertionBuilderTest.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/test/java/org/apache/cxf/ws/policy/builders/jaxb/JaxbAssertionBuilderTest.java?view=diff&rev=506536&p1=incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/builders/jaxb/JaxbAssertionBuilderTest.java&r1=506363&p2=incubator/cxf/trunk/api/src/test/java/org/apache/cxf/ws/policy/builders/jaxb/JaxbAssertionBuilderTest.java&r2=506536
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/builders/jaxb/JaxbAssertionBuilderTest.java (original)
+++ incubator/cxf/trunk/api/src/test/java/org/apache/cxf/ws/policy/builders/jaxb/JaxbAssertionBuilderTest.java Mon Feb 12 08:57:58 2007
@@ -46,7 +46,7 @@
             // expected
         }
         assertNotNull(new JaxbAssertionBuilder(qn)); 
-        assertNotNull(new JaxbAssertionBuilder("org.apache.cxf.test.assertions.foo.FooType", qn));   
+        assertNotNull(new JaxbAssertionBuilder(FooType.class.getName(), qn));   
         assertNotNull(new JaxbAssertionBuilder<FooType>(FooType.class, qn));
     }
     
@@ -74,5 +74,4 @@
         assertEquals("CXF", foo.getName());
         assertEquals(2, foo.getNumber().intValue());         
     }
-
 }

Added: incubator/cxf/trunk/api/src/test/java/org/apache/cxf/ws/policy/builders/primitive/NestedPrimitiveAssertionBuilderTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/test/java/org/apache/cxf/ws/policy/builders/primitive/NestedPrimitiveAssertionBuilderTest.java?view=auto&rev=506536
==============================================================================
--- incubator/cxf/trunk/api/src/test/java/org/apache/cxf/ws/policy/builders/primitive/NestedPrimitiveAssertionBuilderTest.java (added)
+++ incubator/cxf/trunk/api/src/test/java/org/apache/cxf/ws/policy/builders/primitive/NestedPrimitiveAssertionBuilderTest.java Mon Feb 12 08:57:58 2007
@@ -0,0 +1,98 @@
+/**
+ * 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.builders.primitive;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.util.Collections;
+
+import javax.xml.namespace.QName;
+
+import org.w3c.dom.Element;
+
+import junit.framework.TestCase;
+
+import org.apache.cxf.helpers.DOMUtils;
+import org.apache.cxf.ws.policy.PolicyBuilder;
+import org.apache.cxf.ws.policy.PolicyException;
+import org.apache.neethi.Policy;
+import org.easymock.classextension.EasyMock;
+import org.easymock.classextension.IMocksControl;
+
+
+/**
+ * 
+ */
+public class NestedPrimitiveAssertionBuilderTest extends TestCase {
+
+    private static final String TEST_NAMESPACE = "http://www.w3.org/2007/01/addressing/metadata";
+    private static final QName TEST_NAME1 = new QName(TEST_NAMESPACE, "Addressing");
+
+    private NestedPrimitiveAssertionBuilder npab;
+    private IMocksControl control;
+    private PolicyBuilder builder;
+    
+    public void setUp() {
+        control = EasyMock.createNiceControl();
+        npab = new NestedPrimitiveAssertionBuilder();
+        npab.setKnownElements(Collections.singletonList(TEST_NAME1));
+        builder = control.createMock(PolicyBuilder.class);
+        npab.setPolicyBuilder(builder);        
+    }
+    
+    public void tearDown() {        
+    }
+    
+    public void testBuildFail() throws Exception {
+        String data = 
+            "<wsam:Addressing wsp:Optional=\"true\""
+            + " xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\""
+            + " xmlns:wsam=\"http://www.w3.org/2007/01/addressing/metadata\" />";
+        
+        try {
+            npab.build(getElement(data));
+            fail("Expected PolicyException not thrown.");
+        } catch (PolicyException ex) {
+            // expected
+        }
+    }
+    
+    public void testBuild() throws Exception {
+        String data = 
+            "<wsam:Addressing wsp:Optional=\"true\""
+            + " xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\""
+            + " xmlns:wsam=\"http://www.w3.org/2007/01/addressing/metadata\">"
+            + "<wsp:Policy/></wsam:Addressing>";
+ 
+        Policy nested = control.createMock(Policy.class);
+        EasyMock.expect(builder.getPolicy(EasyMock.isA(Element.class))).andReturn(nested);
+        control.replay();
+        NestedPrimitiveAssertion npc = (NestedPrimitiveAssertion)npab.build(getElement(data));
+        assertEquals(TEST_NAME1, npc.getName());
+        assertSame(nested, npc.getNested());
+        assertTrue(npc.isOptional());
+        control.verify();
+    }
+    
+    Element getElement(String data) throws Exception {
+        InputStream is = new ByteArrayInputStream(data.getBytes());
+        return DOMUtils.readXml(is).getDocumentElement();
+    }
+}

Propchange: incubator/cxf/trunk/api/src/test/java/org/apache/cxf/ws/policy/builders/primitive/NestedPrimitiveAssertionBuilderTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/api/src/test/java/org/apache/cxf/ws/policy/builders/primitive/NestedPrimitiveAssertionBuilderTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

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=506536&r1=506535&r2=506536
==============================================================================
--- incubator/cxf/trunk/rt/ws/addr/pom.xml (original)
+++ incubator/cxf/trunk/rt/ws/addr/pom.xml Mon Feb 12 08:57:58 2007
@@ -65,11 +65,6 @@
             <artifactId>cxf-rt-bindings-soap</artifactId>
             <version>${project.version}</version>
         </dependency>
-        <dependency>
-            <groupId>org.apache.cxf</groupId>
-            <artifactId>cxf-rt-ws-policy</artifactId>
-            <version>${project.version}</version>
-        </dependency>
 
         <dependency>
             <groupId>org.apache.cxf</groupId>

Modified: incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/policy/AddressingAssertionBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/policy/AddressingAssertionBuilder.java?view=diff&rev=506536&r1=506535&r2=506536
==============================================================================
--- incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/policy/AddressingAssertionBuilder.java (original)
+++ incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/policy/AddressingAssertionBuilder.java Mon Feb 12 08:57:58 2007
@@ -27,9 +27,10 @@
 import org.w3c.dom.Attr;
 import org.w3c.dom.Element;
 
+import org.apache.cxf.Bus;
 import org.apache.cxf.ws.policy.AssertionBuilder;
+import org.apache.cxf.ws.policy.PolicyBuilder;
 import org.apache.cxf.ws.policy.PolicyConstants;
-import org.apache.cxf.ws.policy.PolicyEngine;
 import org.apache.cxf.ws.policy.builders.primitive.NestedPrimitiveAssertion;
 import org.apache.cxf.ws.policy.builders.primitive.PrimitiveAssertion;
 import org.apache.neethi.Assertion;
@@ -40,10 +41,10 @@
 public class AddressingAssertionBuilder implements AssertionBuilder {
 
     private static final Collection<QName> KNOWN = new ArrayList<QName>();
-    private PolicyEngine engine;
+    private Bus bus;
     
-    public AddressingAssertionBuilder(PolicyEngine e) {
-        engine = e;
+    public AddressingAssertionBuilder(Bus b) {
+        bus = b;
     }
     
     static {
@@ -65,7 +66,8 @@
             optional = Boolean.valueOf(attribute.getValue());
         }
         if (MetadataConstants.getAddressingAssertionQName().getLocalPart().equals(localName)) {
-            return new NestedPrimitiveAssertion(elem, engine.getBuilder());
+            PolicyBuilder builder = bus.getExtension(PolicyBuilder.class);
+            return new NestedPrimitiveAssertion(elem, builder);
         } else if (MetadataConstants.getAnonymousResponsesAssertionQName().getLocalPart()
             .equals(localName)) {
             return new PrimitiveAssertion(MetadataConstants.getAnonymousResponsesAssertionQName(), 

Modified: incubator/cxf/trunk/rt/ws/addr/src/main/resources/META-INF/cxf/cxf-extension-addr.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/addr/src/main/resources/META-INF/cxf/cxf-extension-addr.xml?view=diff&rev=506536&r1=506535&r2=506536
==============================================================================
--- incubator/cxf/trunk/rt/ws/addr/src/main/resources/META-INF/cxf/cxf-extension-addr.xml (original)
+++ incubator/cxf/trunk/rt/ws/addr/src/main/resources/META-INF/cxf/cxf-extension-addr.xml Mon Feb 12 08:57:58 2007
@@ -23,7 +23,7 @@
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
     
     <bean class="org.apache.cxf.ws.addressing.policy.AddressingAssertionBuilder">
-        <constructor-arg ref="org.apache.cxf.ws.policy.PolicyEngine"/>
+        <constructor-arg ref="cxf"/>
     </bean>
     
     

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=506536&r1=506535&r2=506536
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/pom.xml (original)
+++ incubator/cxf/trunk/rt/ws/policy/pom.xml Mon Feb 12 08:57:58 2007
@@ -115,21 +115,6 @@
                             <goal>xsdtojava</goal>
                         </goals>
                     </execution>
-                    <execution>
-                        <id>generate-test-sources</id>
-                        <phase>generate-test-sources</phase>
-                        <configuration>
-                            <testSourceRoot>${basedir}/target/generated/src/test/java</testSourceRoot>
-                            <xsdOptions>
-                                <xsdOption>
-                                    <xsd>${basedir}/src/test/resources/schemas/foo.xsd</xsd>
-                                </xsdOption>
-                            </xsdOptions>
-                        </configuration>
-                        <goals>
-                            <goal>xsdtojava</goal>
-                        </goals>
-                    </execution>
                 </executions>
             </plugin>
             <plugin>

Copied: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyBuilderImpl.java (from r506363, incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyBuilder.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyBuilderImpl.java?view=diff&rev=506536&p1=incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyBuilder.java&r1=506363&p2=incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyBuilderImpl.java&r2=506536
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyBuilder.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyBuilderImpl.java Mon Feb 12 08:57:58 2007
@@ -34,6 +34,7 @@
 
 import org.apache.cxf.common.i18n.BundleUtils;
 import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.extension.BusExtension;
 import org.apache.cxf.helpers.DOMUtils;
 import org.apache.neethi.All;
 import org.apache.neethi.Assertion;
@@ -43,20 +44,22 @@
 import org.apache.neethi.PolicyOperator;
 import org.apache.neethi.PolicyReference;
 
+
 /**
- * PolicyBuilder provides methods to create Policy and PolicyReferenceObjects
- * from an inout stream, an xml element etc.
- * It maintains a reference to the PolicyManager so that is can use the 
- * AssertionBuilderFactories registered with the PolicyManager when creating a
- * Policy object from an xml element.
+ * PolicyBuilderImpl is an implementation of the PolicyBuilder interface,
+ * provides methods to create Policy and PolicyReferenceObjects
+ * from DOM elements, but also from an input stream etc.
  */
-public class PolicyBuilder {
+public class PolicyBuilderImpl implements PolicyBuilder, BusExtension {
     
-    private static final ResourceBundle BUNDLE = BundleUtils.getBundle(PolicyBuilder.class);
+    private static final ResourceBundle BUNDLE = BundleUtils.getBundle(PolicyBuilderImpl.class);
  
     private AssertionBuilderRegistry assertionBuilderRegistry;
    
-    
+    public Class getRegistrationType() {
+        return PolicyBuilder.class;
+    }
+ 
     public void setAssertionBuilderRegistry(AssertionBuilderRegistry abr) {
         assertionBuilderRegistry = abr;        
     }
@@ -64,7 +67,8 @@
     public AssertionBuilderRegistry getAssertionBuilderRegistry() {
         return assertionBuilderRegistry;        
     }
-    
+
+
     /**
      * Creates a PolicyReference object from an InputStream.
      * 
@@ -78,9 +82,9 @@
     }
     
     /**
-     * Creates a PolicyReference object from an xml element.
+     * Creates a PolicyReference object from a DOM element.
      * 
-     * @param element the xml element
+     * @param element the element
      * @return the PolicyReference object constructed from the element
      */
     public PolicyReference getPolicyReference(Element element) {
@@ -90,15 +94,7 @@
         }
 
         PolicyReference reference = new PolicyReference();
-        
-        // setting the URI value
-        String uri = element.getAttribute("URI");
-        /*
-        if (uri.startsWith("#")) {
-            uri = element.getBaseURI() + uri;
-        }
-        */
-        reference.setURI(uri);
+        reference.setURI(element.getAttribute("URI"));
         return reference;
     }
     
@@ -115,9 +111,9 @@
     }
     
     /**
-     * Creates a Policy object from an xml element.
+     * Creates a Policy object from a DOM element.
      * 
-     * @param element the xml element
+     * @param element the element
      * @retun the Policy object constructed from the element
      */
     public Policy getPolicy(Element element) {

Modified: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngine.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngine.java?view=diff&rev=506536&r1=506535&r2=506536
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngine.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngine.java Mon Feb 12 08:57:58 2007
@@ -46,7 +46,6 @@
 public class PolicyEngine implements BusExtension {
     
     private Bus bus;
-    private PolicyBuilder builder;
     private PolicyRegistry registry;
     private List<PolicyProvider> policyProviders;
 
@@ -73,14 +72,6 @@
         return policyProviders;
     }
     
-    public void setBuilder(PolicyBuilder b) {
-        builder = b;
-    }
-    
-    public PolicyBuilder getBuilder() {
-        return builder;
-    }
-    
     public void setRegistry(PolicyRegistry r) {
         registry = r;
     }
@@ -94,18 +85,13 @@
         if (null == registry) {
             registry = new PolicyRegistryImpl();
         }
-        
-        if (null == builder && null != bus) {
-            builder = new PolicyBuilder();
-            builder.setAssertionBuilderRegistry(bus.getExtension(AssertionBuilderRegistry.class));
-        }
-
-        if (null == policyProviders) {
+      
+        if (null == policyProviders && null != bus) {
             // TODO:
             // include attachment provider for wsdl 2.0 and
             // for external attachments
             Wsdl11AttachmentPolicyProvider wpp = new Wsdl11AttachmentPolicyProvider();
-            wpp.setBuilder(builder);
+            wpp.setBuilder(bus.getExtension(PolicyBuilder.class));
             wpp.setRegistry(registry);
             policyProviders = Collections.singletonList((PolicyProvider)wpp);
         } 

Modified: incubator/cxf/trunk/rt/ws/policy/src/main/resources/META-INF/cxf/cxf-extension-policy.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/main/resources/META-INF/cxf/cxf-extension-policy.xml?view=diff&rev=506536&r1=506535&r2=506536
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/main/resources/META-INF/cxf/cxf-extension-policy.xml (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/main/resources/META-INF/cxf/cxf-extension-policy.xml Mon Feb 12 08:57:58 2007
@@ -39,7 +39,11 @@
             </bean>
         </constructor-arg>
     </bean>
-    
+
+    <bean id="org.apache.cxf.ws.policy.PolicyBuilder" class="org.apache.cxf.ws.policy.PolicyBuilderImpl">
+        <property name="assertionBuilderRegistry" ref="org.apache.cxf.ws.policy.AssertionBuilderRegistry"/>
+    </bean>
+  
     <bean class="org.apache.cxf.ws.policy.PolicyEngine">
        <property name="bus" ref="cxf"/>
     </bean>

Modified: incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/NormalizeTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/NormalizeTest.java?view=diff&rev=506536&r1=506535&r2=506536
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/NormalizeTest.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/NormalizeTest.java Mon Feb 12 08:57:58 2007
@@ -33,7 +33,7 @@
     
     public void testNormalise() throws Exception {
         
-        PolicyBuilder builder = new PolicyBuilder();
+        PolicyBuilderImpl builder = new PolicyBuilderImpl();
         AssertionBuilderRegistry abr = new AssertionBuilderRegistryImpl();
         builder.setAssertionBuilderRegistry(abr);
         AssertionBuilder ab = new XMLPrimitiveAssertionBuilder(); 

Modified: incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyBuilderTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyBuilderTest.java?view=diff&rev=506536&r1=506535&r2=506536
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyBuilderTest.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyBuilderTest.java Mon Feb 12 08:57:58 2007
@@ -35,10 +35,10 @@
 
 public class PolicyBuilderTest extends TestCase {
     
-    private PolicyBuilder builder;
+    private PolicyBuilderImpl builder;
     
     public void setUp() {
-        builder = new PolicyBuilder();
+        builder = new PolicyBuilderImpl();
         AssertionBuilderRegistry abr = new AssertionBuilderRegistryImpl();
         builder.setAssertionBuilderRegistry(abr);
         AssertionBuilder ab = new XMLPrimitiveAssertionBuilder();

Modified: incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java?view=diff&rev=506536&r1=506535&r2=506536
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java Mon Feb 12 08:57:58 2007
@@ -36,6 +36,7 @@
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.transport.Conduit;
 import org.apache.neethi.Policy;
+import org.apache.neethi.PolicyRegistry;
 import org.easymock.classextension.EasyMock;
 import org.easymock.classextension.IMocksControl;
 
@@ -53,31 +54,30 @@
     
     public void testAccessors() {
         engine = new PolicyEngine();
-        assertNull(engine.getBuilder());
         assertNull(engine.getPolicyProviders());
-        PolicyBuilder builder = control.createMock(PolicyBuilder.class);
-        engine.setBuilder(builder);
+        assertNull(engine.getRegistry());
         Bus bus = control.createMock(Bus.class);
         engine.setBus(bus);
         List<PolicyProvider> providers = CastUtils.cast(Collections.EMPTY_LIST, PolicyProvider.class);
         engine.setPolicyProviders(providers);
-        assertSame(builder, engine.getBuilder());
+        PolicyRegistry reg = control.createMock(PolicyRegistry.class);
+        engine.setRegistry(reg);
         assertSame(bus, engine.getBus());
         assertSame(providers, engine.getPolicyProviders());
+        assertSame(reg, engine.getRegistry());
     }
     
     public void testInit() {  
         engine = new PolicyEngine();
         Bus bus = control.createMock(Bus.class);
         engine.setBus(bus);
-        AssertionBuilderRegistry abr = control.createMock(AssertionBuilderRegistry.class);
-        EasyMock.expect(bus.getExtension(AssertionBuilderRegistry.class)).andReturn(abr);
-        control.replay();
+        PolicyBuilder pb = control.createMock(PolicyBuilder.class);
+        EasyMock.expect(bus.getExtension(PolicyBuilder.class)).andReturn(pb);
+        control.replay(); 
         engine.init();
-        assertSame(bus, engine.getBus());
         assertEquals(1, engine.getPolicyProviders().size());
-        assertNotNull(engine.getBuilder());
-        control.verify();    
+        assertNotNull(engine.getRegistry());
+        control.verify();
     }
     
     public void testAddBusInterceptors() {        

Modified: incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyExtensionsTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyExtensionsTest.java?view=diff&rev=506536&r1=506535&r2=506536
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyExtensionsTest.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyExtensionsTest.java Mon Feb 12 08:57:58 2007
@@ -64,12 +64,11 @@
             
             PolicyEngine engine = bus.getExtension(PolicyEngine.class);
             assertNotNull(engine);            
-            PolicyBuilder builder = engine.getBuilder();
-            assertNotNull(builder);
-            assertSame(abr, builder.getAssertionBuilderRegistry());
             assertNotNull(engine.getPolicyProviders());
             assertNotNull(engine.getRegistry());
-            
+
+            PolicyBuilder builder = bus.getExtension(PolicyBuilder.class);
+            assertNotNull(builder);
             
         } finally {
             if (null != bus) {

Modified: incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProviderTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProviderTest.java?view=diff&rev=506536&r1=506535&r2=506536
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProviderTest.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProviderTest.java Mon Feb 12 08:57:58 2007
@@ -41,7 +41,7 @@
 import org.apache.cxf.ws.policy.AssertionBuilder;
 import org.apache.cxf.ws.policy.AssertionBuilderRegistry;
 import org.apache.cxf.ws.policy.AssertionBuilderRegistryImpl;
-import org.apache.cxf.ws.policy.PolicyBuilder;
+import org.apache.cxf.ws.policy.PolicyBuilderImpl;
 import org.apache.cxf.ws.policy.PolicyException;
 import org.apache.cxf.ws.policy.PolicyRegistryImpl;
 import org.apache.cxf.ws.policy.builders.xml.XMLPrimitiveAssertionBuilder;
@@ -135,7 +135,7 @@
         abr.register(new QName("http://cxf.apache.org/test/assertions", "B"), ab);
         abr.register(new QName("http://cxf.apache.org/test/assertions", "C"), ab);
         
-        PolicyBuilder pb = new PolicyBuilder(); 
+        PolicyBuilderImpl pb = new PolicyBuilderImpl(); 
         pb.setAssertionBuilderRegistry(abr);
         app = new Wsdl11AttachmentPolicyProvider();
         app.setBuilder(pb);

Modified: incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/builders/primitive/NestedPrimitiveAssertionTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/builders/primitive/NestedPrimitiveAssertionTest.java?view=diff&rev=506536&r1=506535&r2=506536
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/builders/primitive/NestedPrimitiveAssertionTest.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/builders/primitive/NestedPrimitiveAssertionTest.java Mon Feb 12 08:57:58 2007
@@ -30,9 +30,7 @@
 
 import org.apache.cxf.ws.policy.AssertionBuilderRegistry;
 import org.apache.cxf.ws.policy.AssertionBuilderRegistryImpl;
-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.PolicyBuilderImpl;
 import org.apache.cxf.ws.policy.util.PolicyComparator;
 import org.apache.neethi.Assertion;
 import org.apache.neethi.Policy;
@@ -49,17 +47,15 @@
     private static final QName TEST_NAME2 = new QName(TEST_NAMESPACE, "AnonymousResponses");
     private static final QName TEST_NAME3 = new QName(TEST_NAMESPACE, "NonAnonymousResponses");
 
-    private PolicyBuilder builder;
+    private PolicyBuilderImpl builder;
     
     public void setUp() {
         AssertionBuilderRegistry abr = new AssertionBuilderRegistryImpl();
-        builder = new PolicyBuilder();
+        builder = new PolicyBuilderImpl();
         builder.setAssertionBuilderRegistry(abr);
-        PolicyEngine engine = new PolicyEngine();
-        engine.setBuilder(builder);
         
         NestedPrimitiveAssertionBuilder npab = new NestedPrimitiveAssertionBuilder();
-        npab.setPolicyEngine(engine);
+        npab.setPolicyBuilder(builder);
         npab.setKnownElements(Collections.singletonList(TEST_NAME1));
         abr.register(TEST_NAME1, npab);
         
@@ -70,17 +66,6 @@
         pab.setKnownElements(known);
         abr.register(TEST_NAME2, pab);
         abr.register(TEST_NAME3, pab); 
-    }
-    
-    public void testBuildFail() throws Exception {
-        String resource = "resources/compact0.xml";
-        InputStream is = NestedPrimitiveAssertionTest.class.getResourceAsStream(resource);
-        try {
-            builder.getPolicy(is);
-            fail("Expected PolicyException not thrown.");
-        } catch (PolicyException ex) {
-            // expected
-        }
     }
     
     public void testBuildNonNested() throws Exception {

Modified: incubator/cxf/trunk/rt/ws/rm/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/pom.xml?view=diff&rev=506536&r1=506535&r2=506536
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/pom.xml (original)
+++ incubator/cxf/trunk/rt/ws/rm/pom.xml Mon Feb 12 08:57:58 2007
@@ -53,13 +53,6 @@
             <artifactId>cxf-rt-bindings-soap</artifactId>
             <version>${project.version}</version>
         </dependency>
-        <!--
-        -->
-        <dependency>
-            <groupId>org.apache.cxf</groupId>
-            <artifactId>cxf-rt-ws-policy</artifactId>
-            <version>${project.version}</version>
-        </dependency>
         <dependency>
             <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-rt-ws-addr</artifactId>