Package org.jboss.as.protocol.mgmt
Interface ActiveOperation<T,A>
-
- Type Parameters:
T- the result typeA- the attachment type
public interface ActiveOperation<T,A>Encapsulates information about a currently active operation, which can require multiple messages exchanged between the client and the server. An attachment is optional, but can be used to maintain a shared state between multiple requests. It can be accessed using theManagementRequestContext.getAttachment()from the request handler. An operation is seen as active until one of the methods on theActiveOperation.ResultHandlerare called.- Author:
- Emanuel Muckenhuber
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceActiveOperation.CompletedCallback<T>A callback indicating when an operation is complete.static interfaceActiveOperation.ResultHandler<T>Handler for the operation result or to mark the operation as cancelled or failed.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddCancellable(org.xnio.Cancellable cancellable)Add a cancellation handler.AgetAttachment()Get the attachment.IntegergetOperationId()Get the batch id.org.jboss.threads.AsyncFuture<T>getResult()Get the result.ActiveOperation.ResultHandler<T>getResultHandler()Get the result handler for this request.
-
-
-
Method Detail
-
getOperationId
Integer getOperationId()
Get the batch id.- Returns:
- the batch id
-
getResultHandler
ActiveOperation.ResultHandler<T> getResultHandler()
Get the result handler for this request.- Returns:
- the result handler
-
getAttachment
A getAttachment()
Get the attachment.- Returns:
- the attachment
-
getResult
org.jboss.threads.AsyncFuture<T> getResult()
Get the result.- Returns:
- the future result
-
addCancellable
void addCancellable(org.xnio.Cancellable cancellable)
Add a cancellation handler.- Parameters:
cancellable- the cancel handler
-
-