A
- the type of the attachment that can be retrieved from the contextpublic interface ManagementRequestContext<A>
ManagementRequestContext
is to support asynchronous task execution
by request handlers. Handlers should avoid doing blocking tasks in the remoting threads that invoke them, so
the asynchronous task execution facilities of this class allow that work to be offloaded to other threads. Handlers
also should be careful about performing IO writes using threads that have invoked management operations, as those
threads may be interrupted if the caller cancels the operation, and if that interruption happens during IO the
remote channel will be incorrectly closed. The asynchronous task execution facilities of this class allow the IO
writes to be done in a separate thread.Modifier and Type | Interface and Description |
---|---|
static interface |
ManagementRequestContext.AsyncTask<A>
A task that can be executed asynchronously by a
ManagementRequestContext |
static interface |
ManagementRequestContext.MultipleResponseAsyncTask<A>
Deprecated.
this is a bit of a hack, plus we can move this method into AsyncTask with a default impl
once this module no longer requires JDK 6 source level
|
Modifier and Type | Method and Description |
---|---|
boolean |
executeAsync(ManagementRequestContext.AsyncTask<A> task)
Execute a cancellable task at some point in the future, using this object's internal
Executor . |
boolean |
executeAsync(ManagementRequestContext.AsyncTask<A> task,
boolean cancellable)
Execute a possibly cancellable task at some point in the future, using this object's internal
Executor . |
boolean |
executeAsync(ManagementRequestContext.AsyncTask<A> task,
boolean cancellable,
Executor executor)
Execute a possibly cancellable task at some point in the future, using the given
Executor . |
boolean |
executeAsync(ManagementRequestContext.AsyncTask<A> task,
Executor executor)
Execute a cancellable task at some point in the future, using the given
Executor . |
A |
getAttachment()
Get any attachment used to maintain shared state across possibly multiple requests associated with a
larger overall operation.
|
org.jboss.remoting3.Channel |
getChannel()
Get the underlying channel.
|
Integer |
getOperationId()
Get the current batch id for the overall operation.
|
ManagementProtocolHeader |
getRequestHeader()
Get the protocol header.
|
FlushableDataOutput |
writeMessage(ManagementProtocolHeader header)
Initiates writing a new message to the remote side, using the given header.
|
Integer getOperationId()
A getAttachment()
ActiveOperation.getAttachment()
null
org.jboss.remoting3.Channel getChannel()
ManagementProtocolHeader getRequestHeader()
boolean executeAsync(ManagementRequestContext.AsyncTask<A> task)
Executor
.
Equivalent to executeAsync(task, true)
.
If the executor rejects
the task, or if the task itself
throws an exception during execution, the
failed method
of the
ResultHander
associated with the request will be invoked, and if it returns true
a failure
message will be sent to the remote client.
task
- the tasktrue
if the task was accepted for execution; false
if the executor rejected itboolean executeAsync(ManagementRequestContext.AsyncTask<A> task, boolean cancellable)
Executor
.
If the executor rejects
the task, or if the task itself
throws an exception during execution, the
failed method
of the
ResultHander
associated with the request will be invoked, and if it returns true
a failure
message will be sent to the remote client.
task
- the taskcancellable
- true
if the task can be cancelled as part of overall request cancellationtrue
if the task was accepted for execution; false
if the executor rejected itboolean executeAsync(ManagementRequestContext.AsyncTask<A> task, Executor executor)
Executor
.
Equivalent to executeAsync(task, true, executor)
.
If the executor rejects
the task, or if the task itself
throws an exception during execution, the
failed method
of the
ResultHander
associated with the request will be invoked, and if it returns true
a failure
message will be sent to the remote client.
task
- the taskexecutor
- the executortrue
if the task was accepted for execution; false
if the executor rejected itboolean executeAsync(ManagementRequestContext.AsyncTask<A> task, boolean cancellable, Executor executor)
Executor
.
Equivalent to executeAsync(task, true, executor)
.
If the executor rejects
the task, or if the task itself
throws an exception during execution, the
failed method
of the
ResultHander
associated with the request will be invoked, and if it returns true
a failure
message will be sent to the remote client.
task
- the taskcancellable
- true
if the task can be cancelled as part of overall request cancellationexecutor
- the executortrue
if the task was accepted for execution; false
if the executor rejected itFlushableDataOutput writeMessage(ManagementProtocolHeader header) throws IOException
header
- the protocol headerIOException
Copyright © 2023 JBoss by Red Hat. All rights reserved.