|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.erights.e.elib.ref.WhenResolvedReactor
Used to implement Ref.whenResolved(Object, OneArgFunc)
, which is
used to implement the when-catch
construct.
Wraps a 'done' function (the second argument of whenResolved, which is the right side of the "->" of a when-catch construct), so that the done function will eventually be invoked with the original reference exactly once under the following conditions:
WhenBrokenReactor
Field Summary | |
private Resolver |
myOptResolver
|
private OneArgFunc |
myOptWrapped
|
private Object |
myRef
|
Fields inherited from interface org.erights.e.elib.serial.PassByProxy |
HONORARY, HONORED_NAMES |
Constructor Summary | |
(package private) |
WhenResolvedReactor(OneArgFunc wrapped,
Object ref,
Resolver optResolver)
When ref is resolved, invoke wrapped, and resolve optResolver (if non-null) to its outcome. |
Method Summary | |
void |
__reactToLostClient(Throwable ignored)
Just like run/1, this is treated merely as a wakeup call to check myRef. |
Object |
run(Object ignored)
Causes us to wakeup and check if myRef is resolved. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private OneArgFunc myOptWrapped
private Object myRef
private Resolver myOptResolver
Constructor Detail |
WhenResolvedReactor(OneArgFunc wrapped, Object ref, Resolver optResolver)
Assumes a first __whenMoreResolved will be sent with this WhenResolvedReactor as argument.
Method Detail |
public Object run(Object ignored)
If myRef is resolved, then invoke myOptWrapped once (resolving myOptResolver to the outcome), and remember not to invoke it again (by forgetting it). Also forget myRef and myOptResolver, since we won't need them again. Further invocations silently return null rather than complaining.
If myRef is not resolved, then send a new
myRef <- __whenMoreResolved(this)message whose response should wake me up again.
run
in interface OneArgFunc
public void __reactToLostClient(Throwable ignored)
__reactToLostClient
in interface DeadManSwitch
org.erights.e.elib.prim.MirandaMethods#__reactToLostClient
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |