public final class ManagementChannelHandler extends AbstractMessageHandler implements ManagementChannelAssociation
ManagementRequestHandlerFactory per channel.| Modifier and Type | Field and Description |
|---|---|
static org.jboss.remoting3.Attachments.Key<File> |
TEMP_DIR
Optional attachment for a temp file directory.
|
| Constructor and Description |
|---|
ManagementChannelHandler(org.jboss.remoting3.Channel channel,
ExecutorService executorService) |
ManagementChannelHandler(org.jboss.remoting3.Channel channel,
ExecutorService executorService,
ManagementRequestHandlerFactory... initial) |
ManagementChannelHandler(ManagementClientChannelStrategy strategy,
ExecutorService executorService) |
ManagementChannelHandler(ManagementClientChannelStrategy strategy,
ExecutorService executorService,
ManagementRequestHandlerFactory... initial) |
| Modifier and Type | Method and Description |
|---|---|
void |
addHandlerFactory(ManagementRequestHandlerFactory factory)
Add a management request handler factory to this context.
|
protected List<Integer> |
cancelAllActiveOperations()
Cancel all currently active operations.
|
<T,A> org.jboss.threads.AsyncFuture<T> |
executeRequest(ActiveOperation<T,A> support,
ManagementRequest<T,A> request)
Execute a request based on an existing active operation.
|
<T,A> org.jboss.threads.AsyncFuture<T> |
executeRequest(Integer operationId,
ManagementRequest<T,A> request)
Execute a request based on an existing active operation.
|
<T,A> ActiveOperation<T,A> |
executeRequest(ManagementRequest<T,A> request,
A attachment)
Execute a management request.
|
<T,A> ActiveOperation<T,A> |
executeRequest(ManagementRequest<T,A> request,
A attachment,
ActiveOperation.CompletedCallback<T> callback)
Execute a management request.
|
protected <T,A> ActiveOperation<T,A> |
getActiveOperation(Integer id)
Get the active operation.
|
protected <T,A> ActiveOperation<T,A> |
getActiveOperation(ManagementRequestHeader header)
Get an active operation.
|
org.jboss.remoting3.Attachments |
getAttachments()
Get the attachments.
|
org.jboss.remoting3.Channel |
getChannel()
Get the underlying remoting channel associated with this context.
|
long |
getLastMessageReceivedTime() |
org.jboss.remoting3.Channel.Receiver |
getReceiver()
Get a receiver instance for this context.
|
InetAddress |
getRemoteAddress()
Get the remote address.
|
protected ManagementRequestHandler<?,?> |
getRequestHandler(ManagementRequestHeader header)
Get the request handler.
|
void |
handleChannelClosed(org.jboss.remoting3.Channel closed,
IOException e)
Receive a notification that the channel was closed.
|
<T,A> ActiveOperation<T,A> |
initializeOperation(A attachment,
ActiveOperation.CompletedCallback<T> callback) |
protected boolean |
isShutdown()
Is shutdown.
|
protected <T,A> ActiveOperation<T,A> |
registerActiveOperation(A attachment)
Register an active operation.
|
protected <T,A> ActiveOperation<T,A> |
registerActiveOperation(A attachment,
ActiveOperation.CompletedCallback<T> callback)
Register an active operation.
|
protected <T,A> ActiveOperation<T,A> |
registerActiveOperation(Integer id,
A attachment)
Register an active operation with a specific operation id.
|
protected <T,A> ActiveOperation<T,A> |
registerActiveOperation(Integer id,
A attachment,
ActiveOperation.CompletedCallback<T> callback)
Register an active operation with a specific operation id.
|
boolean |
removeHandlerFactory(ManagementRequestHandlerFactory instance)
Remove a management request handler factory from this context.
|
awaitCompletion, executeRequest, getExecutor, getFallbackHandler, handleClose, handleMessage, handleMessage, handleMessage, handleRequest, removeActiveOperation, safeWriteErrorResponse, shutdown, shutdownNow, validateRequest, writeErrorResponse, writeHeaderpublic static final org.jboss.remoting3.Attachments.Key<File> TEMP_DIR
public ManagementChannelHandler(org.jboss.remoting3.Channel channel,
ExecutorService executorService)
public ManagementChannelHandler(org.jboss.remoting3.Channel channel,
ExecutorService executorService,
ManagementRequestHandlerFactory... initial)
public ManagementChannelHandler(ManagementClientChannelStrategy strategy, ExecutorService executorService)
public ManagementChannelHandler(ManagementClientChannelStrategy strategy, ExecutorService executorService, ManagementRequestHandlerFactory... initial)
public long getLastMessageReceivedTime()
public org.jboss.remoting3.Channel getChannel()
throws IOException
getChannel in interface ManagementChannelAssociationIOExceptionpublic InetAddress getRemoteAddress()
null if not availablepublic <T,A> ActiveOperation<T,A> initializeOperation(A attachment, ActiveOperation.CompletedCallback<T> callback) throws IOException
initializeOperation in interface ManagementChannelAssociationIOExceptionpublic <T,A> ActiveOperation<T,A> executeRequest(ManagementRequest<T,A> request, A attachment, ActiveOperation.CompletedCallback<T> callback) throws IOException
executeRequest in interface ManagementChannelAssociationT - the result typeA - the attachment typerequest - the requestattachment - the attachmentcallback - the completion listenerIOExceptionpublic <T,A> ActiveOperation<T,A> executeRequest(ManagementRequest<T,A> request, A attachment) throws IOException
executeRequest in interface ManagementChannelAssociationT - the result typeA - the attachment typerequest - the requestattachment - the attachmentIOExceptionpublic <T,A> org.jboss.threads.AsyncFuture<T> executeRequest(Integer operationId, ManagementRequest<T,A> request) throws IOException
executeRequest in interface ManagementChannelAssociationT - the request typeA - the attachment typeoperationId - the operation-id of the existing active operationrequest - the requestIOExceptionpublic <T,A> org.jboss.threads.AsyncFuture<T> executeRequest(ActiveOperation<T,A> support, ManagementRequest<T,A> request) throws IOException
executeRequest in interface ManagementChannelAssociationT - the result typeA - the attachment typesupport - the active operationrequest - the requestIOExceptionprotected ManagementRequestHandler<?,?> getRequestHandler(ManagementRequestHeader header)
getRequestHandler in class AbstractMessageHandlerheader - the request headerpublic org.jboss.remoting3.Channel.Receiver getReceiver()
public org.jboss.remoting3.Attachments getAttachments()
ManagementChannelAssociationgetAttachments in interface ManagementChannelAssociationpublic void addHandlerFactory(ManagementRequestHandlerFactory factory)
factory - the request handler to addpublic boolean removeHandlerFactory(ManagementRequestHandlerFactory instance)
instance - the request handler factorytrue if the instance was removed, false otherwiseprotected <T,A> ActiveOperation<T,A> registerActiveOperation(A attachment)
attachment - the shared attachmentprotected <T,A> ActiveOperation<T,A> registerActiveOperation(A attachment, ActiveOperation.CompletedCallback<T> callback)
attachment - the shared attachmentcallback - the completed callbackprotected <T,A> ActiveOperation<T,A> registerActiveOperation(Integer id, A attachment)
id - the operation idattachment - the shared attachmentIllegalStateException - if an operation with the same id is already registeredprotected <T,A> ActiveOperation<T,A> registerActiveOperation(Integer id, A attachment, ActiveOperation.CompletedCallback<T> callback)
id - the operation idattachment - the shared attachmentcallback - the completed callbackIllegalStateException - if an operation with the same id is already registeredprotected <T,A> ActiveOperation<T,A> getActiveOperation(ManagementRequestHeader header)
header - the request headernull if if there is no registered operationprotected <T,A> ActiveOperation<T,A> getActiveOperation(Integer id)
id - the active operation idnull if if there is no registered operationpublic void handleChannelClosed(org.jboss.remoting3.Channel closed,
IOException e)
ManagementClientChannelStrategy.Establishing since it might use multiple channels.closed - the closed resourcee - the exception which occurred during close, if anyprotected List<Integer> cancelAllActiveOperations()
protected boolean isShutdown()
true if the shutdown method was called, false otherwiseCopyright © 2014 JBoss by Red Hat. All rights reserved.