@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); }
void prepared(final ModelController.OperationTransaction transaction, final ModelNode result) { final PreparedOperation<T> preparedOperation = new PreparedOperationImpl<T>(operation, result, future, transaction); listener.operationPrepared(preparedOperation); }
@Override public void cancelled() { operationFailed(getResponse(CANCELLED)); }
/** * Execute blocking for a prepared result. * * @param operation the operation to execute * @param client the protocol client * @return the prepared operation * @throws IOException * @throws InterruptedException */ public static TransactionalProtocolClient.PreparedOperation<TransactionalProtocolClient.Operation> executeBlocking(final ModelNode operation, TransactionalProtocolClient client) throws IOException, InterruptedException { final BlockingQueueOperationListener<TransactionalProtocolClient.Operation> listener = new BlockingQueueOperationListener<>(); client.execute(listener, operation, OperationMessageHandler.DISCARD, OperationAttachments.EMPTY); return listener.retrievePreparedOperation(); }
/** * 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); }
/** * Wrap an operation's parameters in a simple encapsulating object * @param operation the operation * @param messageHandler the message handler * @param attachments the attachments * @return the encapsulating object */ public static TransactionalProtocolClient.Operation wrap(final ModelNode operation, final OperationMessageHandler messageHandler, final OperationAttachments attachments) { return new TransactionalOperationImpl(operation, messageHandler, attachments); }
@Override public void execute(final ModelNode operation, final OperationMessageHandler handler, final ProxyOperationControl control, final OperationAttachments attachments, final BlockingTimeout blockingTimeout) { // Execute untransformed proxy.execute(operation, handler, control, attachments, blockingTimeout); }
@Override public ModelVersion getKernelModelVersion() { return proxy.getKernelModelVersion(); } }
@Override public void run() { ResponseAttachmentInputStreamSupport.this.gc(); } }
/** * Gets a handler for requests to read an input stream. * * @return the handler */ ManagementRequestHandler<Void, Void> getReadHandler() { return new ReadHandler(); }
@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); }
void prepared(final ModelController.OperationTransaction transaction, final ModelNode result) { final PreparedOperation<T> preparedOperation = new PreparedOperationImpl<T>(operation, result, future, transaction); listener.operationPrepared(preparedOperation); }
@Override public void cancelled() { operationFailed(getResponse(CANCELLED)); }
/** * 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<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); }
void prepared(final ModelController.OperationTransaction transaction, final ModelNode result) { final PreparedOperation<T> preparedOperation = new PreparedOperationImpl<T>(operation, result, future, transaction); listener.operationPrepared(preparedOperation); }
@Override public void cancelled() { operationFailed(getResponse(CANCELLED)); }
@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); }
void prepared(final ModelController.OperationTransaction transaction, final ModelNode result) { final PreparedOperation<T> preparedOperation = new PreparedOperationImpl<T>(operation, result, future, transaction); listener.operationPrepared(preparedOperation); }
@Override public void cancelled() { operationFailed(getResponse(CANCELLED)); }