You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2007/02/15 10:55:04 UTC

svn commit: r507871 - /incubator/servicemix/branches/servicemix-3.1/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/OutBinding.java

Author: gnodet
Date: Thu Feb 15 01:55:04 2007
New Revision: 507871

URL: http://svn.apache.org/viewvc?view=rev&rev=507871
Log:
SM-828: OutBinding does not allow for DeliveryChannel.accept()

Modified:
    incubator/servicemix/branches/servicemix-3.1/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/OutBinding.java

Modified: incubator/servicemix/branches/servicemix-3.1/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/OutBinding.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/servicemix-3.1/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/OutBinding.java?view=diff&rev=507871&r1=507870&r2=507871
==============================================================================
--- incubator/servicemix/branches/servicemix-3.1/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/OutBinding.java (original)
+++ incubator/servicemix/branches/servicemix-3.1/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/OutBinding.java Thu Feb 15 01:55:04 2007
@@ -36,7 +36,7 @@
  */
 public abstract class OutBinding extends ComponentSupport implements Runnable, MessageExchangeListener {
     private static final Log log = LogFactory.getLog(OutBinding.class);
-    private AtomicBoolean stop = new AtomicBoolean(false);
+    private AtomicBoolean stop = new AtomicBoolean(true);
     private Thread runnable;
 
     public OutBinding() {
@@ -75,7 +75,12 @@
             }
         }
         catch (MessagingException e) {
-            log.error("run failed", e);
+            // Only log exception if the component really fails
+            // i.e. the exception has not been thrown to interrupt
+            // this thread
+            if (!stop.get()) {
+                log.error("run failed", e);
+            }
         }
     }
 
@@ -93,7 +98,7 @@
      * @throws JBIException
      */
     public void stop() throws JBIException {
-        stop.compareAndSet(true, false);
+        stop.compareAndSet(false, true);
         if (runnable != null) {
             runnable.interrupt();
             try {
@@ -109,7 +114,7 @@
      * start
      */
     public void start() throws JBIException {
-        if (stop.compareAndSet(false, true)) {
+        if (stop.compareAndSet(true, false)) {
             runnable = new Thread(this);
             runnable.setDaemon(true);
             runnable.start();