mirror of https://github.com/apache/activemq.git
made the join ability of the transport configurable so that we don't have to wait for each transport to complete
git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@380683 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7130f43c8f
commit
00d07b7783
|
@ -38,6 +38,7 @@ public abstract class TransportServerThreadSupport extends TransportServerSuppor
|
||||||
private AtomicBoolean started = new AtomicBoolean(false);
|
private AtomicBoolean started = new AtomicBoolean(false);
|
||||||
private AtomicBoolean closing = new AtomicBoolean(false);
|
private AtomicBoolean closing = new AtomicBoolean(false);
|
||||||
private boolean daemon = true;
|
private boolean daemon = true;
|
||||||
|
private boolean joinOnStop = true;
|
||||||
private Thread runner;
|
private Thread runner;
|
||||||
|
|
||||||
public TransportServerThreadSupport() {
|
public TransportServerThreadSupport() {
|
||||||
|
@ -67,7 +68,7 @@ public abstract class TransportServerThreadSupport extends TransportServerSuppor
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
stopper.onException(this, e);
|
stopper.onException(this, e);
|
||||||
}
|
}
|
||||||
if (runner != null) {
|
if (runner != null && joinOnStop) {
|
||||||
runner.join();
|
runner.join();
|
||||||
runner = null;
|
runner = null;
|
||||||
}
|
}
|
||||||
|
@ -97,9 +98,24 @@ public abstract class TransportServerThreadSupport extends TransportServerSuppor
|
||||||
return daemon;
|
return daemon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets whether the background read thread is a daemon thread or not
|
||||||
|
*/
|
||||||
public void setDaemon(boolean daemon) {
|
public void setDaemon(boolean daemon) {
|
||||||
this.daemon = daemon;
|
this.daemon = daemon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public boolean isJoinOnStop() {
|
||||||
|
return joinOnStop;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets whether the background read thread is joined with (waited for) on a stop
|
||||||
|
*/
|
||||||
|
public void setJoinOnStop(boolean joinOnStop) {
|
||||||
|
this.joinOnStop = joinOnStop;
|
||||||
|
}
|
||||||
|
|
||||||
protected abstract void doStop(ServiceStopper stopper) throws Exception;
|
protected abstract void doStop(ServiceStopper stopper) throws Exception;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue