activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r891881 - /activemq/sandbox/activemq-apollo-actor/activemq-queue/src/test/java/org/apache/activemq/queue/actor/transport/pipe/PipeTransportFactory.java
Date Thu, 17 Dec 2009 20:41:38 GMT
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..



Mime
View raw message