mirror of https://github.com/apache/activemq.git
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:
parent
062dc5681c
commit
fa430aaae0
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue