Package org.forgerock.android.auth
Class FRListenerFuture<T>
- java.lang.Object
-
- org.forgerock.android.auth.FRListenerFuture<T>
-
- Type Parameters:
T- The type of the result
- All Implemented Interfaces:
java.util.concurrent.Future<T>,FRListener<T>
public class FRListenerFuture<T> extends java.lang.Object implements FRListener<T>, java.util.concurrent.Future<T>
AFuturerepresents the result of anFRListener
-
-
Constructor Summary
Constructors Constructor Description FRListenerFuture()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancancel(boolean mayInterruptIfRunning)Tget()Tget(long timeout, java.util.concurrent.TimeUnit unit)booleanisCancelled()booleanisDone()voidonException(java.lang.Exception e)Called when an asynchronous call fails to complete.voidonSuccess(T token)Called when an asynchronous call completes successfully.
-
-
-
Method Detail
-
cancel
public boolean cancel(boolean mayInterruptIfRunning)
- Specified by:
cancelin interfacejava.util.concurrent.Future<T>
-
isCancelled
public boolean isCancelled()
- Specified by:
isCancelledin interfacejava.util.concurrent.Future<T>
-
isDone
public boolean isDone()
- Specified by:
isDonein interfacejava.util.concurrent.Future<T>
-
get
public T get() throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
- Specified by:
getin interfacejava.util.concurrent.Future<T>- Throws:
java.util.concurrent.ExecutionExceptionjava.lang.InterruptedException
-
get
public T get(long timeout, @NonNull java.util.concurrent.TimeUnit unit) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException, java.util.concurrent.TimeoutException
- Specified by:
getin interfacejava.util.concurrent.Future<T>- Throws:
java.util.concurrent.ExecutionExceptionjava.lang.InterruptedExceptionjava.util.concurrent.TimeoutException
-
onSuccess
public void onSuccess(T token)
Description copied from interface:FRListenerCalled when an asynchronous call completes successfully.- Specified by:
onSuccessin interfaceFRListener<T>- Parameters:
token- the value returned
-
onException
public void onException(java.lang.Exception e)
Description copied from interface:FRListenerCalled when an asynchronous call fails to complete.- Specified by:
onExceptionin interfaceFRListener<T>- Parameters:
e- the reason for failure
-
-