|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.erights.e.elib.ref.WhenBrokenReactor
Used to implement Ref.whenBroken(Object, OneArgFunc)
.
Wraps a 'done' function (the second argument of whenBroken), so that the done function will eventually be invoked with the original reference exactly once under the following conditions:
WhenResolvedReactor
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 | |
WhenBrokenReactor(OneArgFunc wrapped,
Object ref,
Resolver optResolver)
Should ref become broken, invoke wrapped, and resolve optResolver (if not null) to its outcome. |
Method Summary | |
void |
__reactToLostClient(Throwable problem)
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 broken. |
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 |
public WhenBrokenReactor(OneArgFunc wrapped, Object ref, Resolver optResolver)
Assumes a first __whenBroken will be sent with this WhenBrokenReactor as argument.
Method Detail |
public Object run(Object ignored)
If myRef is broken, 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. If myRef is resolved but not broken, then be clever.
run
in interface OneArgFunc
public void __reactToLostClient(Throwable problem)
__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 |