public class ManagementOperation<R>
extends java.util.concurrent.FutureTask<R>
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.RepositoryManagementMBean
Modifier and Type | Class and Description |
---|---|
static class |
ManagementOperation.Status
Status of a
ManagementOperation . |
Modifier and Type | Method and Description |
---|---|
static <R> @NotNull ManagementOperation<R> |
done(java.lang.String name,
R result)
An operation that is already done with the given
value . |
int |
getId()
Each instance of a
ManagementOperation 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 new
ManagementOperation 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 new
ManagementOperation of the given name. |
static <R> ManagementOperation<R> |
newManagementOperation(@NotNull java.lang.String name,
com.google.common.base.Supplier<java.lang.String> statusMessage,
@NotNull java.util.concurrent.Callable<R> task)
Deprecated.
|
java.lang.String |
toString() |
public static <R> ManagementOperation<R> newManagementOperation(@NotNull @NotNull java.lang.String name, @NotNull @NotNull java.util.concurrent.Callable<R> task)
ManagementOperation
of the given name. The name
is an informal value attached to this instance.name
- informal nametask
- task to execute for this operationpublic 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)
ManagementOperation
of the given name. The name
is an informal value attached to this instance.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@Deprecated public static <R> ManagementOperation<R> newManagementOperation(@NotNull @NotNull java.lang.String name, @NotNull com.google.common.base.Supplier<java.lang.String> statusMessage, @NotNull @NotNull java.util.concurrent.Callable<R> task)
newManagementOperation(String, Supplier, Callable)
instead@NotNull public static <R> @NotNull ManagementOperation<R> done(java.lang.String name, R result)
value
.name
- name of the operationresult
- result returned by the operationManagementOperation
instance that is already done.public int getId()
ManagementOperation
has an unique id
associated with it. This id is returned as a part of its
status
@NotNull public @NotNull java.lang.String getName()
@NotNull public @NotNull ManagementOperation.Status getStatus()
status
of this operation:
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2010 - 2020 Adobe. All Rights Reserved