NetKernel APIs


com.ten60.netkernel.scheduler
Class RequestTable

java.lang.Object
  extended bycom.ten60.netkernel.scheduler.RequestTable

public class RequestTable
extends Object

Simple synchronized blocking queue of request states to be processed


Constructor Summary
RequestTable()
           
 
Method Summary
 void interrupt()
          Causes all threads blocking on a take() call to the object to return throwing an InterruptedException
 void put(RequestState aRequest)
           
 int size()
          Returns the current number of items in the queue.
 RequestState take()
          Takes an item off the queue blocking indefinately until something is there unless interrupted.
 RequestState takeIfAvailable(IRequestorSession aSession)
          Take an item from the queue if its session matches.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestTable

public RequestTable()
Method Detail

put

public final void put(RequestState aRequest)

take

public final RequestState take()
                        throws InterruptedException
Takes an item off the queue blocking indefinately until something is there unless interrupted.

Returns:
The QueueItem taken from the queue
Throws:
InterruptedException - thrown if we are interrupted whilst waiting for an item either a real thread.interrupt or if this queue is interrupted

takeIfAvailable

public final RequestState takeIfAvailable(IRequestorSession aSession)
Take an item from the queue if its session matches. If non available return immediately


size

public final int size()
Returns the current number of items in the queue.

Returns:
The current number of items in the queue.

interrupt

public void interrupt()
Causes all threads blocking on a take() call to the object to return throwing an InterruptedException


NetKernel APIs


Copyright © 2002-2004 1060 Research Ltd. All Rights Reserved.