/** * Create a transactional protocol client. * * @param channelAssociation the channel handler * @return the transactional protocol client */ public static TransactionalProtocolClient createClient(final ManagementChannelHandler channelAssociation) { final TransactionalProtocolClientImpl client = new TransactionalProtocolClientImpl(channelAssociation); channelAssociation.addHandlerFactory(client); return client; }
/** * Add a transaction protocol request handler to an existing channel. * * @param association the channel association * @param controller the model controller */ public static void addAsHandlerFactory(final ManagementChannelHandler association, final ModelController controller) { final ManagementRequestHandlerFactory handlerFactory = createHandler(association, controller); association.addHandlerFactory(handlerFactory); }
/** * Create and add model controller handler to an existing management channel handler. * * @param handler the channel handler * @return the created client */ public static ModelControllerClient createAndAdd(final ManagementChannelHandler handler) { final ExistingChannelModelControllerClient client = new ExistingChannelModelControllerClient(handler); handler.addHandlerFactory(client); return client; }
/** * Create and add model controller handler to an existing management channel handler. * * @param handler the channel handler * @return the created client */ public static ModelControllerClient createAndAdd(final ManagementChannelHandler handler) { final ExistingChannelModelControllerClient client = new ExistingChannelModelControllerClient(handler); handler.addHandlerFactory(client); return client; }
/** * Create a transactional protocol client. * * @param channelAssociation the channel handler * @return the transactional protocol client */ public static TransactionalProtocolClient createClient(final ManagementChannelHandler channelAssociation) { final TransactionalProtocolClientImpl client = new TransactionalProtocolClientImpl(channelAssociation); channelAssociation.addHandlerFactory(client); return client; }
/** * Create a transactional protocol client. * * @param channelAssociation the channel handler * @return the transactional protocol client */ public static TransactionalProtocolClient createClient(final ManagementChannelHandler channelAssociation) { final TransactionalProtocolClientImpl client = new TransactionalProtocolClientImpl(channelAssociation); channelAssociation.addHandlerFactory(client); return client; }
/** * Create a transactional protocol client. * * @param channelAssociation the channel handler * @return the transactional protocol client */ public static TransactionalProtocolClient createClient(final ManagementChannelHandler channelAssociation) { final TransactionalProtocolClientImpl client = new TransactionalProtocolClientImpl(channelAssociation); channelAssociation.addHandlerFactory(client); return client; }
/** * Add a transaction protocol request handler to an existing channel. * * @param association the channel association * @param controller the model controller */ public static void addAsHandlerFactory(final ManagementChannelHandler association, final ModelController controller) { final ManagementRequestHandlerFactory handlerFactory = createHandler(association, controller); association.addHandlerFactory(handlerFactory); }
@Override public HandleableCloseable.Key startReceiving(final Channel channel) { final ManagementChannelHandler channelHandler = new ManagementChannelHandler(channel, executorService); final ServerToHostProtocolHandler registrationHandler = new ServerToHostProtocolHandler(serverInventory.getValue(), operationExecutor, domainController, channelHandler, registrations, expressionResolver); channelHandler.addHandlerFactory(new ManagementPongRequestHandler()); channelHandler.addHandlerFactory(registrationHandler); channel.receiveMessage(channelHandler.getReceiver()); return null; }
private void setupHandler() { // Setup the transaction protocol handler handler.addHandlerFactory(new TransactionalProtocolOperationHandler(controller, handler, responseAttachmentSupport)); // Use the existing channel strategy masterProxy = ExistingChannelModelControllerClient.createAndAdd(handler); txMasterProxy = TransactionalProtocolHandlers.createClient(handler); }
private void setupHandler() { // Setup the transaction protocol handler handler.addHandlerFactory(new TransactionalProtocolOperationHandler(controller, handler, responseAttachmentSupport)); // Use the existing channel strategy masterProxy = ExistingChannelModelControllerClient.createAndAdd(handler); txMasterProxy = TransactionalProtocolHandlers.createClient(handler); }
@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 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 public ManagementChannelHandler startReceiving(final Channel channel) { final ManagementClientChannelStrategy strategy = ManagementClientChannelStrategy.create(channel); final ManagementChannelHandler channelHandler = new ManagementChannelHandler(strategy, executorService); channelHandler.getAttachments().attach(ManagementChannelHandler.TEMP_DIR, tempDir); final ServerToHostProtocolHandler registrationHandler = new ServerToHostProtocolHandler(serverInventory.getValue(), operationExecutor, domainController, channelHandler, registrations, expressionResolver); channelHandler.addHandlerFactory(new ManagementPongRequestHandler()); channelHandler.addHandlerFactory(registrationHandler); channel.receiveMessage(channelHandler.getReceiver()); return channelHandler; }
@Override public ManagementChannelHandler startReceiving(final Channel channel) { final ManagementClientChannelStrategy strategy = ManagementClientChannelStrategy.create(channel); final ManagementChannelHandler channelHandler = new ManagementChannelHandler(strategy, executorService); channelHandler.getAttachments().attach(ManagementChannelHandler.TEMP_DIR, tempDir); final ServerToHostProtocolHandler registrationHandler = new ServerToHostProtocolHandler(serverInventory.getValue(), operationExecutor, domainController, channelHandler, registrations, expressionResolver); channelHandler.addHandlerFactory(new ManagementPongRequestHandler()); channelHandler.addHandlerFactory(registrationHandler); channel.receiveMessage(channelHandler.getReceiver()); return channelHandler; }
/** * Connect to the HC and retrieve the current model updates. * * @param controller the server controller * @param callback the operation completed callback * @return the boot operations * @throws IOException for any error */ synchronized void openConnection(final ModelController controller, final ActiveOperation.CompletedCallback<ModelNode> callback) throws Exception { boolean ok = false; final Connection connection = connectionManager.connect(); try { channelHandler.executeRequest(new ServerRegisterRequest(), null, callback); channelHandler.addHandlerFactory(new TransactionalProtocolOperationHandler(controller, channelHandler)); ok = true; } finally { if(!ok) { connection.close(); } } }
@Override public ManagementChannelHandler startReceiving(Channel channel) { final ManagementChannelHandler handler = new ManagementChannelHandler(ManagementClientChannelStrategy.create(channel), getExecutor()); UserInfo userInfo = channel.getConnection().getUserInfo(); final Subject subject; if (userInfo instanceof SubjectUserInfo) { subject = ((SubjectUserInfo) userInfo).getSubject(); } else { subject = new Subject(); } handler.addHandlerFactory(new ModelControllerClientOperationHandler(getController(), handler, subject)); channel.receiveMessage(handler.getReceiver()); return handler; } }
@Override public ManagementChannelHandler startReceiving(Channel channel) { final ManagementChannelHandler handler = new ManagementChannelHandler(ManagementClientChannelStrategy.create(channel), getExecutor()); handler.addHandlerFactory(new ModelControllerClientOperationHandler(getController(), handler, getResponseAttachmentSupport(), getClientRequestExecutor(), channel.getConnection().getLocalIdentity())); channel.receiveMessage(handler.getReceiver()); return handler; } }
@Override public ManagementChannelHandler startReceiving(Channel channel) { final ManagementChannelHandler handler = new ManagementChannelHandler(ManagementClientChannelStrategy.create(channel), getExecutor()); handler.addHandlerFactory(new ModelControllerClientOperationHandler(getController(), handler, getResponseAttachmentSupport(), getClientRequestExecutor(), channel.getConnection().getLocalIdentity())); channel.receiveMessage(handler.getReceiver()); return handler; } }
/** * Connect to the HC and retrieve the current model updates. * * @param controller the server controller * @param callback the operation completed callback * * @throws IOException for any error */ synchronized void openConnection(final ModelController controller, final ActiveOperation.CompletedCallback<ModelNode> callback) throws Exception { boolean ok = false; final Connection connection = connectionManager.connect(); try { channelHandler.executeRequest(new ServerRegisterRequest(), null, callback); // HC is the same version, so it will support sending the subject channelHandler.getAttachments().attach(TransactionalProtocolClient.SEND_IDENTITY, Boolean.TRUE); channelHandler.getAttachments().attach(TransactionalProtocolClient.SEND_IN_VM, Boolean.TRUE); channelHandler.addHandlerFactory(new TransactionalProtocolOperationHandler(controller, channelHandler, responseAttachmentSupport)); ok = true; } finally { if(!ok) { connection.close(); } } }