cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r733582 - in /cxf/trunk: api/src/main/java/org/apache/cxf/endpoint/Client.java rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
Date Mon, 12 Jan 2009 02:23:49 GMT
Author: ningjiang
Date: Sun Jan 11 18:23:48 2009
New Revision: 733582

URL: http://svn.apache.org/viewvc?rev=733582&view=rev
Log:
CXF-1968 applied patch with thanks to William

Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/Client.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/Client.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/Client.java?rev=733582&r1=733581&r2=733582&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/Client.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/Client.java Sun Jan 11 18:23:48 2009
@@ -25,6 +25,7 @@
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.interceptor.InterceptorProvider;
+import org.apache.cxf.message.Exchange;
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.transport.Conduit;
 import org.apache.cxf.transport.MessageObserver;
@@ -34,7 +35,7 @@
     String RESPONSE_CONTEXT = "ResponseContext";
 
     /**
-     * Invokes an operation syncronously
+     * Invokes an operation synchronously
      * @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.
 If the 
@@ -46,7 +47,7 @@
                     Object... params) throws Exception;
     
     /**
-     * Invokes an operation syncronously
+     * Invokes an operation synchronously
      * @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.
 If the 
      * BindingOperationInfo supports unwrapping, it assumes the params are in the "unwrapped"
form.  If 
@@ -58,7 +59,7 @@
 
 
     /**
-     * Invokes an operation syncronously
+     * Invokes an operation synchronously
      * @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
@@ -68,7 +69,7 @@
                     Object... params) throws Exception;
     
     /**
-     * Invokes an operation syncronously
+     * Invokes an operation synchronously
      * @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
@@ -77,7 +78,7 @@
                     Object... params) throws Exception;
     
     /**
-     * Invokes an operation syncronously
+     * Invokes an operation synchronously
      * @param oi  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
@@ -86,7 +87,7 @@
                     Object... params) throws Exception;
 
     /**
-     * Invokes an operation syncronously
+     * Invokes an operation synchronously
      * @param oi  The operation to be invoked
      * @param params  The params that matches the parts of the input message of the operation
      * @param context  Optional (can be null) contextual information for the invocation 
   
@@ -96,9 +97,21 @@
                     Object[] params,
                     Map<String, Object> context) throws Exception;
     
+    /**
+     * Invokes an operation synchronously
+     * @param oi  The operation to be invoked
+     * @param params  The params that matches the parts of the input message of the operation
+     * @param context  Optional (can be null) contextual information for the invocation
+     * @param exchange The Exchange to be used for the invocation     
+     * @return The return values that matche the parts of the output message of the operation
+     */
+    Object[] invoke(BindingOperationInfo oi,
+            Object[] params, 
+            Map<String, Object> context,
+            Exchange exchange) throws Exception;
     
     /**
-     * Invokes an operation asyncronously
+     * Invokes an operation asynchronously
      * @param callback The callback that is called when the response is ready
      * @param operationName The name of the operation to be invoked. The service namespace
will be used
      * when looking up the BindingOperationInfo.
@@ -112,7 +125,7 @@
                     Object... params) throws Exception;
     
     /**
-     * Invokes an operation asyncronously
+     * Invokes an operation asynchronously
      * @param callback The callback that is called when the response is ready
      * @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.
 If the 
@@ -126,7 +139,7 @@
 
 
     /**
-     * Invokes an operation asyncronously
+     * Invokes an operation asynchronously
      * @param callback The callback that is called when the response is ready
      * @param operationName The name of the operation to be invoked. The service namespace
will be used
      * when looking up the BindingOperationInfo.
@@ -138,7 +151,7 @@
                     Object... params) throws Exception;
     
     /**
-     * Invokes an operation asyncronously
+     * Invokes an operation asynchronously
      * @param callback The callback that is called when the response is ready
      * @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
@@ -149,7 +162,7 @@
                     Object... params) throws Exception;    
     
     /**
-     * Invokes an operation asyncronously
+     * Invokes an operation asynchronously
      * @param callback The callback that is called when the response is ready
      * @param oi  The operation to be invoked
      * @param params  The params that matches the parts of the input message of the operation

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java?rev=733582&r1=733581&r2=733582&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java Sun Jan 11 18:23:48
2009
@@ -444,7 +444,10 @@
             if (null != reqContext) {
                 exchange.putAll(reqContext);
             }
-            exchange.setOneWay(oi.getOutput() == null);
+            
+            if (null != oi) {
+                exchange.setOneWay(oi.getOutput() == null);
+            }
     
             exchange.setOutMessage(message);
             
@@ -472,7 +475,7 @@
         }
     }
 
-    private Object[] processResult(Message message, 
+    protected Object[] processResult(Message message, 
                                    Exchange exchange,
                                    BindingOperationInfo oi,
                                    Map<String, Object> resContext) throws Exception
{
@@ -537,7 +540,7 @@
         return null;
     }
 
-    private void setContext(Map<String, Object> ctx, Message message) {
+    protected void setContext(Map<String, Object> ctx, Message message) {
         if (ctx != null) {            
             message.putAll(ctx);
             if (LOG.isLoggable(Level.FINE)) {
@@ -546,7 +549,7 @@
         }        
     }
 
-    private void waitResponse(Exchange exchange) {
+    protected void waitResponse(Exchange exchange) {
         int remaining = synchronousTimeout;
         while (!Boolean.TRUE.equals(exchange.get(FINISHED)) && remaining > 0)
{
             long start = System.currentTimeMillis();
@@ -564,7 +567,7 @@
         }
     }
 
-    private void setParameters(Object[] params, Message message) {
+    protected void setParameters(Object[] params, Message message) {
         MessageContentsList contents = new MessageContentsList(params);
         message.setContent(List.class, contents);
     }
@@ -680,8 +683,10 @@
     protected void setOutMessageProperties(Message message, BindingOperationInfo boi) {
         message.put(Message.REQUESTOR_ROLE, Boolean.TRUE);
         message.put(Message.INBOUND_MESSAGE, Boolean.FALSE);
-        message.put(BindingMessageInfo.class, boi.getInput());
-        message.put(MessageInfo.class, boi.getOperationInfo().getInput());
+        if (null != boi) {
+            message.put(BindingMessageInfo.class, boi.getInput());
+            message.put(MessageInfo.class, boi.getOperationInfo().getInput());
+        }
     }
     
     protected void setExchangeProperties(Exchange exchange,



Mime
View raw message