/** * Creates a {@link TransactionalProtocolClient} based on the given {@code channelAssociation} and then * uses that to create a {@link TransformingProxyController}. * * @param channelAssociation the channel handler. Cannot be {@code null} * @param transformers transformers to use for transforming resources and operations. Cannot be {@code null} * @param pathAddress address under which the proxy controller is registered in the resource tree * @param addressTranslator translator to use for converting local addresses to addresses appropriate for the target process * @return the proxy controller. Will not be {@code null} */ public static TransformingProxyController create(final ManagementChannelHandler channelAssociation, final Transformers transformers, final PathAddress pathAddress, final ProxyOperationAddressTranslator addressTranslator) { final TransactionalProtocolClient client = TransactionalProtocolHandlers.createClient(channelAssociation); return create(client, transformers, pathAddress, addressTranslator); }
@Override public AsyncFuture<OperationResponse> execute(TransactionalOperationListener<Operation> listener, ModelNode operation, OperationMessageHandler messageHandler, OperationAttachments attachments) throws IOException { final Operation wrapper = TransactionalProtocolHandlers.wrap(operation, messageHandler, attachments); return execute(listener, wrapper); }
/** * 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 boolean execute(ManagedServer server) throws Exception { final ModelNode operation = new ModelNode(); operation.get(OP).set(RELOAD); operation.get(OP_ADDR).setEmptyList(); if(suspend) { operation.get(START_MODE).set(SUSPEND); } // See WFCORE-1791, Operation-id is sent back again to the HC in // HostControllerConnection.ServerRegisterRequest.sendRequest method. // With this operation-id ServerRegistrationStepHandler is able to acquire // the lock and register the server in the domain. operation.get("operation-id").set(permit); try { final TransactionalProtocolClient.PreparedOperation<?> prepared = TransactionalProtocolHandlers.executeBlocking(operation, protocolClient); if (prepared.isFailed()) { return false; } prepared.commit(); // Just commit and discard the result } catch (IOException ignore) { // } return true; } }
@Override public boolean execute(ManagedServer server) throws Exception { final ModelNode operation = new ModelNode(); operation.get(OP).set(RELOAD); operation.get(OP_ADDR).setEmptyList(); if(suspend) { operation.get(START_MODE).set(SUSPEND); } // See WFCORE-1791, Operation-id is sent back again to the HC in // HostControllerConnection.ServerRegisterRequest.sendRequest method. // With this operation-id ServerRegistrationStepHandler is able to acquire // the lock and register the server in the domain. operation.get("operation-id").set(permit); try { final TransactionalProtocolClient.PreparedOperation<?> prepared = TransactionalProtocolHandlers.executeBlocking(operation, protocolClient); if (prepared.isFailed()) { return false; } prepared.commit(); // Just commit and discard the result } catch (IOException ignore) { // } return true; } }
public static TransformingProxyController create(final ManagementChannelHandler channelAssociation, final Transformers transformers, final PathAddress pathAddress, final ProxyOperationAddressTranslator addressTranslator) { final TransactionalProtocolClient client = TransactionalProtocolHandlers.createClient(channelAssociation); return create(client, transformers, pathAddress, addressTranslator); }
@Override public AsyncFuture<OperationResponse> execute(TransactionalOperationListener<Operation> listener, ModelNode operation, OperationMessageHandler messageHandler, OperationAttachments attachments) throws IOException { return execute(listener, TransactionalProtocolHandlers.wrap(operation, messageHandler, attachments)); }
/** * 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); }
preparedOperation = TransactionalProtocolHandlers.executeBlocking(fetchContentOp, client); } catch (IOException e) { throw new OperationFailedException(e);
public static TransformingProxyController create(final ManagementChannelHandler channelAssociation, final Transformers transformers, final PathAddress pathAddress, final ProxyOperationAddressTranslator addressTranslator, final boolean validateAddresses) { final TransactionalProtocolClient client = TransactionalProtocolHandlers.createClient(channelAssociation); return create(client, transformers, pathAddress, addressTranslator, validateAddresses); }
@Override public AsyncFuture<ModelNode> execute(TransactionalOperationListener<Operation> listener, ModelNode operation, OperationMessageHandler messageHandler, OperationAttachments attachments) throws IOException { final Operation wrapper = TransactionalProtocolHandlers.wrap(operation, messageHandler, attachments); return execute(listener, wrapper); }
preparedOperation = TransactionalProtocolHandlers.executeBlocking(fetchContentOp, client); } catch (IOException e) { throw new OperationFailedException(e);
/** * Creates a new remote proxy controller using an existing channel. * * @param channelAssociation the channel association * @param pathAddress the address within the model of the created proxy controller * @param addressTranslator the translator to use translating the address for the remote proxy * @return the proxy controller */ public static RemoteProxyController create(final ManagementChannelHandler channelAssociation, final PathAddress pathAddress, final ProxyOperationAddressTranslator addressTranslator) { final TransactionalProtocolClient client = TransactionalProtocolHandlers.createClient(channelAssociation); // the remote proxy return create(client, pathAddress, addressTranslator); }
@Override public AsyncFuture<ModelNode> execute(TransactionalOperationListener<Operation> listener, ModelNode operation, OperationMessageHandler messageHandler, OperationAttachments attachments) throws IOException { final Operation wrapper = TransactionalProtocolHandlers.wrap(operation, messageHandler, attachments); return execute(listener, wrapper); }
/** * Creates a new remote proxy controller using an existing channel. * * @param channelAssociation the channel association * @param pathAddress the address within the model of the created proxy controller * @param addressTranslator the translator to use translating the address for the remote proxy * @return the proxy controller */ public static RemoteProxyController create(final ManagementChannelHandler channelAssociation, final PathAddress pathAddress, final ProxyOperationAddressTranslator addressTranslator, final boolean validateAddresses) { final TransactionalProtocolClient client = TransactionalProtocolHandlers.createClient(channelAssociation); // the remote proxy return create(client, pathAddress, addressTranslator, validateAddresses); }
@Override public AsyncFuture<OperationResponse> execute(TransactionalOperationListener<Operation> listener, ModelNode operation, OperationMessageHandler messageHandler, OperationAttachments attachments) throws IOException { final Operation wrapper = TransactionalProtocolHandlers.wrap(operation, messageHandler, attachments); return execute(listener, wrapper); }
/** * Creates a new remote proxy controller using an existing channel. * * @param channelAssociation the channel association * @param pathAddress the address within the model of the created proxy controller * @param addressTranslator the translator to use translating the address for the remote proxy * @return the proxy controller * * @deprecated only present for test case use */ @Deprecated public static RemoteProxyController create(final ManagementChannelHandler channelAssociation, final PathAddress pathAddress, final ProxyOperationAddressTranslator addressTranslator) { final TransactionalProtocolClient client = TransactionalProtocolHandlers.createClient(channelAssociation); // the remote proxy return create(client, pathAddress, addressTranslator, ModelVersion.CURRENT); }
@Override public AsyncFuture<ModelNode> execute(TransactionalOperationListener<Operation> listener, ModelNode operation, OperationMessageHandler messageHandler, OperationAttachments attachments) throws IOException { return execute(listener, TransactionalProtocolHandlers.wrap(operation, messageHandler, attachments)); }
/** * Creates a {@link TransactionalProtocolClient} based on the given {@code channelAssociation} and then * uses that to create a {@link TransformingProxyController}. * * @param channelAssociation the channel handler. Cannot be {@code null} * @param transformers transformers to use for transforming resources and operations. Cannot be {@code null} * @param pathAddress address under which the proxy controller is registered in the resource tree * @param addressTranslator translator to use for converting local addresses to addresses appropriate for the target process * @return the proxy controller. Will not be {@code null} */ public static TransformingProxyController create(final ManagementChannelHandler channelAssociation, final Transformers transformers, final PathAddress pathAddress, final ProxyOperationAddressTranslator addressTranslator) { final TransactionalProtocolClient client = TransactionalProtocolHandlers.createClient(channelAssociation); return create(client, transformers, pathAddress, addressTranslator); }
@Override public AsyncFuture<OperationResponse> execute(final TransactionalOperationListener<Operation> listener, final ModelNode operation, final OperationMessageHandler messageHandler, final OperationAttachments attachments) throws IOException { return execute(listener, TransactionalProtocolHandlers.wrap(operation, messageHandler, attachments)); }