The Meta-Environment API

toolbus.adapter
Class ToolBridge.WorkerQueue

java.lang.Object
  extended by toolbus.adapter.ToolBridge.WorkerQueue
Enclosing class:
ToolBridge

private static class ToolBridge.WorkerQueue
extends java.lang.Object

The queue that is meant to take care of the asynchroneous execution and queueing of anything that invokes stuff on a tool.

Author:
Arnold Lankamp

Nested Class Summary
private  class ToolBridge.WorkerQueue.Worker
          The worker thread of this queue.
 
Field Summary
private  java.lang.Object lock
           
private  toolbus.util.collections.RotatingQueue<java.lang.Runnable> queue
           
private  ToolBridge.WorkerQueue.Worker worker
           
 
Constructor Summary
ToolBridge.WorkerQueue()
          Default constructor.
 
Method Summary
 void execute(java.lang.Runnable r)
          Executes or queues the given runnable for execution.
 void start()
          Starts the worker thread.
 void terminate()
          Terminates the worker thread as soon as is gracefully possible.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lock

private final java.lang.Object lock

queue

private final toolbus.util.collections.RotatingQueue<java.lang.Runnable> queue

worker

private final ToolBridge.WorkerQueue.Worker worker
Constructor Detail

ToolBridge.WorkerQueue

public ToolBridge.WorkerQueue()
Default constructor.

Method Detail

start

public void start()
Starts the worker thread.


execute

public void execute(java.lang.Runnable r)
Executes or queues the given runnable for execution.

Parameters:
r - The runnable containing the stuff that needs to be executed.

terminate

public void terminate()
Terminates the worker thread as soon as is gracefully possible.


The Meta-Environment API