|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.asyncobjects.vats.VatUtils
public class VatUtils
This class contains some experimental vat utilities
Constructor Summary | |
---|---|
VatUtils()
|
Method Summary | ||
---|---|---|
static
|
runInCurrentThread(Vat targetVat,
AsyncAction<T> action)
The version of runInCurrentThread(Vat, ThreadBasedRunner, AsyncAction) that
uses SingleThreadRunner as runner. |
|
static
|
runInCurrentThread(Vat targetVat,
ThreadBasedRunner runner,
AsyncAction<T> action)
This is an extremely tricky method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public VatUtils()
Method Detail |
---|
@Experimental public static <T> T runInCurrentThread(Vat targetVat, ThreadBasedRunner runner, AsyncAction<T> action) throws InvocationTargetException
This is an extremely tricky method. Use it only if you are sure that you understand what it does and have studied its source code. You have chances to break you application otherwise. The method basically allows the vat to be temporary run in the current thread.
The method basically does the following:
AsyncAction.doInOtherVat(Vat)
.InvocationTargetException
if the action failed.
So logic is extremly similar to the logic of the AsyncAction.doInCurrentThread(ThreadBasedRunner)
except for vat migration logic and the fact that action body is executed in the specified vat.
T
- a value type, typically it is a Void
targetVat
- a vat to migrate from one runner to the current runnerrunner
- a runner to use in the current threadaction
- an action to execute in the context of the targetVat
InvocationTargetException
- an failure returned from the action@Experimental public static <T> T runInCurrentThread(Vat targetVat, AsyncAction<T> action) throws InvocationTargetException
runInCurrentThread(Vat, ThreadBasedRunner, AsyncAction)
that
uses SingleThreadRunner
as runner.
T
- a value type, typically it is a Void
targetVat
- a vat to migrate from one runner to the current runneraction
- an action to execute in the context of the targetVat
InvocationTargetException
- an failure returned from the action
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |