Methods Summary |
---|
public long | addAndGetCurrentSize(long inc)
return currentSize.addAndGet(inc);
|
public boolean | addToQueue(org.apache.catalina.tribes.ChannelMessage msg, org.apache.catalina.tribes.Member[] destination, org.apache.catalina.tribes.group.InterceptorPayload payload)
final LinkObject obj = new LinkObject(msg,destination,payload);
Runnable r = new Runnable() {
public void run() {
sendAsyncData(obj);
}
};
executor.execute(r);
return true;
|
public long | getCurrentSize()
return currentSize.get();
|
public long | getKeepAliveTime()
return keepAliveTime;
|
public int | getMaxSpareThreads()
return maxSpareThreads;
|
public int | getMaxThreads()
return maxThreads;
|
public org.apache.catalina.tribes.transport.bio.util.LinkObject | removeFromQueue()
return null; //not used, thread pool contains its own queue.
|
public long | setAndGetCurrentSize(long value)
currentSize.set(value);
return value;
|
public void | setKeepAliveTime(long keepAliveTime)
this.keepAliveTime = keepAliveTime;
|
public void | setMaxSpareThreads(int maxSpareThreads)
this.maxSpareThreads = maxSpareThreads;
|
public void | setMaxThreads(int maxThreads)
this.maxThreads = maxThreads;
|
public void | startQueue()
if ( run ) return;
executor = new ThreadPoolExecutor(maxSpareThreads,maxThreads,keepAliveTime,TimeUnit.MILLISECONDS,runnablequeue);
run = true;
|
public void | stopQueue()
run = false;
executor.shutdownNow();
setAndGetCurrentSize(0);
runnablequeue.clear();
|