servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r726119 - in /servicemix/components/engines/servicemix-wsn2005/trunk/src/main/java/org/apache/servicemix/wsn: AbstractCreatePullPoint.java AbstractNotificationBroker.java component/WSNEndpoint.java jbi/JbiWrapperHelper.java
Date Fri, 12 Dec 2008 21:11:06 GMT
Author: gnodet
Date: Fri Dec 12 13:11:06 2008
New Revision: 726119

URL: http://svn.apache.org/viewvc?rev=726119&view=rev
Log:
SM-1732: Fix JBI wrapper support on servicemix-wsn2005

Modified:
    servicemix/components/engines/servicemix-wsn2005/trunk/src/main/java/org/apache/servicemix/wsn/AbstractCreatePullPoint.java
    servicemix/components/engines/servicemix-wsn2005/trunk/src/main/java/org/apache/servicemix/wsn/AbstractNotificationBroker.java
    servicemix/components/engines/servicemix-wsn2005/trunk/src/main/java/org/apache/servicemix/wsn/component/WSNEndpoint.java
    servicemix/components/engines/servicemix-wsn2005/trunk/src/main/java/org/apache/servicemix/wsn/jbi/JbiWrapperHelper.java

Modified: servicemix/components/engines/servicemix-wsn2005/trunk/src/main/java/org/apache/servicemix/wsn/AbstractCreatePullPoint.java
URL: http://svn.apache.org/viewvc/servicemix/components/engines/servicemix-wsn2005/trunk/src/main/java/org/apache/servicemix/wsn/AbstractCreatePullPoint.java?rev=726119&r1=726118&r2=726119&view=diff
==============================================================================
--- servicemix/components/engines/servicemix-wsn2005/trunk/src/main/java/org/apache/servicemix/wsn/AbstractCreatePullPoint.java
(original)
+++ servicemix/components/engines/servicemix-wsn2005/trunk/src/main/java/org/apache/servicemix/wsn/AbstractCreatePullPoint.java
Fri Dec 12 13:11:06 2008
@@ -108,6 +108,7 @@
             success = true;
             return response;
         } catch (EndpointRegistrationException e) {
+            log.warn("Unable to register new endpoint", e);
             UnableToCreatePullPointFaultType fault = new UnableToCreatePullPointFaultType();
             throw new UnableToCreatePullPointFault("Unable to register new endpoint", fault,
e);
         } finally {

Modified: servicemix/components/engines/servicemix-wsn2005/trunk/src/main/java/org/apache/servicemix/wsn/AbstractNotificationBroker.java
URL: http://svn.apache.org/viewvc/servicemix/components/engines/servicemix-wsn2005/trunk/src/main/java/org/apache/servicemix/wsn/AbstractNotificationBroker.java?rev=726119&r1=726118&r2=726119&view=diff
==============================================================================
--- servicemix/components/engines/servicemix-wsn2005/trunk/src/main/java/org/apache/servicemix/wsn/AbstractNotificationBroker.java
(original)
+++ servicemix/components/engines/servicemix-wsn2005/trunk/src/main/java/org/apache/servicemix/wsn/AbstractNotificationBroker.java
Fri Dec 12 13:11:06 2008
@@ -203,8 +203,9 @@
             success = true;
             return response;
         } catch (EndpointRegistrationException e) {
+            log.warn("Unable to register new endpoint", e);
             SubscribeCreationFailedFaultType fault = new SubscribeCreationFailedFaultType();
-            throw new SubscribeCreationFailedFault("Unable to register endpoint", fault,
e);
+            throw new SubscribeCreationFailedFault("Unable to register new endpoint", fault,
e);
         } finally {
             if (!success && subscription != null) {
                 subscriptions.remove(subscription);
@@ -296,6 +297,7 @@
             success = true;
             return response;
         } catch (EndpointRegistrationException e) {
+            log.warn("Unable to register new endpoint", e);
             PublisherRegistrationFailedFaultType fault = new PublisherRegistrationFailedFaultType();
             throw new PublisherRegistrationFailedFault("Unable to register new endpoint",
fault, e);
         } finally {

Modified: servicemix/components/engines/servicemix-wsn2005/trunk/src/main/java/org/apache/servicemix/wsn/component/WSNEndpoint.java
URL: http://svn.apache.org/viewvc/servicemix/components/engines/servicemix-wsn2005/trunk/src/main/java/org/apache/servicemix/wsn/component/WSNEndpoint.java?rev=726119&r1=726118&r2=726119&view=diff
==============================================================================
--- servicemix/components/engines/servicemix-wsn2005/trunk/src/main/java/org/apache/servicemix/wsn/component/WSNEndpoint.java
(original)
+++ servicemix/components/engines/servicemix-wsn2005/trunk/src/main/java/org/apache/servicemix/wsn/component/WSNEndpoint.java
Fri Dec 12 13:11:06 2008
@@ -27,6 +27,7 @@
 import java.util.GregorianCalendar;
 import java.util.Set;
 import java.util.HashSet;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 import javax.jbi.messaging.ExchangeStatus;
 import javax.jbi.messaging.Fault;
@@ -132,10 +133,10 @@
             return;
         }
 
-        boolean isJbiWrapped = false;
+        AtomicBoolean isJbiWrapped = new AtomicBoolean(false);
         Source source = exchange.getMessage("in").getContent();
         // Unwrap JBI message if needed
-        source = JbiWrapperHelper.unwrap(source);
+        source = JbiWrapperHelper.unwrap(source, isJbiWrapped);
 
         Object input = jaxbContext.createUnmarshaller().unmarshal(source);
         Method webMethod = null;
@@ -189,7 +190,7 @@
                     Document doc = JbiWrapperHelper.createDocument();
                     JAXBElement el = new JAXBElement(new QName(fa.targetNamespace(), fa.name()),
info.getClass(), null, info);
                     jaxbContext.createMarshaller().marshal(el, doc);
-                    if (isJbiWrapped) {
+                    if (isJbiWrapped.get()) {
                         JbiWrapperHelper.wrap(doc);
                     }
                     fault.setContent(new DOMSource(doc));
@@ -212,7 +213,7 @@
             exchange.setMessage(msg, "out");
             Document doc = JbiWrapperHelper.createDocument();
             jaxbContext.createMarshaller().marshal(output, doc);
-            if (isJbiWrapped) {
+            if (isJbiWrapped.get()) {
                 JbiWrapperHelper.wrap(doc);
             }
             msg.setContent(new DOMSource(doc));

Modified: servicemix/components/engines/servicemix-wsn2005/trunk/src/main/java/org/apache/servicemix/wsn/jbi/JbiWrapperHelper.java
URL: http://svn.apache.org/viewvc/servicemix/components/engines/servicemix-wsn2005/trunk/src/main/java/org/apache/servicemix/wsn/jbi/JbiWrapperHelper.java?rev=726119&r1=726118&r2=726119&view=diff
==============================================================================
--- servicemix/components/engines/servicemix-wsn2005/trunk/src/main/java/org/apache/servicemix/wsn/jbi/JbiWrapperHelper.java
(original)
+++ servicemix/components/engines/servicemix-wsn2005/trunk/src/main/java/org/apache/servicemix/wsn/jbi/JbiWrapperHelper.java
Fri Dec 12 13:11:06 2008
@@ -89,15 +89,15 @@
             if (WSDL11_WRAPPER_NAMESPACE.equals(el.getNamespaceURI()) && WSDL11_WRAPPER_MESSAGE_LOCALNAME.equals(el.getLocalName()))
{
                 el = DOMUtil.getFirstChildElement(el);
                 if (el == null) {
-                    throw new IllegalStateException("JBI wrapper has no child element");
-                }
-                el = DOMUtil.getFirstChildElement(el);
-                if (el == null) {
                     throw new IllegalStateException("JBI message has no child element");
                 }
                 if (!WSDL11_WRAPPER_NAMESPACE.equals(el.getNamespaceURI()) || !WSDL11_WRAPPER_PART_LOCALNAME.equals(el.getLocalName()))
{
                     throw new IllegalStateException("Expected a jbi:part element");
                 }
+                el = DOMUtil.getFirstChildElement(el);
+                if (el == null) {
+                    throw new IllegalStateException("JBI part has no child element");
+                }
                 isJbiWrapped.set(true);
                 source = new DOMSource(el);
             }



Mime
View raw message