@Override void sendMessage(FlushableDataOutput output) throws IOException { sendResponse(output, DomainControllerProtocol.PARAM_OK, extensions); } });
void failed(byte errorCode, String message) { if(completed.compareAndSet(false, true)) { failed = true; final IOTask<?> task = this.task; if(task != null) { task.setFailed(); } try { sendFailedResponse(responseChannel, errorCode, message); } catch (IOException e) { ProtocolLogger.ROOT_LOGGER.debugf(e, "failed to process message"); } activeOperation.getResultHandler().done(null); } }
final ManagementChannelHandler handler = new ManagementChannelHandler(ManagementClientChannelStrategy.create(channel), getExecutor()); handler.addHandlerFactory(new HostControllerRegistrationHandler(handler, domainController, operationExecutor, slaveRequestExecutor)); handler.addHandlerFactory(new ModelControllerClientOperationHandler(getController(), handler)); handler.addHandlerFactory(new MasterDomainControllerOperationHandlerImpl(domainController, slaveRequestExecutor));
void failed(SlaveRegistrationException.ErrorCode error, String message) { byte errorCode = error.getCode(); if(completed.compareAndSet(false, true)) { failed = true; final IOTask<?> task = this.task; if(task != null) { task.setFailed(); } try { sendFailedResponse(responseChannel, errorCode, message); } catch (IOException e) { DOMAIN_LOGGER.debugf(e, "failed to process message"); } activeOperation.getResultHandler().done(null); addFailureEvent(error); } }
@Override public ManagementChannelHandler startReceiving(final Channel channel) { final ManagementChannelHandler handler = new ManagementChannelHandler(ManagementClientChannelStrategy.create(channel), getExecutor()); handler.getAttachments().attach(ManagementChannelHandler.TEMP_DIR, tempDir); // Assemble the request handlers for the domain channel handler.addHandlerFactory(new HostControllerRegistrationHandler(handler, domainController, operationExecutor, getExecutor(), slaveHostRegistrations, domainHostExcludeRegistry)); handler.addHandlerFactory(new ModelControllerClientOperationHandler(getController(), handler, getResponseAttachmentSupport(), getClientRequestExecutor())); handler.addHandlerFactory(new MasterDomainControllerOperationHandlerImpl(domainController, getExecutor())); handler.addHandlerFactory(pongRequestHandler); handler.addHandlerFactory(new DomainTransactionalProtocolOperationHandler(txOperationExecutor, handler, getResponseAttachmentSupport())); channel.receiveMessage(handler.getReceiver()); return handler; }
@Override void sendMessage(final FlushableDataOutput output) throws IOException { sendResponse(output, DomainControllerProtocol.PARAM_OK, result); } });
void failed(SlaveRegistrationException.ErrorCode error, String message) { byte errorCode = error.getCode(); if(completed.compareAndSet(false, true)) { failed = true; final IOTask<?> task = this.task; if(task != null) { task.setFailed(); } try { sendFailedResponse(responseChannel, errorCode, message); } catch (IOException e) { DOMAIN_LOGGER.debugf(e, "failed to process message"); } activeOperation.getResultHandler().done(null); addFailureEvent(error); } }
@Override public ManagementChannelHandler startReceiving(final Channel channel) { final ManagementChannelHandler handler = new ManagementChannelHandler(ManagementClientChannelStrategy.create(channel), getExecutor()); handler.getAttachments().attach(ManagementChannelHandler.TEMP_DIR, tempDir); // Assemble the request handlers for the domain channel handler.addHandlerFactory(new HostControllerRegistrationHandler(handler, domainController, operationExecutor, getExecutor(), slaveHostRegistrations, domainHostExcludeRegistry)); handler.addHandlerFactory(new ModelControllerClientOperationHandler(getController(), handler, getResponseAttachmentSupport(), getClientRequestExecutor())); handler.addHandlerFactory(new MasterDomainControllerOperationHandlerImpl(domainController, getExecutor())); handler.addHandlerFactory(pongRequestHandler); handler.addHandlerFactory(new DomainTransactionalProtocolOperationHandler(txOperationExecutor, handler, getResponseAttachmentSupport())); channel.receiveMessage(handler.getReceiver()); return handler; }
@Override void sendMessage(FlushableDataOutput output) throws IOException { sendResponse(output, DomainControllerProtocol.PARAM_OK, extensions); } });
@Override void sendMessage(final FlushableDataOutput output) throws IOException { sendResponse(output, DomainControllerProtocol.PARAM_OK, result); } });
@Override void sendMessage(final FlushableDataOutput output) throws IOException { sendResponse(output, DomainControllerProtocol.PARAM_OK, result); } });
@Override void sendMessage(FlushableDataOutput output) throws IOException { sendResponse(output, DomainControllerProtocol.PARAM_OK, extensions); } });
void sendCompletedMessage() { if(completed.compareAndSet(false, true)) { try { sendResponse(responseChannel, DomainControllerProtocol.PARAM_OK, null); } catch (IOException e) { DOMAIN_LOGGER.debugf(e, "failed to process message"); } activeOperation.getResultHandler().done(null); } }
void sendCompletedMessage() { if(completed.compareAndSet(false, true)) { try { sendResponse(responseChannel, DomainControllerProtocol.PARAM_OK, null); } catch (IOException e) { DOMAIN_LOGGER.debugf(e, "failed to process message"); } activeOperation.getResultHandler().done(null); } }
void sendCompletedMessage() { if(completed.compareAndSet(false, true)) { try { sendResponse(responseChannel, DomainControllerProtocol.PARAM_OK, null); } catch (IOException e) { ProtocolLogger.ROOT_LOGGER.debugf(e, "failed to process message"); } activeOperation.getResultHandler().done(null); } }
/** * Send an operation response. * * @param context the request context * @param responseType the response type * @param response the operation response * @throws IOException for any error */ static void sendResponse(final ManagementRequestContext<RegistrationContext> context, final byte responseType, final ModelNode response) throws IOException { final ManagementResponseHeader header = ManagementResponseHeader.create(context.getRequestHeader()); final FlushableDataOutput output = context.writeMessage(header); try { sendResponse(output, responseType, response); } finally { StreamUtils.safeClose(output); } }
/** * Send a operation response. * * @param context the request context * @param responseType the response type * @param response the operation response * @throws IOException for any error */ static void sendResponse(final ManagementRequestContext<RegistrationContext> context, final byte responseType, final ModelNode response) throws IOException { final ManagementResponseHeader header = ManagementResponseHeader.create(context.getRequestHeader()); final FlushableDataOutput output = context.writeMessage(header); try { sendResponse(output, responseType, response); } finally { StreamUtils.safeClose(output); } }
/** * Send an operation response. * * @param context the request context * @param responseType the response type * @param response the operation response * @throws IOException for any error */ static void sendResponse(final ManagementRequestContext<RegistrationContext> context, final byte responseType, final ModelNode response) throws IOException { final ManagementResponseHeader header = ManagementResponseHeader.create(context.getRequestHeader()); final FlushableDataOutput output = context.writeMessage(header); try { sendResponse(output, responseType, response); } finally { StreamUtils.safeClose(output); } }