org.erights.e.elib.ref
Class DelayedRedirector

java.lang.Object
  |
  +--org.erights.e.elib.ref.DelayedRedirector
All Implemented Interfaces:
DeadManSwitch, Marker, OneArgFunc, PassByProxy

public class DelayedRedirector
extends Object
implements DeadManSwitch, OneArgFunc, PassByProxy

Untamed: Wraps a ProxyResolver for a RemotePromise in a way suitable for inclusion as an argument in the first __whenMoreResolved message, in order to preserve reference-full-order.

Author:
Mark S. Miller

Field Summary
private  ProxyResolver myOptResolver
           
 
Fields inherited from interface org.erights.e.elib.serial.PassByProxy
HONORARY, HONORED_NAMES
 
Constructor Summary
DelayedRedirector(ProxyResolver resolver)
          Enabled:
 
Method Summary
 void __reactToLostClient(Throwable problem)
          Enabled: Smash the ProxyResolver with the arg.
 Object run(Object target)
          Enabled: On the first response, send a second __whenMoreResolved on the original RemotePromise, and then resolve the ProxyResolver to a Promise that will be resolved by the answer to this second __whenMoreResolved.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myOptResolver

private ProxyResolver myOptResolver
Constructor Detail

DelayedRedirector

public DelayedRedirector(ProxyResolver resolver)
Enabled:

Method Detail

run

public Object run(Object target)
Enabled: On the first response, send a second __whenMoreResolved on the original RemotePromise, and then resolve the ProxyResolver to a Promise that will be resolved by the answer to this second __whenMoreResolved.

This ensures that all messages have drained out of the previous path before enabling the new path. Once I've done my one-time-job, I become inoperative.

The argument of this first response is ignored (thanks Dean!). The argument of the second response is used as the true resolution of my RemotePromise.

Specified by:
run in interface OneArgFunc

__reactToLostClient

public void __reactToLostClient(Throwable problem)
Enabled: Smash the ProxyResolver with the arg.

Specified by:
__reactToLostClient in interface DeadManSwitch
See Also:
org.erights.e.elib.prim.MirandaMethods#__reactToLostClient


comments?