org.erights.e.elib.ref
Interface Resolver

All Known Implementing Classes:
LocalResolver, ProxyResolver

public interface Resolver

Untamed:


Method Summary
 boolean isDone()
          Enabled: If not isDone(), both resolveRace(java.lang.Object) and smash(java.lang.Throwable) will work and return true, and resolve(java.lang.Object) will work rather than throw an exception.
 void resolve(Object target)
          Enabled: Like resolveRace(java.lang.Object), but throws an exception to report that this Resolver was already resolved, rather than returning a boolean.
 boolean resolveRace(Object target)
          Enabled: Queues all accumulated and future messages for delivery to target, and, for example, a local promise becomes resolved into being E-equivalent to the target.
 boolean smash(Throwable problem)
          Enabled: Breaks the promise, reporting 'problem' as the reason.
 

Method Detail

resolveRace

public boolean resolveRace(Object target)
Enabled: Queues all accumulated and future messages for delivery to target, and, for example, a local promise becomes resolved into being E-equivalent to the target.

If this resolver already isDone(), resolveRace(..) has no effect and returns false. Otherwise, the promise (or whatever) becomes resolved, this Resolver becomes done, and resolveRace(..) returns true. In either case, a Resolver will be isDone() following a resolveRace(..).

Parameters:
target -
Returns:
Whether this resolveRace(..) caused this Resolver to become done.

resolve

public void resolve(Object target)
Enabled: Like resolveRace(java.lang.Object), but throws an exception to report that this Resolver was already resolved, rather than returning a boolean.

Successful return indicates successful reslution.

Parameters:
target -

smash

public boolean smash(Throwable problem)
Enabled: Breaks the promise, reporting 'problem' as the reason.

"r.smash(p)" is equivalent to "r.resolveRace(Ref.broken(p))".

Returns:
Whether this smash(..) caused this Resolver to become done.
See Also:
resolveRace(java.lang.Object)

isDone

public boolean isDone()
Enabled: If not isDone(), both resolveRace(java.lang.Object) and smash(java.lang.Throwable) will work and return true, and resolve(java.lang.Object) will work rather than throw an exception.

If isDone(), neither none of those will work. Once a Resolver is done, it is done forever.



comments?