Package org.rostore.v2.container.async
Class Operation<R>
java.lang.Object
org.rostore.v2.container.async.Operation<R>
- All Implemented Interfaces:
Future<R>
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State -
Method Summary
Modifier and TypeMethodDescriptionstatic OperationautonomousKey(int sessionId, OperationType operationType, Runnable runnable) static OperationautonomousValue(int sessionId, OperationType operationType, long valueId, Runnable runnable) booleancancel(boolean mayInterruptIfRunning) voidvoiddone()voidexecute()get()intgetType()longbooleanbooleanbooleanisDone()static <R> Operation<R> key(int sessionId, OperationType operationType, Supplier<R> function) voidvoidsetException(Exception exception) toString()static <R> Operation<R> value(int sessionId, OperationType operationType, long valueId, Supplier<R> function) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.concurrent.Future
exceptionNow, resultNow, state
-
Method Details
-
toString
-
getValueId
public long getValueId() -
value
public static <R> Operation<R> value(int sessionId, OperationType operationType, long valueId, Supplier<R> function) -
autonomousValue
public static Operation autonomousValue(int sessionId, OperationType operationType, long valueId, Runnable runnable) -
key
public static <R> Operation<R> key(int sessionId, OperationType operationType, Supplier<R> function) -
autonomousKey
public static Operation autonomousKey(int sessionId, OperationType operationType, Runnable runnable) -
getSessionId
public int getSessionId() -
getType
-
getTarget
-
rethrowExceptionIfOccurred
- Throws:
ExecutionException
-
execute
public void execute() -
getException
-
setException
-
cancel
public boolean cancel(boolean mayInterruptIfRunning) -
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceFuture<R>
-
isDone
public boolean isDone() -
done
public void done() -
isAutonomous
public boolean isAutonomous() -
cancel
-
get
- Specified by:
getin interfaceFuture<R>- Throws:
InterruptedExceptionExecutionException
-
get
public R get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException - Specified by:
getin interfaceFuture<R>- Throws:
InterruptedExceptionExecutionExceptionTimeoutException
-