net.sf.asyncobjects.vats
Class VatQueueRunner
java.lang.Object
net.sf.asyncobjects.vats.VatRunner
net.sf.asyncobjects.vats.VatQueueRunner
- All Implemented Interfaces:
- VatFactory
- 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.
- Author:
- const
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 |
queue
protected final LinkedBlockingQueue<VatQueueRunner.EnqueuedVat> queue
- queue that contains vats to execute
VatQueueRunner
public VatQueueRunner()
hasEvents
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
- Parameters:
vat
- a vat that has new events and is associated with the runnerticket
- a ticket from the vat
- Returns:
- 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.