allow thread stack size to be configurable

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@515682 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2007-03-07 18:27:25 +00:00
parent f8d86bce28
commit 2ca08ce701
2 changed files with 36 additions and 2 deletions

View File

@ -37,6 +37,7 @@ public abstract class TransportServerThreadSupport extends TransportServerSuppor
private boolean daemon = true;
private boolean joinOnStop = true;
private Thread runner;
private long stackSize=0;//should be a multiple of 128k
public TransportServerThreadSupport() {
}
@ -70,7 +71,7 @@ public abstract class TransportServerThreadSupport extends TransportServerSuppor
protected void doStart() throws Exception {
log.info("Listening for connections at: " + getConnectURI());
runner = new Thread(this, "ActiveMQ Transport Server: "+toString());
runner = new Thread(null,this, "ActiveMQ Transport Server: "+toString(),stackSize);
runner.setDaemon(daemon);
runner.setPriority(ThreadPriorities.BROKER_MANAGEMENT);
runner.start();
@ -82,4 +83,20 @@ public abstract class TransportServerThreadSupport extends TransportServerSuppor
runner = null;
}
}
/**
* @return the stackSize
*/
public long getStackSize(){
return this.stackSize;
}
/**
* @param stackSize the stackSize to set
*/
public void setStackSize(long stackSize){
this.stackSize=stackSize;
}
}

View File

@ -29,6 +29,7 @@ public abstract class TransportThreadSupport extends TransportSupport implements
private boolean daemon = false;
private Thread runner;
private long stackSize=0;//should be a multiple of 128k
public boolean isDaemon() {
return daemon;
@ -39,8 +40,24 @@ public abstract class TransportThreadSupport extends TransportSupport implements
}
protected void doStart() throws Exception {
runner = new Thread(this, "ActiveMQ Transport: "+toString());
runner = new Thread(null,this, "ActiveMQ Transport: "+toString(),stackSize);
runner.setDaemon(daemon);
runner.start();
}
/**
* @return the stackSize
*/
public long getStackSize(){
return this.stackSize;
}
/**
* @param stackSize the stackSize to set
*/
public void setStackSize(long stackSize){
this.stackSize=stackSize;
}
}