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 Operation
autonomousKey
(int sessionId, OperationType operationType, Runnable runnable) static Operation
autonomousValue
(int sessionId, OperationType operationType, long valueId, Runnable runnable) boolean
cancel
(boolean mayInterruptIfRunning) void
void
done()
void
execute()
get()
int
getType()
long
boolean
boolean
boolean
isDone()
static <R> Operation
<R> key
(int sessionId, OperationType operationType, Supplier<R> function) void
void
setException
(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, wait
Methods 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:
isCancelled
in interfaceFuture<R>
-
isDone
public boolean isDone() -
done
public void done() -
isAutonomous
public boolean isAutonomous() -
cancel
-
get
- Specified by:
get
in interfaceFuture<R>
- Throws:
InterruptedException
ExecutionException
-
get
public R get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException - Specified by:
get
in interfaceFuture<R>
- Throws:
InterruptedException
ExecutionException
TimeoutException
-