|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.asyncobjects.vats.VatRunner
public abstract class VatRunner
This is a base class for vat runners. The vat is a just an event queue. The vat runner actually executes the events. The vat has a single runner, however runners support multiple vats.
While vat runner is aware about the current vat, it does not keeps track of vats that is running.
The runner might provide additional services to the vats it is hosting. So vats might check if the runner belong to some specific subclass to obtain these services.
Nested Class Summary | |
---|---|
static class |
VatRunner.VatRunnerState
Vat state |
Field Summary | |
---|---|
protected VatRunner.VatRunnerState |
state
a state of vat runner |
protected Object |
stateLock
a state lock |
Constructor Summary | |
---|---|
VatRunner()
|
Method Summary | |
---|---|
protected void |
cancelledEqueuedVat(Vat vat,
Object ticket)
This method cancels enquued vat and detaches it from runner. |
int |
getBachingFactor()
|
VatRunner.VatRunnerState |
getState()
|
protected abstract boolean |
hasEvents(Vat vat,
Object ticket)
This method is called by the vat when new events have arrived. |
Vat |
newVat()
Create default vat for this runner. |
Vat |
newVat(String name)
Create default vat for this runner |
void |
setBachingFactor(int bachingFactor)
Set batching factor |
protected void |
setStarted()
Set state to started |
protected void |
setStarting()
Set state to starting |
protected void |
setState(VatRunner.VatRunnerState state)
|
protected void |
setStopped()
Set stopped state |
protected void |
setStopping()
Set stoppong state |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected VatRunner.VatRunnerState state
protected Object stateLock
Constructor Detail |
---|
public VatRunner()
Method Detail |
---|
public int getBachingFactor()
public void setBachingFactor(int bachingFactor)
bachingFactor
- the baching factor to setprotected abstract boolean hasEvents(Vat vat, Object ticket)
vat
- a vat that has new events and is associated with the runnerticket
- a ticket from the vat
protected final void cancelledEqueuedVat(Vat vat, Object ticket)
vat
- a vatticket
- a ticket
IllegalArgumentException
- if vat is not attached to this runner or ticket do not
match.protected void setStarted()
protected void setStarting()
protected void setStopped()
protected void setStopping()
public VatRunner.VatRunnerState getState()
protected void setState(VatRunner.VatRunnerState state)
state
- the state to setpublic Vat newVat(String name)
newVat
in interface VatFactory
name
- a vat name
public Vat newVat()
newVat
in interface VatFactory
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |