*/
private static class HeapMemoryRulePipeline extends LinkedListPipeline{
public void initPipeline(){
workerThreads = new WorkerThreadImpl[1];
WorkerThreadImpl workerThread = new WorkerThreadImpl(this,
"HeapMemoryRuleThread"){
public void run(){
while (true) {
try{
ReadTask t =
(ReadTask)HeapMemoryRulePipeline.this.getTask();
if ( t != null){
long current = usedMemory();
t.run();
long usage = usedMemory() - current;
if ( usage > 0){
String token =
contextRootyCache.get(t);
appMemoryUsage.put(token,usage);
pipelines.remove(token);
}
}
} catch (Throwable t) {
SelectorThread.logger().log(Level.SEVERE,
"workerThread.httpException",t);
}
}
}
};
workerThread.setPriority(priority);
workerThreads[0] = workerThread;
threadCount++;
}