ref_send API 2.9
defensive programming in Java

org.ref_send.promise
Class Local<T>

java.lang.Object
  extended by org.ref_send.promise.Local<T>
Type Parameters:
T - referent type
All Implemented Interfaces:
java.io.Serializable, java.lang.reflect.InvocationHandler, Selfless, Promise<T>

public abstract class Local<T>
extends java.lang.Object
implements Promise<T>, java.lang.reflect.InvocationHandler, Selfless, java.io.Serializable

Implementation hook that users should ignore.

An abstract base class for a promise implementation that is scoped to a particular event queue.

See Also:
Serialized Form

Method Summary
abstract  T call()
          Gets the current referent.
static
<T> Do<T,java.lang.Object>
curry(java.lang.reflect.Method method, ConstArray<?> argv)
          Constructs a pending invocation.
abstract  boolean equals(java.lang.Object x)
           
abstract  int hashCode()
           
 java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
          Forwards a Java language invocation.
static java.lang.reflect.Type parameter(Do<?,?> x)
          Determines a block's parameter type.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

equals

public abstract boolean equals(java.lang.Object x)
Overrides:
equals in class java.lang.Object

hashCode

public abstract int hashCode()
Specified by:
hashCode in interface Selfless
Overrides:
hashCode in class java.lang.Object

invoke

public java.lang.Object invoke(java.lang.Object proxy,
                               java.lang.reflect.Method method,
                               java.lang.Object[] args)
                        throws java.lang.Exception
Forwards a Java language invocation.

Specified by:
invoke in interface java.lang.reflect.InvocationHandler
Parameters:
proxy - eventual reference
method - method to invoke
args - each invocation argument
Returns:
eventual reference for the invocation return
Throws:
java.lang.Exception

call

public abstract T call()
                throws java.lang.Exception
Description copied from interface: Promise
Gets the current referent.

For example:

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

Specified by:
call in interface Promise<T>
Throws:
java.lang.Exception - reason the referent is not known

curry

public static <T> Do<T,java.lang.Object> curry(java.lang.reflect.Method method,
                                               ConstArray<?> argv)
Constructs a pending invocation.

Parameters:
method - method to invoke
argv - invocation arguments

parameter

public static java.lang.reflect.Type parameter(Do<?,?> x)
Determines a block's parameter type.

Parameters:
x - block to introspect on
Returns:
x's parameter type

ref_send API 2.9
defensive programming in Java

Submit a bug or feature, or get help

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