Packagecom.kaazing.gateway.jms.client
Classpublic class ConnectionFuture
InheritanceConnectionFuture Inheritance com.kaazing.gateway.jms.client.GenericFuture

Future-based support for asynchronous functions returning a value. Methods that would block instead accept a callback which is called when its execution completes asynchronously. Once the callback is invoked, call get() to fetch the value. Any errors that were caught during execution of the asynchronous function will be thrown from get() and checkError().



Public Methods
 MethodDefined by
  
ConnectionFuture(callback:Function = null)
Future-based support for asynchronous functions returning a value.
ConnectionFuture
  
checkError():void
Throws any errors caught during the execution of the asynchronous method.
ConnectionFuture
  
fulfill(connection:Connection):void
Called when the future has completed execution.
ConnectionFuture
  
Returns the result of the function executed.
ConnectionFuture
Constructor detail
ConnectionFuture()constructor
public function ConnectionFuture(callback:Function = null)

Future-based support for asynchronous functions returning a value. Methods that would block instead accept a callback which is called when its execution completes asynchronously. Once the callback is invoked, call get() to fetch the value. Any errors that were caught during execution of the asynchronous function will be thrown from get() and checkError().

Parameters
callback:Function (default = null)
Method detail
checkError()method
public function checkError():void

Throws any errors caught during the execution of the asynchronous method.

fulfill()method 
public function fulfill(connection:Connection):void

Called when the future has completed execution. Calls to fulfill() should only be made to indicate completion of a function call.

Parameters
connection:Connection
get()method 
public function get():Connection

Returns the result of the function executed. This should be called only after the future is fulfilled, for example, from within the function body of a callback passed to an asynchronous method.

Returns
Connection