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>AManagementOperationis a background task, which can be executed by anExecutor. ItsManagementOperation.Statusindicates 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 classManagementOperation.StatusStatus of aManagementOperation. 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete 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.intgetId()Each instance of aManagementOperationhas an unique id associated with it.@NotNull java.lang.StringgetName()Informal name@NotNull ManagementOperation.StatusgetStatus()static <R> ManagementOperation<R>newManagementOperation(@NotNull java.lang.String name, @NotNull java.util.concurrent.Callable<R> task)Create a newManagementOperationof 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 newManagementOperationof the given name.java.lang.StringtoString() 
 - 
 
- 
- 
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 newManagementOperationof the given name. Thenameis 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 newManagementOperationof the given name. Thenameis 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
@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 
ManagementOperationinstance that is already done. 
 
- 
getId
public int getId()
Each instance of aManagementOperationhas 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()
Thestatusof this operation:- Returns:
 - the current status of this operation
 
 
- 
toString
public java.lang.String toString()
- Overrides:
 toStringin classjava.util.concurrent.FutureTask<R>
 
 - 
 
 -