}
}
}
private void doProcessRequest() {
final Key closeKey = getChannel().addCloseHandler(new CloseHandler<Channel>() {
public void handleClose(final Channel closed, final IOException exception) {
asynchRequests.remove(getHeader().getBatchId());
}
});
OperationAttachmentsProxy attachmentsProxy = new OperationAttachmentsProxy(getChannel(), batchId, attachmentsLength);
try {
try {
ROOT_LOGGER.tracef("Executing client request %d(%d)", batchId, getHeader().getRequestId());
if (asynch) {
//register the cancel handler
asynchRequests.put(batchId, Thread.currentThread());
}
result = controller.execute(
operation,
new OperationMessageHandlerProxy(getChannel(), batchId),
ModelController.OperationTransactionControl.COMMIT,
attachmentsProxy);
} catch (Exception e) {
final ModelNode failure = new ModelNode();
failure.get(OUTCOME).set(FAILED);
failure.get(FAILURE_DESCRIPTION).set(e.getClass().getName() + ":" + e.getMessage());
result = failure;
attachmentsProxy.shutdown(e);
} finally {
ROOT_LOGGER.tracef("Executed client request %d", batchId);
}
} finally {
if (asynch) {
asynchRequests.remove(batchId);
}
closeKey.remove();
}
}