cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andreasm...@apache.org
Subject svn commit: r519026 - in /incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm: Proxy.java RMEndpoint.java
Date Fri, 16 Mar 2007 15:59:18 GMT
Author: andreasmyth
Date: Fri Mar 16 08:59:17 2007
New Revision: 519026

URL: http://svn.apache.org/viewvc?view=rev&rev=519026
Log:
Small change to RM endpoint to avoid replacing the application's endpoint address (conflicts
with using EPR style domain expressions pertaining to application endpoints in policy attachments).

Modified:
    incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Proxy.java
    incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java

Modified: incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Proxy.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Proxy.java?view=diff&rev=519026&r1=519025&r2=519026
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Proxy.java (original)
+++ incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Proxy.java Fri Mar 16
08:59:17 2007
@@ -219,7 +219,8 @@
         Endpoint endpoint = reliableEndpoint.getEndpoint();
         BindingInfo bi = reliableEndpoint.getBindingInfo();
         
-        Client client = new RMClient(bus, endpoint, reliableEndpoint.getConduit());
+        Client client = new RMClient(bus, endpoint, reliableEndpoint.getConduit(),
+            reliableEndpoint.getReplyTo());
         
         BindingOperationInfo boi = bi.getOperation(oi);
         try {
@@ -237,9 +238,13 @@
     }
     
     class RMClient extends ClientImpl {
-        
-        RMClient(Bus bus, Endpoint endpoint, Conduit conduit) {
+
+        org.apache.cxf.ws.addressing.EndpointReferenceType address;
+
+        RMClient(Bus bus, Endpoint endpoint, Conduit conduit,
+            org.apache.cxf.ws.addressing.EndpointReferenceType a) {
             super(bus, endpoint, conduit);  
+            address = a;
         }
 
         @Override
@@ -248,6 +253,21 @@
             m.getExchange().put(Endpoint.class, Proxy.this.reliableEndpoint.getApplicationEndpoint());
             super.onMessage(m);
         }    
+
+        @Override
+        public Conduit getConduit() {
+            Conduit conduit = null;
+            String originalAddress = endpoint.getEndpointInfo().getAddress();
+            try {
+                if (null != address) {
+                    endpoint.getEndpointInfo().setAddress(address.getAddress().getValue());
+                }
+                conduit = super.getConduit();
+            } finally {
+                endpoint.getEndpointInfo().setAddress(originalAddress);
+            }
+            return conduit;
+        }
     }
     
 

Modified: incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java?view=diff&rev=519026&r1=519025&r2=519026
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java (original)
+++ incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java Fri Mar
16 08:59:17 2007
@@ -20,7 +20,6 @@
 package org.apache.cxf.ws.rm;
 
 import java.util.List;
-import java.util.logging.Logger;
 
 import javax.wsdl.extensions.ExtensibilityElement;
 import javax.xml.bind.JAXBException;
@@ -28,7 +27,6 @@
 
 import org.apache.cxf.binding.soap.model.SoapBindingInfo;
 import org.apache.cxf.binding.soap.model.SoapOperationInfo;
-import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.databinding.DataBinding;
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.jaxb.JAXBDataBinding;
@@ -48,8 +46,6 @@
 
 public class RMEndpoint {
     
-    private static final Logger LOG = LogUtils.getL7dLogger(RMEndpoint.class);
-    
     private static final QName SERVICE_NAME = 
         new QName(RMConstants.getWsdlNamespace(), "SequenceAbstractService");
     private static final QName INTERFACE_NAME = 
@@ -68,6 +64,7 @@
     private final RMManager manager;
     private final Endpoint applicationEndpoint;
     private Conduit conduit;
+    private org.apache.cxf.ws.addressing.EndpointReferenceType replyTo; 
     private Source source;
     private Destination destination;
     private WrappedService service;
@@ -173,11 +170,23 @@
     public Conduit getConduit() {
         return conduit;
     }
+
+    /** 
+     * Returns the replyTo address of the first application request, i.e. the target address
to which to 
+     * send CreateSequence, CreateSequenceResponse and TerminateSequence messages originating
from the
+     * from the server.
+     * @return the replyTo address
+     */
+    org.apache.cxf.ws.addressing.EndpointReferenceType getReplyTo() {
+        return replyTo;
+    }
+    
     
-    void initialise(Conduit c, org.apache.cxf.ws.addressing.EndpointReferenceType replyTo)
{  
+    void initialise(Conduit c, org.apache.cxf.ws.addressing.EndpointReferenceType r) {  
         conduit = c;
+        replyTo = r;
         createService();
-        createEndpoint(replyTo);
+        createEndpoint();
     }
     
     void createService() {
@@ -200,18 +209,13 @@
         service.setInvoker(servant);
     }
 
-    void createEndpoint(org.apache.cxf.ws.addressing.EndpointReferenceType replyTo) {
+    void createEndpoint() {
         ServiceInfo si = service.getServiceInfo();
         buildBindingInfo(si);
         String transportId = applicationEndpoint.getEndpointInfo().getTransportId();
         EndpointInfo ei = new EndpointInfo(si, transportId);
         
-        if (null == replyTo) {
-            ei.setAddress(applicationEndpoint.getEndpointInfo().getAddress());
-        } else {
-            ei.setAddress(replyTo.getAddress().getValue());
-        }
-        LOG.fine("Created endpoint info with address: " + ei.getAddress());
+        ei.setAddress(applicationEndpoint.getEndpointInfo().getAddress());
         
         ei.setName(PORT_NAME);
         ei.setBinding(si.getBinding(BINDING_NAME));



Mime
View raw message