Class ManagementOperation<R>
- java.lang.Object
-
- java.util.concurrent.FutureTask<R>
-
- org.apache.jackrabbit.oak.commons.jmx.ManagementOperation<R>
-
- All Implemented Interfaces:
java.lang.Runnable
,java.util.concurrent.Future<R>
,java.util.concurrent.RunnableFuture<R>
public class ManagementOperation<R> extends java.util.concurrent.FutureTask<R>
AManagementOperation
is a background task, which can be executed by anExecutor
. ItsManagementOperation.Status
indicates whether execution has already been started, is currently under the way or has already finished.- See Also:
RepositoryManagementMBean
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ManagementOperation.Status
Status of aManagementOperation
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static <R> @NotNull ManagementOperation<R>
done(java.lang.String name, R result)
An operation that is already done with the givenvalue
.int
getId()
Each instance of aManagementOperation
has an unique id associated with it.@NotNull java.lang.String
getName()
Informal name@NotNull ManagementOperation.Status
getStatus()
static <R> ManagementOperation<R>
newManagementOperation(@NotNull java.lang.String name, @NotNull java.util.concurrent.Callable<R> task)
Create a newManagementOperation
of the given name.static <R> ManagementOperation<R>
newManagementOperation(@NotNull java.lang.String name, @NotNull java.util.function.Supplier<java.lang.String> statusMessage, @NotNull java.util.concurrent.Callable<R> task)
Create a newManagementOperation
of the given name.static <R> ManagementOperation<R>
newManagementOperation(@NotNull java.lang.String name, Supplier<java.lang.String> statusMessage, @NotNull java.util.concurrent.Callable<R> task)
Deprecated.java.lang.String
toString()
-
-
-
Method Detail
-
newManagementOperation
public static <R> ManagementOperation<R> newManagementOperation(@NotNull @NotNull java.lang.String name, @NotNull @NotNull java.util.concurrent.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 java.lang.String name, @NotNull @NotNull java.util.function.Supplier<java.lang.String> statusMessage, @NotNull @NotNull java.util.concurrent.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
-
newManagementOperation
@Deprecated public static <R> ManagementOperation<R> newManagementOperation(@NotNull @NotNull java.lang.String name, @NotNull Supplier<java.lang.String> statusMessage, @NotNull @NotNull java.util.concurrent.Callable<R> task)
Deprecated.
-
done
@NotNull public static <R> @NotNull ManagementOperation<R> done(java.lang.String name, R result)
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
@NotNull public @NotNull java.lang.String getName()
Informal name- Returns:
- name of this operation
-
getStatus
@NotNull public @NotNull ManagementOperation.Status getStatus()
Thestatus
of this operation:- Returns:
- the current status of this operation
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.util.concurrent.FutureTask<R>
-
-