@Override public <T extends Operation> AsyncFuture<ModelNode> execute(final TransactionalOperationListener<T> listener, final T operation) throws IOException { if(! isConnected()) { final ModelNode op = operation.getOperation(); // Handle the restartRequired operation also when disconnected if(ServerRestartRequiredHandler.OPERATION_NAME.equals(op.get(OP).asString())) { server.requireReload(); } } return remoteClient.execute(listener, operation); }
/** * 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(); }
@Override public <T extends Operation> AsyncFuture<OperationResponse> execute(final TransactionalOperationListener<T> listener, final T operation) throws IOException { final TransactionalProtocolClient remoteClient = this.remoteClient; final ModelNode op = operation.getOperation(); if (remoteClient == DISCONNECTED) { // Handle the restartRequired operation also when disconnected final String operationName = op.get(OP).asString(); if (ServerProcessStateHandler.REQUIRE_RESTART_OPERATION.equals(operationName)) { server.requireReload(); } } AsyncFuture<OperationResponse> future = remoteClient.execute(listener, operation); registerFuture(remoteClient, future); return future; }
/** * 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(); }
@Override public <T extends Operation> AsyncFuture<OperationResponse> execute(final TransactionalOperationListener<T> listener, final T operation) throws IOException { final TransactionalProtocolClient remoteClient = this.remoteClient; final ModelNode op = operation.getOperation(); if (remoteClient == DISCONNECTED) { // Handle the restartRequired operation also when disconnected final String operationName = op.get(OP).asString(); if (ServerProcessStateHandler.REQUIRE_RESTART_OPERATION.equals(operationName)) { server.requireReload(); } } AsyncFuture<OperationResponse> future = remoteClient.execute(listener, operation); registerFuture(remoteClient, future); return future; }
/** * 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(); }
validateAddress.get(VALUE).set(paramAddress.toModelNode()); validateAddress.get(OPERATION_HEADERS).set(original.get(OPERATION_HEADERS)); Future<ModelNode> futureResult = client.execute(operationListener, validateAddress, messageHandler, null); try { completed.await();
futureResult = client.execute(operationListener, translated, messageHandler, attachments);
futureResult = client.execute(operationListener, translated, messageHandler, attachments);
futureResult = client.execute(operationListener, translated, messageHandler, attachments);
futureResult = client.execute(operationListener, translated, messageHandler, attachments);
final AsyncFuture<ModelNode> result = client.execute(subsystemListener, proxyOperation); return new ExecutedHostRequest(result, transformationResult); } catch (IOException e) {
final AsyncFuture<OperationResponse> result = client.execute(subsystemListener, proxyOperation); return new ExecutedHostRequest(result, transformationResult); } catch (IOException e) {
final AsyncFuture<OperationResponse> result = client.execute(subsystemListener, proxyOperation); return new ExecutedHostRequest(result, transformationResult); } catch (IOException e) {
/** * Execute the operation. * * @param listener the transactional operation listener * @param client the transactional protocol client * @param identity the server identity * @param operation the operation * @param transformer the operation result transformer * @return whether the operation was executed */ protected boolean executeOperation(final TransactionalProtocolClient.TransactionalOperationListener<ServerOperation> listener, TransactionalProtocolClient client, final ServerIdentity identity, final ModelNode operation, final OperationResultTransformer transformer) { if(client == null) { return false; } final OperationMessageHandler messageHandler = new DelegatingMessageHandler(context); final OperationAttachments operationAttachments = new DelegatingOperationAttachments(context); final ServerOperation serverOperation = new ServerOperation(identity, operation, messageHandler, operationAttachments, transformer); try { final Future<ModelNode> result = client.execute(listener, serverOperation); recordExecutedRequest(new ExecutedServerRequest(identity, result, transformer)); } catch (IOException e) { final TransactionalProtocolClient.PreparedOperation<ServerOperation> result = BlockingQueueOperationListener.FailedOperation.create(serverOperation, e); listener.operationPrepared(result); recordExecutedRequest(new ExecutedServerRequest(identity, result.getFinalResult(), transformer)); } return true; }
/** * Execute the operation. * * @param listener the transactional operation listener * @param client the transactional protocol client * @param identity the server identity * @param operation the operation * @param transformer the operation result transformer * @return whether the operation was executed */ protected boolean executeOperation(final TransactionalProtocolClient.TransactionalOperationListener<ServerOperation> listener, TransactionalProtocolClient client, final ServerIdentity identity, final ModelNode operation, final OperationResultTransformer transformer) { if(client == null) { return false; } final OperationMessageHandler messageHandler = new DelegatingMessageHandler(context); final OperationAttachments operationAttachments = new DelegatingOperationAttachments(context); final ServerOperation serverOperation = new ServerOperation(identity, operation, messageHandler, operationAttachments, transformer); try { DomainControllerLogger.HOST_CONTROLLER_LOGGER.tracef("Sending %s to %s", operation, identity); final Future<OperationResponse> result = client.execute(listener, serverOperation); recordExecutedRequest(new ExecutedServerRequest(identity, result, transformer)); } catch (IOException e) { final TransactionalProtocolClient.PreparedOperation<ServerOperation> result = BlockingQueueOperationListener.FailedOperation.create(serverOperation, e); listener.operationPrepared(result); recordExecutedRequest(new ExecutedServerRequest(identity, result.getFinalResult(), transformer)); } return true; }
/** * Execute the operation. * * @param listener the transactional operation listener * @param client the transactional protocol client * @param identity the server identity * @param operation the operation * @param transformer the operation result transformer * @return whether the operation was executed */ protected boolean executeOperation(final TransactionalProtocolClient.TransactionalOperationListener<ServerOperation> listener, TransactionalProtocolClient client, final ServerIdentity identity, final ModelNode operation, final OperationResultTransformer transformer) { if(client == null) { return false; } final OperationMessageHandler messageHandler = new DelegatingMessageHandler(context); final OperationAttachments operationAttachments = new DelegatingOperationAttachments(context); final ServerOperation serverOperation = new ServerOperation(identity, operation, messageHandler, operationAttachments, transformer); try { DomainControllerLogger.HOST_CONTROLLER_LOGGER.tracef("Sending %s to %s", operation, identity); final Future<OperationResponse> result = client.execute(listener, serverOperation); recordExecutedRequest(new ExecutedServerRequest(identity, result, transformer)); } catch (IOException e) { final TransactionalProtocolClient.PreparedOperation<ServerOperation> result = BlockingQueueOperationListener.FailedOperation.create(serverOperation, e); listener.operationPrepared(result); recordExecutedRequest(new ExecutedServerRequest(identity, result.getFinalResult(), transformer)); } return true; }