Class ManagementOperation<R>
java.lang.Object
java.util.concurrent.FutureTask<R>
org.apache.jackrabbit.oak.commons.jmx.ManagementOperation<R>
- All Implemented Interfaces:
Runnable
,Future<R>
,RunnableFuture<R>
A
ManagementOperation
is a background task, which can be
executed by an Executor
. Its ManagementOperation.Status
indicates
whether execution has already been started, is currently under the
way or has already finished.- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State
-
Method Summary
Modifier and TypeMethodDescriptionstatic <R> @NotNull ManagementOperation
<R> An operation that is already done with the givenvalue
.int
getId()
Each instance of aManagementOperation
has an unique id associated with it.@NotNull String
getName()
Informal name@NotNull ManagementOperation.Status
static <R> ManagementOperation
<R> newManagementOperation
(@NotNull String name, @NotNull Callable<R> task) Create a newManagementOperation
of the given name.static <R> ManagementOperation
<R> newManagementOperation
(@NotNull String name, @NotNull Supplier<String> statusMessage, @NotNull Callable<R> task) Create a newManagementOperation
of the given name.toString()
Methods inherited from class java.util.concurrent.FutureTask
cancel, exceptionNow, get, get, isCancelled, isDone, resultNow, run, state
-
Method Details
-
newManagementOperation
public static <R> ManagementOperation<R> newManagementOperation(@NotNull @NotNull String name, @NotNull @NotNull Callable<R> task) Create a newManagementOperation
of the given name. Thename
is an informal value attached to this instance.- Parameters:
name
- informal nametask
- task to execute for this operation
-
newManagementOperation
public static <R> ManagementOperation<R> newManagementOperation(@NotNull @NotNull String name, @NotNull @NotNull Supplier<String> statusMessage, @NotNull @NotNull Callable<R> task) Create a newManagementOperation
of the given name. Thename
is an informal value attached to this instance.- Parameters:
name
- informal namestatusMessage
- an informal status message describing the status of the background operation at the time of invocation.task
- task to execute for this operation
-
done
An operation that is already done with the givenvalue
.- Parameters:
name
- name of the operationresult
- result returned by the operation- Returns:
- a
ManagementOperation
instance that is already done.
-
getId
public int getId()Each instance of aManagementOperation
has an unique id associated with it. This id is returned as a part of itsstatus
- Returns:
- id of this operation
-
getName
Informal name- Returns:
- name of this operation
-
getStatus
Thestatus
of this operation:- Returns:
- the current status of this operation
-
toString
- Overrides:
toString
in classFutureTask<R>
-