Top Description Fields Constructors Methods
javax.ejb

public final Class AsyncResult<V>

extends Object
implements Future<V>
Class Inheritance
All Implemented Interfaces
java.util.concurrent.Future
Imports
java.io.Serializable, java.util.concurrent.*

Wraps the result of an asynchronous method call as a Future object, preserving compatability with the business interface signature.

The value specified in the constructor will be retrieved by the container and made available to the client.

Note that this object is not passed to the client. It is merely a convenience for providing the result value to the container. Therefore, none of its instance methods should be called by the application.

Since
EJB 3.1

Field Summary

Modifier and TypeField and Description
private final V

Constructor Summary

AccessConstructor and Description
public
AsyncResult(V
the result of an asynchronous method call to be made available to the client
result
)

Creates a AsyncResult instance to wrap the result of an asynchronous method call

Method Summary

Modifier and TypeMethod and Description
public boolean
cancel(boolean
true if the thread executing this task should be interrupted (if the thread is known to the implementation); otherwise, in-progress tasks are allowed to complete
mayInterruptIfRunning
)

Implements java.util.concurrent.Future.cancel.

This method should not be called.
public V
get()

Implements java.util.concurrent.Future.get.

This method should not be called.
public V
get(long
the maximum time to wait
timeout
,
TimeUnit
the time unit of the timeout argument
unit
)

Implements java.util.concurrent.Future.get.

This method should not be called.
public boolean
isCancelled()

Implements java.util.concurrent.Future.isCancelled.

This method should not be called.
public boolean
isDone()

Implements java.util.concurrent.Future.isDone.

This method should not be called.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

resultValueback to summary
private final V resultValue

Constructor Detail

AsyncResultback to summary
public AsyncResult(V result)

Creates a AsyncResult instance to wrap the result of an asynchronous method call

Parameters
result:V

the result of an asynchronous method call to be made available to the client

Method Detail

cancelback to summary
public boolean cancel(boolean mayInterruptIfRunning)

Implements java.util.concurrent.Future.cancel.

This method should not be called. See Class-level comments.

Parameters
mayInterruptIfRunning:boolean

Doc from java.util.concurrent.Future.cancel.

true if the thread executing this task should be interrupted (if the thread is known to the implementation); otherwise, in-progress tasks are allowed to complete

Returns:boolean

Doc from java.util.concurrent.Future.cancel.

false if the task could not be cancelled, typically because it has already completed; true otherwise. If two or more threads cause a task to be cancelled, then at least one of them returns true. Implementations may provide stronger guarantees.

Annotations
@Override
getback to summary
public V get() throws InterruptedException, ExecutionException

Implements java.util.concurrent.Future.get.

This method should not be called. See Class-level comments.

Returns:V

Doc from java.util.concurrent.Future.get.

the computed result

Annotations
@Override
Exceptions
InterruptedException:

Doc from java.util.concurrent.Future.get.

if the current thread was interrupted while waiting

ExecutionException:

Doc from java.util.concurrent.Future.get.

if the computation threw an exception

getback to summary
public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException

Implements java.util.concurrent.Future.get.

This method should not be called. See Class-level comments.

Parameters
timeout:long

Doc from java.util.concurrent.Future.get.

the maximum time to wait

unit:TimeUnit

Doc from java.util.concurrent.Future.get.

the time unit of the timeout argument

Returns:V

Doc from java.util.concurrent.Future.get.

the computed result

Annotations
@Override
Exceptions
InterruptedException:

Doc from java.util.concurrent.Future.get.

if the current thread was interrupted while waiting

ExecutionException:

Doc from java.util.concurrent.Future.get.

if the computation threw an exception

TimeoutException:

Doc from java.util.concurrent.Future.get.

if the wait timed out

isCancelledback to summary
public boolean isCancelled()

Implements java.util.concurrent.Future.isCancelled.

This method should not be called. See Class-level comments.

Returns:boolean

Doc from java.util.concurrent.Future.isCancelled.

true if this task was cancelled before it completed

Annotations
@Override
isDoneback to summary
public boolean isDone()

Implements java.util.concurrent.Future.isDone.

This method should not be called. See Class-level comments.

Returns:boolean

Doc from java.util.concurrent.Future.isDone.

true if this task completed

Annotations
@Override