cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From egl...@apache.org
Subject svn commit: r486689 - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/message/ rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ rt/core/src/main/java/org/apache/cxf/interceptor/ rt/core/src/main/java/org/apache/cxf/work...
Date Wed, 13 Dec 2006 15:40:43 GMT
Author: eglynn
Date: Wed Dec 13 07:40:42 2006
New Revision: 486689

URL: http://svn.apache.org/viewvc?view=rev&rev=486689
Log:
Work-around for Jetty issue preventing RM layer sending server-originated
CreateSequence when response sequence offers are supressed

Added:
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/workqueue/OneShotAsyncExecutor.java
  (with props)
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/workqueue/SynchronousExecutor.java
  (with props)
Modified:
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Message.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/ServiceInvokerInterceptor.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointInvocationHandler.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
    incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
    incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/JettyHTTPDestination.java
    incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
    incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java
    incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMInInterceptor.java
    incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/ControlImpl.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/DecoupledClientServerTest.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java

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=486689&r1=486688&r2=486689
==============================================================================
--- 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 Wed Dec 13 07:40:42
2006
@@ -37,6 +37,11 @@
     
     String MIME_HEADERS = "org.apache.cxf.mime.headers";
     
+    String ASYNC_POST_RESPONSE_DISPATCH =
+        "org.apache.cxf.async.post.response.dispatch";
+
+    String DECOUPLED_CHANNEL_MESSAGE = "decoupled.channel.message";
+    
     String USERNAME = Message.class.getName() + ".USERNAME";
     String PASSWORD = Message.class.getName() + ".PASSWORD";
     String PROTOCOL_HEADERS = Message.class.getName() + ".PROTOCOL_HEADERS";

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java?view=diff&rev=486689&r1=486688&r2=486689
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
Wed Dec 13 07:40:42 2006
@@ -42,6 +42,8 @@
 import org.apache.cxf.staxutils.PartialXMLStreamReader;
 import org.apache.cxf.staxutils.StaxUtils;
 
+import static org.apache.cxf.message.Message.DECOUPLED_CHANNEL_MESSAGE;
+
 public class ReadHeadersInterceptor extends AbstractSoapInterceptor {
     private static final Logger LOG = Logger.getLogger(ReadHeadersInterceptor.class.getName());
     private static final ResourceBundle BUNDLE = BundleUtils.getBundle(ReadHeadersInterceptor.class);
@@ -117,7 +119,7 @@
     }
 
     private boolean isDecoupled(SoapMessage message) {
-        Boolean decoupled = (Boolean)message.get("decoupled.channel.message");
+        Boolean decoupled = (Boolean)message.get(DECOUPLED_CHANNEL_MESSAGE);
         return decoupled != null && decoupled.booleanValue(); 
     }
 }

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/ServiceInvokerInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/ServiceInvokerInterceptor.java?view=diff&rev=486689&r1=486688&r2=486689
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/ServiceInvokerInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/ServiceInvokerInterceptor.java
Wed Dec 13 07:40:42 2006
@@ -50,7 +50,7 @@
         final Service service = endpoint.getService();
         final Invoker invoker = service.getInvoker();        
 
-        getExecutor(endpoint).execute(new Runnable() {
+        Runnable invocation = new Runnable() {
 
             public void run() {
 
@@ -68,7 +68,16 @@
                 }
             }
 
-        });
+        };
+        
+        Executor executor = getExecutor(endpoint);
+        if (exchange.get(Executor.class) == executor) {
+            // already executing on the appropriate executor
+            invocation.run();
+        } else {
+            exchange.put(Executor.class, executor);
+            executor.execute(invocation);
+        }
     }
     
     private Object getInvokee(Message message) {

Added: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/workqueue/OneShotAsyncExecutor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/workqueue/OneShotAsyncExecutor.java?view=auto&rev=486689
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/workqueue/OneShotAsyncExecutor.java
(added)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/workqueue/OneShotAsyncExecutor.java
Wed Dec 13 07:40:42 2006
@@ -0,0 +1,47 @@
+/**
+ * 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.workqueue;
+
+import java.util.concurrent.Executor;
+
+/**
+ * Used to provide simple async Executor semantics by creating a one-shot
+ * thread.
+ */
+public final class OneShotAsyncExecutor implements Executor {
+
+    private static final OneShotAsyncExecutor INSTANCE = new
+    OneShotAsyncExecutor();
+    
+    private OneShotAsyncExecutor() {
+    }
+    
+    public void execute(Runnable command) {
+        new Thread(command).start();
+    }
+    
+    public static OneShotAsyncExecutor getInstance() {
+        return INSTANCE;
+    }
+    
+    public static boolean isA(Executor executor) {
+        return executor == INSTANCE; 
+    }
+}

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

Added: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/workqueue/SynchronousExecutor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/workqueue/SynchronousExecutor.java?view=auto&rev=486689
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/workqueue/SynchronousExecutor.java
(added)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/workqueue/SynchronousExecutor.java
Wed Dec 13 07:40:42 2006
@@ -0,0 +1,47 @@
+/**
+ * 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.workqueue;
+
+import java.util.concurrent.Executor;
+
+/**
+ * Used to mimic Executor semantics by hijacking calling thread.
+ * <b>Must</b> be used for Service.getExecutor() return unless a real
+ * (i.e. truely asynchronous) Executor is available.
+ */
+public final class SynchronousExecutor implements Executor {
+
+    private static final SynchronousExecutor INSTANCE = new SynchronousExecutor();
+    
+    private SynchronousExecutor() {
+    }
+    
+    public void execute(Runnable command) {
+        command.run();
+    }
+    
+    public static SynchronousExecutor getInstance() {
+        return INSTANCE;
+    }
+    
+    public static boolean isA(Executor executor) {
+        return executor == INSTANCE; 
+    }
+}

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

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointInvocationHandler.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointInvocationHandler.java?view=diff&rev=486689&r1=486688&r2=486689
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointInvocationHandler.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointInvocationHandler.java
Wed Dec 13 07:40:42 2006
@@ -27,7 +27,6 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.concurrent.Executor;
 import java.util.concurrent.FutureTask;
 import java.util.logging.Logger;
 
@@ -45,6 +44,7 @@
 import org.apache.cxf.jaxws.support.ContextPropertiesMapping;
 import org.apache.cxf.service.factory.MethodDispatcher;
 import org.apache.cxf.service.model.BindingOperationInfo;
+import org.apache.cxf.workqueue.OneShotAsyncExecutor;
 
 public final class EndpointInvocationHandler extends BindingProviderImpl implements InvocationHandler
{
 
@@ -156,11 +156,7 @@
                                                                              context
                                                                              ));
 
-        endpoint.getService().setExecutor(new Executor() {
-            public void execute(Runnable r) {
-                new Thread(r).start();
-            }
-        });
+        endpoint.getService().setExecutor(OneShotAsyncExecutor.getInstance());
         endpoint.getService().getExecutor().execute(f);
         Response<?> r = new AsyncResponse<Object>(f, Object.class);
         if (params.length > 0 && params[params.length - 1] instanceof AsyncHandler)
{

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?view=diff&rev=486689&r1=486688&r2=486689
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
(original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
Wed Dec 13 07:40:42 2006
@@ -60,6 +60,7 @@
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.service.model.TypeInfo;
 import org.apache.cxf.service.model.UnwrappedOperationInfo;
+import org.apache.cxf.workqueue.SynchronousExecutor;
 import org.apache.cxf.wsdl11.WSDLServiceFactory;
 import org.apache.ws.commons.schema.XmlSchema;
 import org.apache.ws.commons.schema.XmlSchemaCollection;
@@ -128,11 +129,7 @@
         if (getExecutor() != null) {
             getService().setExecutor(getExecutor());
         } else {
-            getService().setExecutor(new Executor() {
-                public void execute(Runnable r) {
-                    r.run();
-                }
-            });
+            getService().setExecutor(SynchronousExecutor.getInstance());
         }
 
         getService().put(MethodDispatcher.class.getName(), getMethodDispatcher());

Modified: incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java?view=diff&rev=486689&r1=486688&r2=486689
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
(original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
Wed Dec 13 07:40:42 2006
@@ -62,6 +62,8 @@
 import org.mortbay.http.HttpResponse;
 import org.mortbay.http.handler.AbstractHttpHandler;
 
+import static org.apache.cxf.message.Message.DECOUPLED_CHANNEL_MESSAGE;
+
 /**
  * HTTP Conduit implementation.
  */
@@ -603,7 +605,7 @@
             Message inMessage = new MessageImpl();
             // disposable exchange, swapped with real Exchange on correlation
             inMessage.setExchange(new ExchangeImpl());
-            inMessage.put("decoupled.channel.message", Boolean.TRUE);
+            inMessage.put(DECOUPLED_CHANNEL_MESSAGE, Boolean.TRUE);
             // REVISIT: how to get response headers?
             //inMessage.put(Message.PROTOCOL_HEADERS, req.getXXX());
             setHeaders(inMessage);

Modified: incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/JettyHTTPDestination.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/JettyHTTPDestination.java?view=diff&rev=486689&r1=486688&r2=486689
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/JettyHTTPDestination.java
(original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/JettyHTTPDestination.java
Wed Dec 13 07:40:42 2006
@@ -287,6 +287,7 @@
                 inMessage.put(Message.BASE_PATH, new URL(getAddressValue()).getPath());
             }
             inMessage.put(Message.FIXED_PARAMETER_ORDER, isFixedParameterOrder());
+            inMessage.put(Message.ASYNC_POST_RESPONSE_DISPATCH, Boolean.TRUE); 
             
             setHeaders(inMessage);
 

Modified: incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java?view=diff&rev=486689&r1=486688&r2=486689
==============================================================================
--- incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
(original)
+++ incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
Wed Dec 13 07:40:42 2006
@@ -22,6 +22,7 @@
 
 import java.lang.reflect.Method;
 import java.util.UUID;
+import java.util.concurrent.Executor;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -33,6 +34,7 @@
 import javax.xml.ws.ResponseWrapper;
 import javax.xml.ws.WebFault;
 
+import org.apache.cxf.Bus;
 import org.apache.cxf.binding.soap.model.SoapOperationInfo;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.PackageUtils;
@@ -46,7 +48,11 @@
 import org.apache.cxf.service.model.OperationInfo;
 import org.apache.cxf.transport.Conduit;
 import org.apache.cxf.transport.Destination;
+import org.apache.cxf.workqueue.OneShotAsyncExecutor;
+import org.apache.cxf.workqueue.SynchronousExecutor;
+import org.apache.cxf.workqueue.WorkQueueManager;
 
+import static org.apache.cxf.message.Message.ASYNC_POST_RESPONSE_DISPATCH;
 import static org.apache.cxf.message.Message.REQUESTOR_ROLE;
 
 import static org.apache.cxf.ws.addressing.JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES;
@@ -309,12 +315,12 @@
      * Rebase response on replyTo
      * 
      * @param reference the replyTo reference
-     * @param namespaceURI determines the WS-A version
+     * @param inMAPs the inbound MAPs
      * @param inMessage the current message
      */
     public static void rebaseResponse(EndpointReferenceType reference,
                                       AddressingProperties inMAPs,
-                                      Message inMessage) {
+                                      final Message inMessage) {
         String namespaceURI = inMAPs.getNamespaceURI();
         if (!retrievePartialResponseSent(inMessage)) {
             storePartialResponseSent(inMessage);
@@ -360,27 +366,21 @@
                     if (fullResponse != null) {
                         exchange.setOutMessage(fullResponse);
                     }
-
-                    Object obj = inMessage.get("org.apache.cxf.async.oneway.dispatch");
-                    if (obj != null && Boolean.TRUE.equals(obj)) {
+                    
+                    if (retrieveAsyncPostResponseDispatch(inMessage)) {
+                        // async service invocation required *after* a response
+                        // has been sent (i.e. to a oneway, or a partial response
+                        // to a decoupled twoway)
                         
-                        // pause and resume execution of chain on separate thread
+                        // pause dispatch on current thread ...
                         inMessage.getInterceptorChain().pause();
 
-                        LOG.info("Resuming execution of interceptor chain on separate thread");
-                        
-                        final class FullResponseThread extends Thread {
-                            Message msg;
-                            FullResponseThread(Message m) {
-                                msg = m;
-                            }
+                        // ... and resume on executor thread
+                        getExecutor(inMessage).execute(new Runnable() {
                             public void run() {
-                                msg.getInterceptorChain().resume();
+                                inMessage.getInterceptorChain().resume();
                             }
-                        }
-    
-                        Thread t = new FullResponseThread(inMessage);
-                        t.start();
+                        });
                     }
                 }
             } catch (Exception e) {
@@ -424,6 +424,34 @@
     }
 
     /**
+     * Get the Executor for this invocation.
+     * @param endpoint
+     * @return
+     */
+    private static Executor getExecutor(final Message message) {
+        Endpoint endpoint = message.getExchange().get(Endpoint.class);
+        Executor executor = endpoint.getService().getExecutor();
+        
+        if (executor == null || SynchronousExecutor.isA(executor)) {
+            // need true asynchrony
+            Bus bus = message.getExchange().get(Bus.class);
+            if (bus != null) {
+                WorkQueueManager workQueueManager =
+                    bus.getExtension(WorkQueueManager.class);
+                Executor autoWorkQueue =
+                    workQueueManager.getAutomaticWorkQueue();
+                executor = autoWorkQueue != null
+                           ? autoWorkQueue
+                           : OneShotAsyncExecutor.getInstance();
+            } else {
+                executor = OneShotAsyncExecutor.getInstance();
+            }
+        }
+        message.getExchange().put(Executor.class, executor);
+        return executor;
+    }
+    
+    /**
      * Store bad MAP fault name in the message.
      *
      * @param faultName the fault name to store
@@ -490,6 +518,18 @@
         return ret != null && ret.booleanValue();
     }
 
+    /**
+     * Retrieve indication that an async post-response service invocation
+     * is required.
+     * 
+     * @param message the current message
+     * @returned the retrieved indication that an async post-response service
+     * invocation is required.
+     */
+    public static boolean retrieveAsyncPostResponseDispatch(Message message) {
+        Boolean ret = (Boolean)message.get(ASYNC_POST_RESPONSE_DISPATCH);
+        return ret != null && ret.booleanValue();
+    }
     
     /**
      * Retrieve a JAXBContext for marshalling and unmarshalling JAXB generated

Modified: incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java?view=diff&rev=486689&r1=486688&r2=486689
==============================================================================
--- incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java
(original)
+++ incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java
Wed Dec 13 07:40:42 2006
@@ -183,7 +183,7 @@
                     ContextUtils.rebaseResponse(maps.getReplyTo(),
                                                 maps,
                                                 message);
-                }          
+                } 
             } else {
                 // validation failure => dispatch is aborted, response MAPs 
                 // must be aggregated

Modified: incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMInInterceptor.java?view=diff&rev=486689&r1=486688&r2=486689
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMInInterceptor.java (original)
+++ incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMInInterceptor.java Wed
Dec 13 07:40:42 2006
@@ -26,6 +26,7 @@
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
+import org.apache.cxf.Bus;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.interceptor.InterceptorChain;
@@ -59,6 +60,8 @@
         LOG.entering(getClass().getName(), "handleMessage");
         
         RMProperties rmps = RMContextUtils.retrieveRMProperties(message, false);
+        
+        message.getExchange().put(Bus.class, getBus());
         
         final AddressingPropertiesImpl maps = RMContextUtils.retrieveMAPs(message, false,
false);
         assert null != maps;

Modified: incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java?view=diff&rev=486689&r1=486688&r2=486689
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java (original)
+++ incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java Wed Dec
13 07:40:42 2006
@@ -31,14 +31,9 @@
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.endpoint.Endpoint;
-import org.apache.cxf.endpoint.ServerImpl;
-import org.apache.cxf.message.Exchange;
-import org.apache.cxf.message.ExchangeImpl;
 import org.apache.cxf.message.Message;
-import org.apache.cxf.message.MessageImpl;
 import org.apache.cxf.ws.addressing.AddressingProperties;
 import org.apache.cxf.ws.addressing.AddressingPropertiesImpl;
-import org.apache.cxf.ws.addressing.ContextUtils;
 import org.apache.cxf.ws.addressing.RelatesToType;
 import org.apache.cxf.ws.addressing.VersionTransformer;
 import org.apache.cxf.ws.addressing.v200408.EndpointReferenceType;
@@ -267,44 +262,5 @@
         if (null != sourceSequences) {
             sourceSequences.remove(id.getValue());
         }
-    }
-    
-    public void testServerSideSequenceCreation(final ServerImpl server, final String address)
{
-
-        Runnable r = new Runnable() {
-
-            public void run() {
-                try {
-                    Thread.sleep(5000);
-                } catch (InterruptedException ex) {
-                    // ignore
-                }
-
-                Endpoint ep = server.getEndpoint();
-                org.apache.cxf.transport.Destination dest = server.getDestination();
-                Message message = new MessageImpl();
-                Exchange exchange = new ExchangeImpl();
-                exchange.setInMessage(message);
-                message.setExchange(exchange);
-                exchange.put(Endpoint.class, ep);
-                exchange.setDestination(dest);
-                AddressingProperties maps = new AddressingPropertiesImpl();
-                maps.setReplyTo(RMUtils.createReference(address));
-                maps.setTo(dest.getAddress().getAddress());
-                ContextUtils.storeMAPs(maps, message, false);
-                
-
-                try {
-                    RMManager.this.getSequence(null, message, null);
-                } catch (SequenceFault ex) {
-                    ex.printStackTrace();
-                }
-
-            }
-
-        };
-        Thread t = new Thread(r);
-        t.start();
-    }
-
+    }  
 }

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/ControlImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/ControlImpl.java?view=diff&rev=486689&r1=486688&r2=486689
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/ControlImpl.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/ControlImpl.java
Wed Dec 13 07:40:42 2006
@@ -30,11 +30,9 @@
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.bus.spring.SpringBusFactory;
-import org.apache.cxf.endpoint.ServerImpl;
 import org.apache.cxf.greeter_control.Control;
 import org.apache.cxf.greeter_control.types.StartGreeterResponse;
 import org.apache.cxf.greeter_control.types.StopGreeterResponse;
-import org.apache.cxf.jaxws.EndpointImpl;
 import org.apache.cxf.ws.rm.RMManager;
 
 
@@ -62,14 +60,6 @@
         String address = "http://localhost:9020/SoapContext/GreeterPort";
         endpoint = Endpoint.publish(address, implementor);
         LOG.info("Published greeter endpoint.");
-        
-        if (cfgResource.endsWith("twoway-no-offer-test.xml")) {
-            
-            final ServerImpl server = ((EndpointImpl)endpoint).getServer();
-            RMManager mgr = greeterBus.getExtension(RMManager.class);
-            mgr.testServerSideSequenceCreation(server, "http://localhost:9994/decoupled_endpoint");
-        }
-        
         return true;        
     }
 

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/DecoupledClientServerTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/DecoupledClientServerTest.java?view=diff&rev=486689&r1=486688&r2=486689
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/DecoupledClientServerTest.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/DecoupledClientServerTest.java
Wed Dec 13 07:40:42 2006
@@ -30,16 +30,11 @@
 import org.apache.cxf.bus.spring.SpringBusFactory;
 import org.apache.cxf.greeter_control.Greeter;
 import org.apache.cxf.greeter_control.GreeterService;
-import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.interceptor.LoggingInInterceptor;
 import org.apache.cxf.interceptor.LoggingOutInterceptor;
-import org.apache.cxf.message.Message;
-import org.apache.cxf.phase.AbstractPhaseInterceptor;
-import org.apache.cxf.phase.Phase;
 import org.apache.cxf.systest.common.ClientServerSetupBase;
 import org.apache.cxf.systest.common.ClientServerTestBase;
 import org.apache.cxf.systest.common.TestServerBase;
-import org.apache.cxf.ws.addressing.MAPAggregator;
 
 
 /**
@@ -64,20 +59,6 @@
             bus.getOutInterceptors().add(out);
             bus.getOutFaultInterceptors().add(out);
             
-            class RebasedResponseThreadInterceptor extends AbstractPhaseInterceptor<Message>
{
-                RebasedResponseThreadInterceptor() {
-                    addBefore(MAPAggregator.class.getName());
-                    setPhase(Phase.PRE_LOGICAL);
-                }
-
-                public void handleMessage(Message message) throws Fault {
-                    message.put("org.apache.cxf.async.oneway.dispatch", Boolean.TRUE);
-                }
-                
-            }
-            
-            bus.getInInterceptors().add(new RebasedResponseThreadInterceptor());
-            
             GreeterImpl implementor = new GreeterImpl();
             implementor.setDelay(8000);
             String address = "http://localhost:9020/SoapContext/GreeterPort";
@@ -115,7 +96,6 @@
     
     public void tearDown() {
         bus.shutdown(true);
-        System.getProperties().remove("jetty.workaround");
     }
     
     public void testDecoupled() throws Exception {
@@ -128,19 +108,6 @@
         LoggingOutInterceptor out = new LoggingOutInterceptor();
         bus.getOutInterceptors().add(out);
         bus.getOutFaultInterceptors().add(out);
-        
-        class RebasedResponseThreadInterceptor extends AbstractPhaseInterceptor<Message>
{
-            RebasedResponseThreadInterceptor() {
-                super.addAfter(MAPAggregator.class.getName());
-            }
-
-            public void handleMessage(Message message) throws Fault {
-                message.put("org.apache.cxf.async.oneway.dispatch", Boolean.TRUE);
-            }
-            
-        }
-   
-        System.setProperty("jetty.workaround", "true");
         
         GreeterService gs = new GreeterService();
         final Greeter greeter = gs.getGreeterPort();

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java?view=diff&rev=486689&r1=486688&r2=486689
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java
Wed Dec 13 07:40:42 2006
@@ -73,8 +73,7 @@
     private boolean doTestTwowayNonAnonymousMaximumSequenceLength2 = testAll;
     private boolean doTestOnewayMessageLoss = testAll;
     private boolean doTestTwowayMessageLoss = testAll;
-    private boolean doTestServerSideSequenceCreation = testAll;
-    private boolean doTestTwowayNonAnonymousNoOffer;
+    private boolean doTestTwowayNonAnonymousNoOffer = testAll;
 
     public static void main(String[] args) {
         junit.textui.TestRunner.run(SequenceTest.class);
@@ -597,18 +596,6 @@
   
     }
     
-    public void testServerSideSequenceCreation() throws Exception {
-        if (!doTestServerSideSequenceCreation) {
-            return;
-        }
-        setupGreeter("org/apache/cxf/systest/ws/rm/twoway-no-offer-test.xml");
-
-        greeter.greetMeOneWay("one");
-        
-        awaitMessages(3, 4, 10000);          
-    }
-
-    
     public void testTwowayNonAnonymousNoOffer() throws Exception {
         if (!doTestTwowayNonAnonymousNoOffer) {
             return;
@@ -641,7 +628,7 @@
                                         GREETME_RESPONSE_ACTION};
         mf.verifyActions(expectedActions, false);
         mf.verifyMessageNumbers(new String[] {null, null, "1"}, false);
-        mf.verifyAcknowledgements(new boolean[] {false, false, true}, false);
+        mf.verifyAcknowledgements(new boolean[] {false, false, false}, false);
     }
 
     // --- test utilities ---



Mime
View raw message