minor refactor to make it easier to override starting

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@384193 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
James Strachan 2006-03-08 12:09:49 +00:00
parent 534ea690ff
commit 8568d6ee05
1 changed files with 9 additions and 5 deletions

View File

@ -50,11 +50,7 @@ public abstract class TransportServerThreadSupport extends TransportServerSuppor
public void start() throws Exception {
if (started.compareAndSet(false, true)) {
log.info("Listening for connections at: " + getLocation());
runner = new Thread(this, toString());
runner.setDaemon(daemon);
runner.setPriority(ThreadPriorities.BROKER_MANAGEMENT);
runner.start();
doStart();
}
}
@ -117,5 +113,13 @@ public abstract class TransportServerThreadSupport extends TransportServerSuppor
this.joinOnStop = joinOnStop;
}
protected void doStart() {
log.info("Listening for connections at: " + getLocation());
runner = new Thread(this, toString());
runner.setDaemon(daemon);
runner.setPriority(ThreadPriorities.BROKER_MANAGEMENT);
runner.start();
}
protected abstract void doStop(ServiceStopper stopper) throws Exception;
}