You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by ff...@apache.org on 2008/11/25 04:08:09 UTC

svn commit: r720392 - in /servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src: main/java/org/apache/servicemix/cxfbc/ test/java/org/apache/servicemix/cxfbc/ test/resources/org/apache/servicemix/cxfbc/

Author: ffang
Date: Mon Nov 24 19:08:08 2008
New Revision: 720392

URL: http://svn.apache.org/viewvc?rev=720392&view=rev
Log:
[SM-1592]cxf-bc consumer should allow async sending of message exchanges to the NMR

Added:
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/AsyncCxfBcConsumerInterceptor.java   (with props)
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CalculatorImpl.java   (with props)
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBCConsumerAsynTest.java   (with props)
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/jettyThreadPool.xml   (with props)
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/jms_transport_asyn.xml   (with props)
Modified:
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBCSESystemTest.java
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBcJmsTest.java
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/jms_test_timeout.xml
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/jms_test_timeout_provider.xml
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/xbean_asyn.xml

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java?rev=720392&r1=720391&r2=720392&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java (original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java Mon Nov 24 19:08:08 2008
@@ -57,6 +57,8 @@
 import org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor;
 import org.apache.cxf.binding.soap.interceptor.SoapPreProtocolOutInterceptor;
 import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.continuations.Continuation;
+import org.apache.cxf.continuations.ContinuationProvider;
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.endpoint.EndpointImpl;
 import org.apache.cxf.endpoint.Server;
@@ -103,12 +105,12 @@
 import org.mortbay.jetty.Handler;
 import org.springframework.core.io.Resource;
 
-
 /**
  * 
  * @author gnodet
- * @org.apache.xbean.XBean element="consumer" description="a consumer endpoint that is capable of using SOAP/HTTP or SOAP/JMS"
-*/
+ * @org.apache.xbean.XBean element="consumer" description="a consumer endpoint
+ *                         that is capable of using SOAP/HTTP or SOAP/JMS"
+ */
 public class CxfBcConsumer extends ConsumerEndpoint implements
         CxfBcEndpointWithInterceptor {
 
@@ -147,12 +149,12 @@
     private int timeout = 10;
 
     private boolean useJBIWrapper = true;
-    
+
     private boolean useSOAPEnvelope = true;
-    
-        
-    private EndpointInfo ei;
 
+    private EndpointInfo ei;
+    
+    
     /**
      * @return the wsdl
      */
@@ -161,110 +163,131 @@
     }
 
     /**
-             * Specifies the location of the WSDL defining the endpoint's interface.
-          *
-          * @param wsdl the location of the WSDL contract as a <code>Resource</code> object
-          * @org.apache.xbean.Property description="the location of the WSDL document defining the endpoint's interface"
-          **/
+     * Specifies the location of the WSDL defining the endpoint's interface.
+     * 
+     * @param wsdl
+     *            the location of the WSDL contract as a <code>Resource</code>
+     *            object
+     * @org.apache.xbean.Property description="the location of the WSDL document
+     *                            defining the endpoint's interface"
+     */
     public void setWsdl(Resource wsdl) {
         this.wsdl = wsdl;
     }
 
-/**
-        * Returns the list of interceptors used to process fault messages being
-        * sent to the provider.
-        *
-        * @return a list of <code>Interceptor</code> objects
-        * */
+    /**
+     * Returns the list of interceptors used to process fault messages being
+     * sent to the provider.
+     * 
+     * @return a list of <code>Interceptor</code> objects
+     */
     public List<Interceptor> getOutFaultInterceptors() {
         return outFault;
     }
 
     /**
-        * Returns the list of interceptors used to process fault messages being
-        * recieved by the endpoint.
-        *
-        * @return a list of <code>Interceptor</code> objects
-        * */
+     * Returns the list of interceptors used to process fault messages being
+     * recieved by the endpoint.
+     * 
+     * @return a list of <code>Interceptor</code> objects
+     */
     public List<Interceptor> getInFaultInterceptors() {
         return inFault;
     }
 
     /**
-        * Returns the list of interceptors used to process responses being 
-        * recieved by the endpoint.
-        *
-        * @return a list of <code>Interceptor</code> objects
-        * */
+     * Returns the list of interceptors used to process responses being recieved
+     * by the endpoint.
+     * 
+     * @return a list of <code>Interceptor</code> objects
+     */
     public List<Interceptor> getInInterceptors() {
         return in;
     }
 
-        /**
-        * Returns the list of interceptors used to process requests being
-        * sent to the provider.
-        *
-        * @return a list of <code>Interceptor</code> objects
-        * */
+    /**
+     * Returns the list of interceptors used to process requests being sent to
+     * the provider.
+     * 
+     * @return a list of <code>Interceptor</code> objects
+     */
     public List<Interceptor> getOutInterceptors() {
         return out;
     }
 
     /**
-        * Specifies a list of interceptors used to process responses recieved
-        * by the endpoint.
-        *
-        * @param interceptors   a list of <code>Interceptor</code> objects
-        * @org.apache.xbean.Property description="a list of beans configuring interceptors that process incoming responses"
-        * */
+     * Specifies a list of interceptors used to process responses recieved by
+     * the endpoint.
+     * 
+     * @param interceptors
+     *            a list of <code>Interceptor</code> objects
+     * @org.apache.xbean.Property description="a list of beans configuring
+     *                            interceptors that process incoming responses"
+     */
     public void setInInterceptors(List<Interceptor> interceptors) {
         in = interceptors;
     }
 
     /**
-        * Specifies a list of interceptors used to process faults recieved by
-         * the endpoint.
-        *
-        * @param interceptors   a list of <code>Interceptor</code> objects
-        * @org.apache.xbean.Property description="a list of beans configuring interceptors that process incoming faults"
-        * */
+     * Specifies a list of interceptors used to process faults recieved by the
+     * endpoint.
+     * 
+     * @param interceptors
+     *            a list of <code>Interceptor</code> objects
+     * @org.apache.xbean.Property description="a list of beans configuring
+     *                            interceptors that process incoming faults"
+     */
     public void setInFaultInterceptors(List<Interceptor> interceptors) {
         inFault = interceptors;
     }
 
     /**
-        * Specifies a list of interceptors used to process requests sent by 
-        * the endpoint.
-        *
-        * @param interceptors   a list of <code>Interceptor</code> objects
-        * @org.apache.xbean.Property description="a list of beans configuring interceptors that process requests"
-        * */
+     * Specifies a list of interceptors used to process requests sent by the
+     * endpoint.
+     * 
+     * @param interceptors
+     *            a list of <code>Interceptor</code> objects
+     * @org.apache.xbean.Property description="a list of beans configuring
+     *                            interceptors that process requests"
+     */
     public void setOutInterceptors(List<Interceptor> interceptors) {
         out = interceptors;
     }
 
     /**
-        * Specifies a list of interceptors used to process faults sent by 
-        * the endpoint.
-        *
-        * @param interceptors   a list of <code>Interceptor</code> objects
-        * @org.apache.xbean.Property description="a list of beans configuring interceptors that process fault 
-        * messages being returned to the consumer"
-        * */
+     * Specifies a list of interceptors used to process faults sent by the
+     * endpoint.
+     * 
+     * @param interceptors
+     *            a list of <code>Interceptor</code> objects
+     * @org.apache.xbean.Property description="a list of beans configuring
+     *                            interceptors that process fault messages being
+     *                            returned to the consumer"
+     */
     public void setOutFaultInterceptors(List<Interceptor> interceptors) {
         outFault = interceptors;
     }
 
     public void process(MessageExchange exchange) throws Exception {
-        synchronized (messages.get(exchange.getExchangeId())) {
-            messages.get(exchange.getExchangeId()).notifyAll();
-        }
+        
         Message message = messages.remove(exchange.getExchangeId());
-        if (exchange.getStatus() == ExchangeStatus.ACTIVE) {
-            exchange.setStatus(ExchangeStatus.DONE);
-            message.getExchange().get(ComponentContext.class)
+                
+        synchronized (message.getInterceptorChain()) {
+            
+            if (!isSynchronous()) {
+                                     
+                ContinuationProvider continuationProvider = (ContinuationProvider) message
+                        .get(ContinuationProvider.class.getName());
+                continuationProvider.getContinuation().resume();
+            } 
+            if (exchange.getStatus() == ExchangeStatus.ACTIVE) {
+                exchange.setStatus(ExchangeStatus.DONE);
+                message.getExchange().get(ComponentContext.class)
                     .getDeliveryChannel().send(exchange);
+            }
         }
+        
+        
     }
 
     @Override
@@ -276,15 +299,18 @@
 
     private void registerListServiceHandler() {
         if (server.getDestination() instanceof JettyHTTPDestination) {
-            JettyHTTPDestination jettyDest = (JettyHTTPDestination) server.getDestination();
-            JettyHTTPServerEngine jettyEng = (JettyHTTPServerEngine) jettyDest.getEngine();
+            JettyHTTPDestination jettyDest = (JettyHTTPDestination) server
+                    .getDestination();
+            JettyHTTPServerEngine jettyEng = (JettyHTTPServerEngine) jettyDest
+                    .getEngine();
             List<Handler> handlers = jettyEng.getHandlers();
             if (handlers == null) {
                 handlers = new ArrayList<Handler>();
                 jettyEng.setHandlers(handlers);
             }
-            handlers.add(new ListServiceHandler(getBus().getExtension(ServerRegistry.class)));
-                
+            handlers.add(new ListServiceHandler(getBus().getExtension(
+                    ServerRegistry.class)));
+
         }
     }
 
@@ -302,7 +328,7 @@
     public void validate() throws DeploymentException {
         try {
             if (definition == null) {
-                
+
                 retrieveWSDL();
             }
             if (service == null) {
@@ -317,11 +343,11 @@
             }
             WSDLServiceFactory factory = new WSDLServiceFactory(getBus(),
                     definition, service);
-            
+
             Service cxfService = factory.create();
 
-            ei = cxfService.getServiceInfos().iterator().next()
-                    .getEndpoints().iterator().next();
+            ei = cxfService.getServiceInfos().iterator().next().getEndpoints()
+                    .iterator().next();
             for (ServiceInfo serviceInfo : cxfService.getServiceInfos()) {
                 if (serviceInfo.getName().equals(service)
                         && getEndpoint() != null
@@ -349,18 +375,20 @@
             cxfService.getInInterceptors().add(new StaxInInterceptor());
             cxfService.getInInterceptors().add(
                     new ReadHeadersInterceptor(getBus()));
+            cxfService.getInInterceptors().add(new JbiOperationInterceptor());
             cxfService.getInInterceptors().add(
-                    new JbiOperationInterceptor());
-            cxfService.getInInterceptors().add(
-                    new JbiInWsdl1Interceptor(isUseJBIWrapper(), isUseSOAPEnvelope()));
+                    new JbiInWsdl1Interceptor(isUseJBIWrapper(),
+                            isUseSOAPEnvelope()));
             cxfService.getInInterceptors().add(new JbiInInterceptor());
-            cxfService.getInInterceptors().add(new JbiJAASInterceptor(
-                    ((CxfBcComponent)this.getServiceUnit().getComponent()).
-                    getConfiguration().getAuthenticationService()));
+            cxfService.getInInterceptors().add(
+                    new JbiJAASInterceptor(((CxfBcComponent) this
+                            .getServiceUnit().getComponent())
+                            .getConfiguration().getAuthenticationService()));
             cxfService.getInInterceptors().add(new JbiInvokerInterceptor());
             cxfService.getInInterceptors().add(new JbiPostInvokerInterceptor());
             if (isMtomEnabled()) {
-                cxfService.getInInterceptors().add(new ParseContentTypeInterceptor());
+                cxfService.getInInterceptors().add(
+                        new ParseContentTypeInterceptor());
             }
 
             cxfService.getInInterceptors().add(new OutgoingChainInterceptor());
@@ -372,7 +400,7 @@
             cxfService.getOutInterceptors().add(new AttachmentOutInterceptor());
             cxfService.getOutInterceptors().add(
                     new MtomCheckInterceptor(isMtomEnabled()));
-            
+
             cxfService.getOutInterceptors().add(new StaxOutInterceptor());
             cxfService.getOutInterceptors().add(
                     new SoapPreProtocolOutInterceptor());
@@ -381,7 +409,6 @@
             cxfService.getOutFaultInterceptors().add(
                     new SoapOutInterceptor(getBus()));
 
-            
             ep = new EndpointImpl(getBus(), cxfService, ei);
             getInInterceptors().addAll(getBus().getInInterceptors());
             getInFaultInterceptors().addAll(getBus().getInFaultInterceptors());
@@ -424,39 +451,52 @@
         }
     }
 
-    private void retrieveWSDL() throws JBIException, WSDLException, DeploymentException, IOException {
+    private void retrieveWSDL() throws JBIException, WSDLException,
+            DeploymentException, IOException {
         if (wsdl == null) {
             if (getTargetService() != null && getTargetEndpoint() != null) {
-                ServiceEndpoint serviceEndpoint 
-                    = getServiceUnit().getComponent().getComponentContext().getEndpoint(getTargetService(), getTargetEndpoint());
+                ServiceEndpoint serviceEndpoint = getServiceUnit()
+                        .getComponent().getComponentContext().getEndpoint(
+                                getTargetService(), getTargetEndpoint());
                 if (serviceEndpoint != null) {
-                    description = 
-                        this.getServiceUnit().getComponent().getComponentContext().getEndpointDescriptor(serviceEndpoint);
+                    description = this.getServiceUnit().getComponent()
+                            .getComponentContext().getEndpointDescriptor(
+                                    serviceEndpoint);
                     definition = getBus().getExtension(WSDLManager.class)
-                        .getDefinition((Element)description.getFirstChild());
-                    List address = definition.getService(getTargetService()).getPort(getTargetEndpoint()).getExtensibilityElements();
+                            .getDefinition(
+                                    (Element) description.getFirstChild());
+                    List address = definition.getService(getTargetService())
+                            .getPort(getTargetEndpoint())
+                            .getExtensibilityElements();
                     if (address == null || address.size() == 0) {
                         SOAPAddressImpl soapAddress = new SOAPAddressImpl();
-                        //specify default transport if there is no one in the internal wsdl
+                        // specify default transport if there is no one in the
+                        // internal wsdl
                         soapAddress.setLocationURI("http://localhost");
-                        definition.getService(getTargetService()).getPort(getTargetEndpoint()).addExtensibilityElement(soapAddress);
+                        definition.getService(getTargetService()).getPort(
+                                getTargetEndpoint()).addExtensibilityElement(
+                                soapAddress);
                     }
-                    List binding = definition.getService(getTargetService()).getPort(
-                            getTargetEndpoint()).getBinding().getExtensibilityElements();
+                    List binding = definition.getService(getTargetService())
+                            .getPort(getTargetEndpoint()).getBinding()
+                            .getExtensibilityElements();
                     if (binding == null || binding.size() == 0) {
-                        //no binding info in the internal wsdl so we need add default soap11 binding
+                        // no binding info in the internal wsdl so we need add
+                        // default soap11 binding
                         SOAPBinding soapBinding = new SOAPBindingImpl();
-                        soapBinding.setTransportURI("http://schemas.xmlsoap.org/soap/http");
+                        soapBinding
+                                .setTransportURI("http://schemas.xmlsoap.org/soap/http");
                         soapBinding.setStyle("document");
-                        definition.getService(getTargetService()).getPort(getTargetEndpoint()).getBinding().
-                            addExtensibilityElement(soapBinding);
+                        definition.getService(getTargetService()).getPort(
+                                getTargetEndpoint()).getBinding()
+                                .addExtensibilityElement(soapBinding);
                     }
-                    
+
                 }
             } else {
                 throw new DeploymentException("can't get wsdl");
             }
-            
+
         } else {
             description = DomUtil.parse(wsdl.getInputStream());
             try {
@@ -484,13 +524,15 @@
     }
 
     /**
-           * Specifies the HTTP address to which requests are sent. This value
-           * will overide any value specified in the WSDL.
-           *
-           * @param locationURI the URI as a string
-           * @org.apache.xbean.Property description="the HTTP address to which requests are sent. 
-           * This value will overide any value specified in the WSDL."
-           **/
+     * Specifies the HTTP address to which requests are sent. This value will
+     * overide any value specified in the WSDL.
+     * 
+     * @param locationURI
+     *            the URI as a string
+     * @org.apache.xbean.Property description="the HTTP address to which
+     *                            requests are sent. This value will overide any
+     *                            value specified in the WSDL."
+     */
     public void setLocationURI(String locationURI) {
         this.locationURI = locationURI;
     }
@@ -601,11 +643,27 @@
                             timeout * 1000);
                     process(exchange);
                 } else {
-                    synchronized (CxfBcConsumer.this.messages.get(exchange.getExchangeId())) {
-                        context.getDeliveryChannel().send(exchange);
-                        CxfBcConsumer.this.messages.get(exchange.getExchangeId()).wait(timeout * 1000);
+                    synchronized (((ContinuationProvider) message.get(
+                            ContinuationProvider.class.getName())).getContinuation()) {
+                        ContinuationProvider continuationProvider = 
+                            (ContinuationProvider) message.get(ContinuationProvider.class.getName());
+                        Continuation continuation = continuationProvider.getContinuation();
+                        if (!continuation.isPending()) {
+                            context.getDeliveryChannel().send(exchange);
+                            continuation.suspend(timeout * 1000);
+                        } else {
+                            //retry or timeout
+                            if (!continuation.isResumed()) {
+                                //exchange timeout
+                                throw new Exception("Exchange timed out: " + exchange.getExchangeId());
+                            }
+                                                       
+                        }
+
                     }
                 }
+            } catch (org.apache.cxf.continuations.SuspendedInvocationException e) {
+                throw e;
             } catch (Exception e) {
                 throw new Fault(e);
             }
@@ -635,30 +693,32 @@
                                 new org.apache.cxf.common.i18n.Message(
                                         "Fault occured", (ResourceBundle) null));
                         if (exchange.getProperty("faultstring") != null) {
-                            f.setMessage((String)exchange.getProperty("faultstring"));
+                            f.setMessage((String) exchange
+                                    .getProperty("faultstring"));
                         } else {
                             Element details = toElement(exchange.getFault()
-                                .getContent());
+                                    .getContent());
                             f.setDetail(details);
                         }
-                        
-                                                
+
                     } else {
                         Element details = toElement(exchange.getFault()
                                 .getContent());
-                                     
+
                         if (isUseSOAPEnvelope()) {
                             details = (Element) details.getElementsByTagNameNS(
-                                details.getNamespaceURI(), "Body").item(0);
+                                    details.getNamespaceURI(), "Body").item(0);
                             assert details != null;
                             details = (Element) details.getElementsByTagNameNS(
-                                details.getNamespaceURI(), "Fault").item(0);
+                                    details.getNamespaceURI(), "Fault").item(0);
                         }
                         assert details != null;
                         if (exchange.getProperty("faultstring") != null) {
-                            details = (Element) details.getElementsByTagName("faultstring").item(0);
+                            details = (Element) details.getElementsByTagName(
+                                    "faultstring").item(0);
                         } else {
-                            details = (Element) details.getElementsByTagName("detail").item(0);
+                            details = (Element) details.getElementsByTagName(
+                                    "detail").item(0);
                         }
 
                         assert details != null;
@@ -668,13 +728,13 @@
                                 new QName(details.getNamespaceURI(), "detail"));
                         f.setDetail(details);
                         if (exchange.getProperty("faultstring") != null) {
-                            f.setMessage((String)exchange.getProperty("faultstring"));
+                            f.setMessage((String) exchange
+                                    .getProperty("faultstring"));
                         }
 
                     }
                     processFaultDetail(f, message);
                     message.put(BindingFaultInfo.class, faultWanted);
-                    
 
                     throw f;
                 } else if (exchange.getMessage("out") != null) {
@@ -684,7 +744,7 @@
                         outMessage = endpoint.getBinding().createMessage();
                         ex.setOutMessage(outMessage);
                     }
-                    
+
                     NormalizedMessage norMessage = (NormalizedMessage) exchange
                             .getMessage("out");
 
@@ -699,10 +759,10 @@
                     outMessage.setContent(Source.class, exchange.getMessage(
                             "out").getContent());
                     Set attachmentNames = norMessage.getAttachmentNames();
-                    
+
                     Iterator iter = attachmentNames.iterator();
                     while (iter.hasNext()) {
-                        String id = (String)iter.next();
+                        String id = (String) iter.next();
                         DataHandler dh = norMessage.getAttachment(id);
                         attachmentList.add(new AttachmentImpl(id, dh));
                     }
@@ -718,7 +778,7 @@
             if (fault.getDetail() == null) {
                 return;
             }
-            
+
             Element exDetail = (Element) DOMUtils.getChild(fault.getDetail(),
                     Node.ELEMENT_NODE);
             if (exDetail == null) {
@@ -779,14 +839,18 @@
     }
 
     /**
-        * Specifies the location of the CXF configuraiton file used to configure
-        * the CXF bus. This allows you to access features like JMS runtime 
-        * behavior and WS-RM.
-        *
-        * @param busCfg a string containing the relative path to the configuration file
-        * @org.apache.xbean.Property description="the location of the CXF configuration file used to configure the CXF bus. 
-        * This allows you to configure features like WS-RM and JMS runtime behavior."
-        **/
+     * Specifies the location of the CXF configuraiton file used to configure
+     * the CXF bus. This allows you to access features like JMS runtime behavior
+     * and WS-RM.
+     * 
+     * @param busCfg
+     *            a string containing the relative path to the configuration
+     *            file
+     * @org.apache.xbean.Property description="the location of the CXF
+     *                            configuration file used to configure the CXF
+     *                            bus. This allows you to configure features
+     *                            like WS-RM and JMS runtime behavior."
+     */
     public void setBusCfg(String busCfg) {
         this.busCfg = busCfg;
     }
@@ -796,12 +860,14 @@
     }
 
     /**
-          * Specifies if the endpoint can support binnary attachments.
-          *
-          * @param  mtomEnabled a boolean
-          * @org.apache.xbean.Property description="Specifies if MTOM / attachment support is enabled. 
-          * Default is <code>false</code>."
-          **/
+     * Specifies if the endpoint can support binnary attachments.
+     * 
+     * @param mtomEnabled
+     *            a boolean
+     * @org.apache.xbean.Property description="Specifies if MTOM / attachment
+     *                            support is enabled. Default is
+     *                            <code>false</code>."
+     */
     public void setMtomEnabled(boolean mtomEnabled) {
         this.mtomEnabled = mtomEnabled;
     }
@@ -811,13 +877,15 @@
     }
 
     /**
-          * Specifies the interval for which the endpoint will wait for a 
-          * response, This is specified in seconds.
-          *
-          * @param  timeout the number of millis to wait for a response
-          * @org.apache.xbean.Property description="the number of millis the endpoint will wait for a response. 
-          * The default is 1 hour."
-          **/
+     * Specifies the interval for which the endpoint will wait for a response,
+     * This is specified in seconds.
+     * 
+     * @param timeout
+     *            the number of millis to wait for a response
+     * @org.apache.xbean.Property description="the number of millis the endpoint
+     *                            will wait for a response. The default is 1
+     *                            hour."
+     */
     public void setTimeout(int timeout) {
         this.timeout = timeout;
     }
@@ -827,14 +895,16 @@
     }
 
     /**
-     * Specifies if the endpoint expects messages to use the JBI wrapper 
-     * for SOAP messages.
-     *
-     * @param  useJBIWrapper a boolean
-     * @org.apache.xbean.Property description="Specifies if the JBI wrapper 
-     * is sent in the body of the message. Default is <code>true</code>.
-     *  Ignore the value of useSOAPEnvelope if useJBIWrapper is true"
-     **/
+     * Specifies if the endpoint expects messages to use the JBI wrapper for
+     * SOAP messages.
+     * 
+     * @param useJBIWrapper
+     *            a boolean
+     * @org.apache.xbean.Property description="Specifies if the JBI wrapper is
+     *                            sent in the body of the message. Default is
+     *                            <code>true</code>. Ignore the value of
+     *                            useSOAPEnvelope if useJBIWrapper is true"
+     */
     public void setUseJBIWrapper(boolean useJBIWrapper) {
         this.useJBIWrapper = useJBIWrapper;
     }
@@ -842,14 +912,17 @@
     public boolean isUseJBIWrapper() {
         return useJBIWrapper;
     }
-   
+
     /**
-     * Specifies if the endpoint expects soap messages when useJBIWrapper is false, 
-     * if useJBIWrapper is true then ignore useSOAPEnvelope
-     *
-     * @org.apache.xbean.Property description="Specifies if the endpoint expects soap messages when useJBIWrapper is false, 
-     *              if useJBIWrapper is true then ignore useSOAPEnvelope. The  default is <code>true</code>.
-     * */
+     * Specifies if the endpoint expects soap messages when useJBIWrapper is
+     * false, if useJBIWrapper is true then ignore useSOAPEnvelope
+     * 
+     * @org.apache.xbean.Property description="Specifies if the endpoint expects
+     *                            soap messages when useJBIWrapper is false, if
+     *                            useJBIWrapper is true then ignore
+     *                            useSOAPEnvelope. The default is
+     *                            <code>true</code>.
+     */
     public void setUseSOAPEnvelope(boolean useSOAPEnvelope) {
         this.useSOAPEnvelope = useSOAPEnvelope;
     }
@@ -857,12 +930,16 @@
     public boolean isUseSOAPEnvelope() {
         return useSOAPEnvelope;
     }
+
     /**
-     * Specifies if the endpoint expects send messageExchange by sendSync 
-     * @param  synchronous a boolean
-     * @org.apache.xbean.Property description="Specifies if the endpoint expects send messageExchange by sendSync . 
-     * Default is <code>true</code>."
-     **/
+     * Specifies if the endpoint expects send messageExchange by sendSync
+     * 
+     * @param synchronous
+     *            a boolean
+     * @org.apache.xbean.Property description="Specifies if the endpoint expects
+     *                            send messageExchange by sendSync . Default is
+     *                            <code>true</code>."
+     */
     public void setSynchronous(boolean synchronous) {
         this.synchronous = synchronous;
     }

Added: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/AsyncCxfBcConsumerInterceptor.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/AsyncCxfBcConsumerInterceptor.java?rev=720392&view=auto
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/AsyncCxfBcConsumerInterceptor.java (added)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/AsyncCxfBcConsumerInterceptor.java Mon Nov 24 19:08:08 2008
@@ -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.servicemix.cxfbc;
+
+import org.apache.cxf.binding.jbi.JBIFault;
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.AbstractPhaseInterceptor;
+import org.apache.cxf.phase.Phase;
+import org.apache.servicemix.cxfbc.CxfBcConsumer.JbiPostInvokerInterceptor;
+
+public class AsyncCxfBcConsumerInterceptor extends AbstractPhaseInterceptor {
+
+    private long currentThreadId;
+    private boolean firstInvocation = true;
+
+    public AsyncCxfBcConsumerInterceptor() {
+        super(Phase.POST_INVOKE);
+        addAfter(JbiPostInvokerInterceptor.class.getName());
+    }
+
+    public void handleMessage(Message message) throws Fault {
+        if (firstInvocation) {
+            firstInvocation = false;
+            currentThreadId = Thread.currentThread().getId();
+        } else {
+            if (Thread.currentThread().getId() != currentThreadId) {
+                // ensure only one thread is used for the cxf bc consumer
+                throw new JBIFault("not invoked by the same thread");
+            }
+        }
+    }
+
+}

Propchange: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/AsyncCxfBcConsumerInterceptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/AsyncCxfBcConsumerInterceptor.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CalculatorImpl.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CalculatorImpl.java?rev=720392&view=auto
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CalculatorImpl.java (added)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CalculatorImpl.java Mon Nov 24 19:08:08 2008
@@ -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.servicemix.cxfbc;
+
+import javax.jws.WebService;
+
+import org.apache.cxf.calculator.AddNumbersFault;
+import org.apache.cxf.calculator.CalculatorPortType;
+import org.apache.cxf.calculator.types.CalculatorFault;
+
+@WebService(serviceName = "CalculatorService", 
+        portName = "CalculatorPort", 
+        targetNamespace = "http://apache.org/cxf/calculator", 
+        endpointInterface = "org.apache.cxf.calculator.CalculatorPortType", 
+        wsdlLocation = "testutils/calculator.wsdl")
+public class CalculatorImpl implements CalculatorPortType {
+    public int add(int number1, int number2) throws AddNumbersFault {
+        if (number1 < 0 || number2 < 0) {
+            CalculatorFault fault = new CalculatorFault();
+            fault.setMessage("Negative number cant be added!");
+            fault.setFaultInfo("Numbers: " + number1 + ", " + number2);
+            throw new AddNumbersFault("Negative number cant be added!", fault);
+        }
+        try {
+            Thread.sleep(8000 - number2 * 4000);
+        } catch (InterruptedException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        return number1 + number2;
+    }
+
+}

Propchange: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CalculatorImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CalculatorImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBCConsumerAsynTest.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBCConsumerAsynTest.java?rev=720392&view=auto
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBCConsumerAsynTest.java (added)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBCConsumerAsynTest.java Mon Nov 24 19:08:08 2008
@@ -0,0 +1,145 @@
+/*
+ * 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.servicemix.cxfbc;
+
+import java.net.URL;
+import java.util.logging.Logger;
+
+import javax.xml.namespace.QName;
+
+import org.apache.cxf.calculator.CalculatorPortType;
+import org.apache.cxf.calculator.CalculatorService;
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.frontend.ClientProxy;
+import org.apache.cxf.interceptor.LoggingInInterceptor;
+import org.apache.cxf.interceptor.LoggingOutInterceptor;
+
+import org.apache.servicemix.jbi.container.SpringJBIContainer;
+import org.apache.servicemix.jbi.jaxp.SourceTransformer;
+import org.apache.servicemix.tck.SpringTestSupport;
+import org.apache.xbean.spring.context.ClassPathXmlApplicationContext;
+import org.springframework.context.support.AbstractXmlApplicationContext;
+
+public class CxfBCConsumerAsynTest extends SpringTestSupport {
+
+    private static final Logger LOG = LogUtils
+            .getL7dLogger(CxfBCConsumerAsynTest.class);
+
+    public void setUp() throws Exception {
+        // override super setup
+        LOG.info("setUp is invoked");
+    }
+
+    public void setUpJBI(String beanFile) throws Exception {
+        if (context != null) {
+            context.refresh();
+        }
+        transformer = new SourceTransformer();
+        if (beanFile == null) {
+            context = createBeanFactory();
+        } else {
+            context = createBeanFactory(beanFile);
+        }
+
+        jbi = (SpringJBIContainer) context.getBean("jbi");
+        assertNotNull("JBI Container not found in spring!", jbi);
+    }
+
+    public void tearDown() throws Exception {
+        if (context != null) {
+            context.destroy();
+            context = null;
+        }
+        if (jbi != null) {
+            jbi.shutDown();
+            jbi.destroy();
+            jbi = null;
+        }
+    }
+
+    public void testMultipleClientWithAsyn() throws Exception {
+        setUpJBI("org/apache/servicemix/cxfbc/xbean_asyn.xml");
+        multiClientTestBase();
+    }
+
+    private void multiClientTestBase() throws Exception {
+        URL wsdl = getClass().getResource("/wsdl/calculator.wsdl");
+        assertNotNull(wsdl);
+        CalculatorService service = new CalculatorService(wsdl, new QName(
+                "http://apache.org/cxf/calculator", "CalculatorService"));
+        CalculatorPortType port = service.getCalculatorPort();
+        ClientProxy.getClient(port).getInInterceptors().add(
+                new LoggingInInterceptor());
+        ClientProxy.getClient(port).getOutInterceptors().add(
+                new LoggingOutInterceptor());
+        MultiClientThread[] clients = new MultiClientThread[2];
+        for (int i = 0; i < clients.length; i++) {
+            clients[i] = new MultiClientThread(port, i);
+        }
+
+        for (int i = 0; i < clients.length; i++) {
+            clients[i].start();
+        }
+
+        for (int i = 0; i < clients.length; i++) {
+            clients[i].join();
+            // ensure the second invocation return first since it's less time
+            // consuming
+            assertEquals(clients[i].getResult(), "20");
+        }
+    }
+
+    @Override
+    protected AbstractXmlApplicationContext createBeanFactory() {
+        // load cxf se and bc from spring config file
+        return new ClassPathXmlApplicationContext(
+                "org/apache/servicemix/cxfbc/xbean.xml");
+    }
+
+    protected AbstractXmlApplicationContext createBeanFactory(String beanFile) {
+        // load cxf se and bc from specified spring config file
+        return new ClassPathXmlApplicationContext(beanFile);
+    }
+
+}
+
+class MultiClientThread extends Thread {
+    static String result = "";
+    private CalculatorPortType port;
+    private int index;
+
+    public MultiClientThread(CalculatorPortType port, int index) {
+        this.port = port;
+        this.index = index;
+    }
+
+    public void run() {
+        try {
+            int ret = port.add(index, index);
+            if (ret == 2 * index) {
+                result = result + ret;
+            }
+        } catch (Exception ex) {
+            result = "invocation failed " + ex.getMessage();
+        }
+    }
+
+    public String getResult() {
+        return result;
+    }
+
+}

Propchange: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBCConsumerAsynTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBCConsumerAsynTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBCSESystemTest.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBCSESystemTest.java?rev=720392&r1=720391&r2=720392&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBCSESystemTest.java (original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBCSESystemTest.java Mon Nov 24 19:08:08 2008
@@ -94,10 +94,6 @@
         multiClientTestBase();
     }
     
-    public void testMultipleClientWithAsyn() throws Exception {
-        setUpJBI("org/apache/servicemix/cxfbc/xbean_asyn.xml");
-        multiClientTestBase();
-    }
 
     
     private void calculatorTestBase() throws Exception {

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBcJmsTest.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBcJmsTest.java?rev=720392&r1=720391&r2=720392&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBcJmsTest.java (original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBcJmsTest.java Mon Nov 24 19:08:08 2008
@@ -32,6 +32,8 @@
 import org.apache.hello_world_soap_http.Greeter;
 import org.apache.hello_world_soap_http.HelloWorldService;
 import org.apache.hello_world_soap_http.NoSuchCodeLitFault;
+import org.apache.servicemix.jbi.container.SpringJBIContainer;
+import org.apache.servicemix.jbi.jaxp.SourceTransformer;
 import org.apache.servicemix.tck.SpringTestSupport;
 import org.apache.xbean.spring.context.ClassPathXmlApplicationContext;
 import org.springframework.context.support.AbstractXmlApplicationContext;
@@ -68,10 +70,25 @@
     
     protected void setUp() throws Exception {
         startServers();
-        super.setUp();
+        //super.setUp();
             
     }
     
+    public void setUpJBI(String beanFile) throws Exception {
+        if (context != null) {
+            context.refresh();
+        }
+        transformer = new SourceTransformer();
+        if (beanFile == null) {
+            context = createBeanFactory();
+        } else {
+            context = createBeanFactory(beanFile);
+        }
+
+        jbi = (SpringJBIContainer) context.getBean("jbi");
+        assertNotNull("JBI Container not found in spring!", jbi);
+    }
+    
     protected void tearDown() throws Exception {
         try {
             embeddedLauncher.stopServer();         
@@ -104,6 +121,16 @@
     }
 
     public void testJMSTransport() throws Exception {
+        setUpJBI("org/apache/servicemix/cxfbc/jms_transport.xml");
+        jmsTestBase();
+    }
+    
+    public void testJMSTransportAsynConsumer() throws Exception {
+        setUpJBI("org/apache/servicemix/cxfbc/jms_transport_asyn.xml");
+        jmsTestBase();
+    }
+
+    private void jmsTestBase() throws Exception, NoSuchCodeLitFault, BadRecordLitFault {
         SpringBusFactory bf = new SpringBusFactory();
         Bus testBus = bf.createBus("org/apache/servicemix/cxfbc/jms_test_timeout.xml");
         BusFactory.setDefaultBus(testBus);
@@ -153,7 +180,6 @@
         } catch (UndeclaredThrowableException ex) {
             throw (Exception) ex.getCause();
         }
-
     }
 
     @Override
@@ -162,6 +188,11 @@
                 "org/apache/servicemix/cxfbc/jms_transport.xml");
     }
     
+    protected AbstractXmlApplicationContext createBeanFactory(String beanFile) {
+        // load cxf se and bc from specified spring config file
+        return new ClassPathXmlApplicationContext(beanFile);
+    }
+    
     public QName getServiceName(QName q) {
         return q;
     }

Added: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/jettyThreadPool.xml
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/jettyThreadPool.xml?rev=720392&view=auto
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/jettyThreadPool.xml (added)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/jettyThreadPool.xml Mon Nov 24 19:08:08 2008
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+  
+  http://www.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<!-- 
+  ** This file configures the Cherry Server.
+ -->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xmlns:sec="http://cxf.apache.org/configuration/security"
+  xmlns:http="http://cxf.apache.org/transports/http/configuration"
+  xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"
+  xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
+  xsi:schemaLocation="
+       http://cxf.apache.org/configuration/security  		      http://cxf.apache.org/schemas/configuration/security.xsd
+            http://cxf.apache.org/transports/http/configuration
+            http://cxf.apache.org/schemas/configuration/http-conf.xsd
+            http://cxf.apache.org/transports/http-jetty/configuration
+            http://cxf.apache.org/schemas/configuration/http-jetty.xsd
+            http://www.springframework.org/schema/beans
+            http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+
+  <http:destination name="{http://apache.org/cxf/calculator}CalculatorPort.http-destination"> 
+  </http:destination>
+
+  <httpj:engine-factory bus="cxf">
+   <httpj:engine port="9000">
+       <httpj:threadingParameters minThreads="1" maxThreads="3" />
+       <httpj:connector>
+           <bean class="org.mortbay.jetty.nio.SelectChannelConnector">
+               <property name = "port" value="9000" />
+               <property name="threadPool">
+                   <bean class="org.mortbay.thread.BoundedThreadPool"/>
+               </property>
+           </bean>
+       </httpj:connector>
+   </httpj:engine>
+  </httpj:engine-factory>
+  
+  <!-- We need a bean named "cxf" -->
+  <bean id="cxf" class="org.apache.cxf.bus.CXFBusImpl"/>
+</beans>

Propchange: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/jettyThreadPool.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/jettyThreadPool.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/jettyThreadPool.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/jms_test_timeout.xml
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/jms_test_timeout.xml?rev=720392&r1=720391&r2=720392&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/jms_test_timeout.xml (original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/jms_test_timeout.xml Mon Nov 24 19:08:08 2008
@@ -27,7 +27,7 @@
         passes on slow machines.
     -->
     <jms:conduit name="{http://apache.org/hello_world_soap_http}HelloWorldPort.jms-conduit" abstract="true">
-        <jms:clientConfig clientReceiveTimeout="20000"/>
+        <jms:clientConfig clientReceiveTimeout="200000"/>
     </jms:conduit>
 
 </beans>

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/jms_test_timeout_provider.xml
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/jms_test_timeout_provider.xml?rev=720392&r1=720391&r2=720392&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/jms_test_timeout_provider.xml (original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/jms_test_timeout_provider.xml Mon Nov 24 19:08:08 2008
@@ -27,7 +27,7 @@
         passes on slow machines.
     -->
     <jms:conduit name="{http://apache.org/hello_world_soap_http}HelloWorldPortProxy.jms-conduit" abstract="true">
-        <jms:clientConfig clientReceiveTimeout="20000"/>
+        <jms:clientConfig clientReceiveTimeout="200000"/>
     </jms:conduit>
 
 </beans>

Added: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/jms_transport_asyn.xml
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/jms_transport_asyn.xml?rev=720392&view=auto
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/jms_transport_asyn.xml (added)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/jms_transport_asyn.xml Mon Nov 24 19:08:08 2008
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+  
+  http://www.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+  
+-->
+<beans xmlns:sm="http://servicemix.apache.org/config/1.0"
+       xmlns:cxfse="http://servicemix.apache.org/cxfse/1.0"
+       xmlns:cxfbc="http://servicemix.apache.org/cxfbc/1.0"
+       xmlns:test="urn:test"
+       xmlns:greeter="http://apache.org/hello_world_soap_http"
+       >
+  
+  <sm:container id="jbi" embedded="true">
+    
+    <sm:endpoints>
+      <!--cxfse:endpoint>
+        <cxfse:pojo>
+          <bean class="org.apache.servicemix.cxfbc.GreeterImplTwoWayJMS" />
+        </cxfse:pojo>
+        <cxfse:inInterceptors>
+          <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
+        </cxfse:inInterceptors>
+        <cxfse:outInterceptors>
+          <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
+        </cxfse:outInterceptors>
+        <cxfse:inFaultInterceptors>
+          <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
+        </cxfse:inFaultInterceptors>
+        <cxfse:outFaultInterceptors>
+          <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
+        </cxfse:outFaultInterceptors>
+      </cxfse:endpoint-->
+      <cxfbc:consumer wsdl="org/apache/servicemix/cxfbc/ws/security/hello_world.wsdl"
+                      service="greeter:HelloWorldService"
+                      endpoint="HelloWorldPort"
+                      targetEndpoint="HelloWorldPortProxy"
+                      targetService="greeter:HelloWorldService"
+                      targetInterface="greeter:Greeter"
+                      synchronous="false"
+                      timeout="100"
+                      >
+        <cxfbc:inInterceptors>
+          <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
+        </cxfbc:inInterceptors>
+        <cxfbc:outInterceptors>
+          <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
+        </cxfbc:outInterceptors>
+        <cxfbc:inFaultInterceptors>
+          <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
+        </cxfbc:inFaultInterceptors>
+        <cxfbc:outFaultInterceptors>
+          <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
+        </cxfbc:outFaultInterceptors>
+      </cxfbc:consumer>
+      <cxfbc:provider wsdl="org/apache/servicemix/cxfbc/ws/security/hello_world.wsdl"
+                      service="greeter:HelloWorldService"
+                      endpoint="HelloWorldPortProxy"
+                      interfaceName="greeter:Greetr"
+                      synchronous="false"
+                     >
+          <cxfbc:inInterceptors>
+            <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
+          </cxfbc:inInterceptors>
+          <cxfbc:outInterceptors>
+            <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
+          </cxfbc:outInterceptors>
+          <cxfbc:inFaultInterceptors>
+            <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
+          </cxfbc:inFaultInterceptors>
+          <cxfbc:outFaultInterceptors>
+            <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
+          </cxfbc:outFaultInterceptors>
+      </cxfbc:provider>
+    </sm:endpoints>
+    
+  </sm:container>
+  
+</beans>

Propchange: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/jms_transport_asyn.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/jms_transport_asyn.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/jms_transport_asyn.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/xbean_asyn.xml
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/xbean_asyn.xml?rev=720392&r1=720391&r2=720392&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/xbean_asyn.xml (original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/xbean_asyn.xml Mon Nov 24 19:08:08 2008
@@ -28,7 +28,7 @@
     <sm:endpoints>
       <cxfse:endpoint>
         <cxfse:pojo>
-          <bean class="org.apache.cxf.calculator.CalculatorImpl" />
+          <bean class="org.apache.servicemix.cxfbc.CalculatorImpl" />
         </cxfse:pojo>
         <cxfse:inInterceptors>
           <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
@@ -48,9 +48,11 @@
                       targetService="calculator:CalculatorService"
                       targetInterface="calculator:CalculatorPortType"
                       synchronous="false"
+                      busCfg="org/apache/servicemix/cxfbc/jettyThreadPool.xml"
                       >
         <cxfbc:inInterceptors>
           <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
+          <bean class="org.apache.servicemix.cxfbc.AsyncCxfBcConsumerInterceptor"/>
         </cxfbc:inInterceptors>
         <cxfbc:outInterceptors>
           <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>