Class VatQueueRunner

  extended by net.sf.asyncobjects.vats.VatRunner
      extended by net.sf.asyncobjects.vats.VatQueueRunner
All Implemented Interfaces:
Direct Known Subclasses:
SingleThreadIdleRunner, SingleThreadRunner

public abstract class VatQueueRunner
extends VatRunner

This is a runner that has own queue of vats. Such vat runners also usually use own dispatch loop.


Nested Class Summary
protected  class VatQueueRunner.EnqueuedVat
          An enqueued vat
Nested classes/interfaces inherited from class net.sf.asyncobjects.vats.VatRunner
Field Summary
protected  LinkedBlockingQueue<VatQueueRunner.EnqueuedVat> queue
          queue that contains vats to execute
Fields inherited from class net.sf.asyncobjects.vats.VatRunner
state, stateLock
Constructor Summary
Method Summary
protected  boolean hasEvents(Vat vat, Object ticket)
          This method is called by the vat when new events have arrived.
Methods inherited from class net.sf.asyncobjects.vats.VatRunner
cancelledEqueuedVat, getBachingFactor, getState, newVat, newVat, setBachingFactor, setStarted, setStarting, setState, setStopped, setStopping
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


protected final LinkedBlockingQueue<VatQueueRunner.EnqueuedVat> queue
queue that contains vats to execute

Constructor Detail


public VatQueueRunner()
Method Detail


protected boolean hasEvents(Vat vat,
                            Object ticket)
Description copied from class: VatRunner
This method is called by the vat when new events have arrived. This method should never block and to be as fast as possible. This method executed within synchronoization over Vat's state lock. The vat enqueues itself only if is not running or enqueued yet.

Specified by:
hasEvents in class VatRunner
vat - a vat that has new events and is associated with the runner
ticket - a ticket from the vat
true if runner accpets the vat, false otherwise (happens if runner is stopped or is stopping)
See Also:
VatRunner.hasEvents(net.sf.asyncobjects.vats.Vat, java.lang.Object)

Copyright 2002-2007 Constantine Plotnikov. All Rights Reserved.