diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/TransportThreadSupport.java b/activemq-core/src/main/java/org/apache/activemq/transport/TransportThreadSupport.java index 32f4f0473c..d1f0a7b07a 100644 --- a/activemq-core/src/main/java/org/apache/activemq/transport/TransportThreadSupport.java +++ b/activemq-core/src/main/java/org/apache/activemq/transport/TransportThreadSupport.java @@ -18,6 +18,8 @@ package org.apache.activemq.transport; import org.apache.activemq.util.ServiceStopper; +import java.io.IOException; + import edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean; /** @@ -35,9 +37,7 @@ public abstract class TransportThreadSupport extends TransportSupport implements public void start() throws Exception { if (started.compareAndSet(false, true)) { - runner = new Thread(this, toString()); - runner.setDaemon(daemon); - runner.start(); + doStart(); } } @@ -72,5 +72,12 @@ public abstract class TransportThreadSupport extends TransportSupport implements this.daemon = daemon; } + + protected void doStart() throws Exception { + runner = new Thread(this, toString()); + runner.setDaemon(daemon); + runner.start(); + } + protected abstract void doStop(ServiceStopper stopper) throws Exception; }