servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r656116 - in /servicemix/smx3/trunk/deployables/serviceengines/servicemix-cxf-se/src: main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java test/java/org/apache/servicemix/cxfse/CxfSeClientProxyTest.java
Date Wed, 14 May 2008 06:21:21 GMT
Author: ffang
Date: Tue May 13 23:21:20 2008
New Revision: 656116

URL: http://svn.apache.org/viewvc?rev=656116&view=rev
Log:
[SM-1353]Problem with CXF SE component after stop and restart

Modified:
    servicemix/smx3/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java
    servicemix/smx3/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/java/org/apache/servicemix/cxfse/CxfSeClientProxyTest.java

Modified: servicemix/smx3/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java?rev=656116&r1=656115&r2=656116&view=diff
==============================================================================
--- servicemix/smx3/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java
(original)
+++ servicemix/smx3/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java
Tue May 13 23:21:20 2008
@@ -181,9 +181,11 @@
      */
     @Override
     public void process(MessageExchange exchange) throws Exception {
+        
         JBITransportFactory jbiTransportFactory = (JBITransportFactory) getBus()
                 .getExtension(ConduitInitiatorManager.class)
                 .getConduitInitiator(CxfSeComponent.JBI_TRANSPORT_ID);
+        
         QName serviceName = exchange.getService();
         if (serviceName == null) {
             serviceName = getService();
@@ -199,6 +201,7 @@
                         + interfaceName.toString());
         DeliveryChannel dc = getContext().getDeliveryChannel();
         jbiTransportFactory.setDeliveryChannel(dc);
+        
         jbiDestination.setDeliveryChannel(dc);
         if (exchange.getStatus() == ExchangeStatus.ACTIVE) {
             jbiDestination.getJBIDispatcherUtil().dispatch(exchange);
@@ -215,7 +218,11 @@
     public void start() throws Exception {
         super.start();
         address = "jbi://" + ID_GENERATOR.generateSanitizedId();
-        endpoint.publish(address);
+        try {
+            endpoint.publish(address);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
         
         setService(endpoint.getServer().getEndpoint().getService().getName());
         setEndpoint(endpoint.getServer().getEndpoint().getEndpointInfo()
@@ -255,6 +262,7 @@
      */
     @Override
     public void stop() throws Exception {
+        endpoint.stop();
         ReflectionUtils.callLifecycleMethod(getPojo(), PreDestroy.class);
         JBIDispatcherUtil.clean();
         JBITransportFactory jbiTransportFactory = (JBITransportFactory) getBus()

Modified: servicemix/smx3/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/java/org/apache/servicemix/cxfse/CxfSeClientProxyTest.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/java/org/apache/servicemix/cxfse/CxfSeClientProxyTest.java?rev=656116&r1=656115&r2=656116&view=diff
==============================================================================
--- servicemix/smx3/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/java/org/apache/servicemix/cxfse/CxfSeClientProxyTest.java
(original)
+++ servicemix/smx3/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/java/org/apache/servicemix/cxfse/CxfSeClientProxyTest.java
Tue May 13 23:21:20 2008
@@ -48,11 +48,6 @@
         container.setNamingContext(new InitialContext());
         container.setEmbedded(true);
         container.init();
-        client = new DefaultServiceMixClient(container);
-        io = client.createInOutExchange();
-        io.setService(new QName("http://apache.org/hello_world_soap_http", "SOAPService"));
-        io.setInterfaceName(new QName("http://apache.org/hello_world_soap_http", "Greeter"));
-        io.setOperation(new QName("http://apache.org/hello_world_soap_http", "greetMe"));
         
     }
     
@@ -82,6 +77,40 @@
         component.getServiceUnitManager().init("target", getServiceUnitPath("proxytarget"));
         component.getServiceUnitManager().start("target");
         
+        client = new DefaultServiceMixClient(container);
+        io = client.createInOutExchange();
+        io.setService(new QName("http://apache.org/hello_world_soap_http", "SOAPService"));
+        io.setInterfaceName(new QName("http://apache.org/hello_world_soap_http", "Greeter"));
+        io.setOperation(new QName("http://apache.org/hello_world_soap_http", "greetMe"));
+        
+        LOG.info("test clientProxy");
+        io.getInMessage().setContent(new StringSource(
+                "<message xmlns='http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper'>"
+              + "<part> "
+              + "<greetMe xmlns='http://apache.org/hello_world_soap_http/types'><requestType>"
+              + "ffang"
+              + "</requestType></greetMe>"
+              + "</part> "
+              + "</message>"));
+        client.sendSync(io);
+        assertTrue(new SourceTransformer().contentToString(
+                io.getOutMessage()).indexOf("Hello ffang 3") > 0);
+        
+        //      test restart component
+        component.getServiceUnitManager().stop("target");
+        component.getServiceUnitManager().shutDown("target");
+        component.getServiceUnitManager().undeploy("target", getServiceUnitPath("proxytarget"));
+        component.stop();
+        
+        component.start();
+        component.getServiceUnitManager().init("target", getServiceUnitPath("proxytarget"));
+        component.getServiceUnitManager().start("target");
+        
+        client = new DefaultServiceMixClient(container);
+        io = client.createInOutExchange();
+        io.setService(new QName("http://apache.org/hello_world_soap_http", "SOAPService"));
+        io.setInterfaceName(new QName("http://apache.org/hello_world_soap_http", "Greeter"));
+        io.setOperation(new QName("http://apache.org/hello_world_soap_http", "greetMe"));
         LOG.info("test clientProxy");
         io.getInMessage().setContent(new StringSource(
                 "<message xmlns='http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper'>"



Mime
View raw message