You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2009/12/17 21:41:38 UTC

svn commit: r891881 - /activemq/sandbox/activemq-apollo-actor/activemq-queue/src/test/java/org/apache/activemq/queue/actor/transport/pipe/PipeTransportFactory.java

Author: chirino
Date: Thu Dec 17 20:41:38 2009
New Revision: 891881

URL: http://svn.apache.org/viewvc?rev=891881&view=rev
Log:
Proper shutdown handling

Modified:
    activemq/sandbox/activemq-apollo-actor/activemq-queue/src/test/java/org/apache/activemq/queue/actor/transport/pipe/PipeTransportFactory.java

Modified: activemq/sandbox/activemq-apollo-actor/activemq-queue/src/test/java/org/apache/activemq/queue/actor/transport/pipe/PipeTransportFactory.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-queue/src/test/java/org/apache/activemq/queue/actor/transport/pipe/PipeTransportFactory.java?rev=891881&r1=891880&r2=891881&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-queue/src/test/java/org/apache/activemq/queue/actor/transport/pipe/PipeTransportFactory.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-queue/src/test/java/org/apache/activemq/queue/actor/transport/pipe/PipeTransportFactory.java Thu Dec 17 20:41:38 2009
@@ -186,6 +186,11 @@
             this.dispatcher = dispatcher;
             dispatchQueue = (DispatchQueue) next;
             dispatchQueue.suspend();
+            dispatchQueue.addShutdownWatcher(new Runnable() {
+                public void run() {
+                    perform_unbind(PipeTransportServer.this);
+                }
+            });
             this.actor = ActorProxy.create(PipeTransportServerActor.class, this, dispatchQueue);
             this.actor.onBind();
         }
@@ -267,6 +272,15 @@
             super( dispatcher.createSerialQueue(null) );
             this.dispatchQueue = (DispatchQueue) next;
             this.dispatchQueue.suspend();
+            this.dispatchQueue.addShutdownWatcher(new Runnable() {
+                public void run() {
+                    PipeTransportActor peer = PipeTransport.this.peer;
+                    if( peer!=null ) {
+                        peer.onDisconnect();
+                        peer = null;
+                    }
+                }
+            });
             
             // Queue up the connect event so it's the first thing that gets executed when
             // this object gets resumed..