ref_send API 1.16
defensive programming in Java

org.ref_send.promise
Interface Volatile<T>

Type Parameters:
T - referent type
All Known Subinterfaces:
Promise<T>
All Known Implementing Classes:
Deferred, Fulfilled, Inline, Rejected

public interface Volatile<T>

A promise of unknown origin.

A promise held in a variable of type Volatile must not be trusted to implement the semantics of a Promise. In particular, the client code must be prepared to correctly handle an implementation that changes its referent, or reports a referent and then later reports failure to acquire a referent, or switches back and forth between all of these states.


Method Summary
 T cast()
          Gets the current referent.
 

Method Detail

cast

T cast()
       throws java.lang.Exception
Gets the current referent.

For example:

 final Volatile<Foo> foo = …
 try {
     foo.cast().bar();
 } catch (final Exception reason) {
     // Either there is no current referent, or the bar() call failed.
     throw reason;
 }
 

Throws:
java.lang.Exception - reason the referent is not known

ref_send API 1.16
defensive programming in Java

Submit a bug or feature, or get help

Copyright 1998-2007 Waterken Inc. under the terms of the MIT X license.