minor refactor to make it easier to add extra startup features

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@382821 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
James Strachan 2006-03-03 13:58:06 +00:00
parent 062dc5681c
commit fa430aaae0
1 changed files with 10 additions and 3 deletions

View File

@ -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;
}