@Override public Integer getOperationId() { return support.getOperationId(); }
@Override public Integer getOperationId() { return support.getOperationId(); }
Integer getOperationId() { return operation.getOperationId(); }
Integer getOperationId() { return operation.getOperationId(); }
@Override public Integer getOperationId() { return support.getOperationId(); }
@Override public Integer getOperationId() { return support.getOperationId(); }
Integer getOperationId() { return operation.getOperationId(); }
Integer getOperationId() { return operation.getOperationId(); }
protected AsyncFuture<OperationResponse> executeRequest(final ManagementRequest<OperationResponse, OperationExecutionContext> request, final OperationExecutionContext attachment) throws IOException { final ActiveOperation<OperationResponse, OperationExecutionContext> support = getChannelAssociation().executeRequest(request, attachment, attachment); return new DelegatingCancellableAsyncFuture(support.getResult(), support.getOperationId()); }
protected AsyncFuture<ModelNode> executeRequest(final ManagementRequest<ModelNode, OperationExecutionContext> request, final OperationExecutionContext attachment) throws IOException { final ActiveOperation<ModelNode, OperationExecutionContext> support = getChannelAssociation().executeRequest(request, attachment, attachment); return new DelegatingCancellableAsyncFuture(support.getResult(), support.getOperationId()); }
/** * Execute a request. * * @param request the request * @param channel the channel * @param support the request support * @return the future result */ protected <T, A> AsyncFuture<T> executeRequest(final ManagementRequest<T, A> request, final Channel channel, final ActiveOperation<T, A> support) { assert support != null; updateChannelRef(support, channel); final Integer requestId = this.requestID.incrementAndGet(); final ActiveRequest<T, A> ar = new ActiveRequest<T, A>(support, request); requests.put(requestId, ar); final ManagementRequestHeader header = new ManagementRequestHeader(ManagementProtocol.VERSION, requestId, support.getOperationId(), request.getOperationType()); final ActiveOperation.ResultHandler<T> resultHandler = support.getResultHandler(); try { request.sendRequest(resultHandler, new ManagementRequestContextImpl<T, A>(support, channel, header, getExecutor())); } catch (Exception e) { resultHandler.failed(e); requests.remove(requestId); } return support.getResult(); }
/** * Execute a request. * * @param request the request * @param channel the channel * @param support the request support * @return the future result */ protected <T, A> AsyncFuture<T> executeRequest(final ManagementRequest<T, A> request, final Channel channel, final ActiveOperation<T, A> support) { assert support != null; updateChannelRef(support, channel); final Integer requestId = this.requestID.incrementAndGet(); final ActiveRequest<T, A> ar = new ActiveRequest<T, A>(support, request); requests.put(requestId, ar); final ManagementRequestHeader header = new ManagementRequestHeader(ManagementProtocol.VERSION, requestId, support.getOperationId(), request.getOperationType()); final ActiveOperation.ResultHandler<T> resultHandler = support.getResultHandler(); try { request.sendRequest(resultHandler, new ManagementRequestContextImpl<T, A>(support, channel, header, getExecutor())); } catch (Exception e) { resultHandler.failed(e); requests.remove(requestId); } return support.getResult(); }
final ActiveRequest<T, A> ar = new ActiveRequest<T, A>(support, request, channel); requests.put(requestId, ar); final ManagementRequestHeader header = new ManagementRequestHeader(ManagementProtocol.VERSION, requestId, support.getOperationId(), request.getOperationType()); final ActiveOperation.ResultHandler<T> resultHandler = support.getResultHandler(); try {
/** * Sends the final response to the remote client after the prepare phase has been executed. * This should be called whether the outcome was successful or not. */ synchronized void completed(final OperationResponse response) { assert prepared; if (responseChannel != null) { // Normal case, where a COMPLETE_TX_REQUEST came in after the prepare() call and // established a new responseChannel so the client can correlate the response ControllerLogger.MGMT_OP_LOGGER.tracef("sending completed response %s for %d --- interrupted: %s", response.getResponseNode(), getOperationId(), Thread.currentThread().isInterrupted()); streamSupport.registerStreams(operation.getOperationId(), response.getInputStreams()); try { sendResponse(responseChannel, ModelControllerProtocol.PARAM_OPERATION_COMPLETED, response.getResponseNode()); responseChannel = null; // we've now sent a response to the COMPLETE_TX_REQUEST, so we can't use this one further } catch (IOException e) { ControllerLogger.MGMT_OP_LOGGER.failedSendingCompletedResponse(e, response.getResponseNode(), getOperationId()); } finally { getResultHandler().done(null); } } else { // We were cancelled or somehow failed after sending our prepare() message but before we got a COMPLETE_TX_REQUEST. // The client will not be able to deal with any response until it sends a COMPLETE_TX_REQUEST // (which is why we null out responseChannel in prepare()). So, just cache this response // so we can send it in completeTx when the COMPLETE_TX_REQUEST comes in. assert postPrepareRaceResponse == null; // else we got called twice locally! ControllerLogger.MGMT_OP_LOGGER.tracef("received a post-prepare response for %d but no " + "COMPLETE_TX_REQUEST has been received; caching the response", getOperationId()); postPrepareRaceResponse = response; } }
/** * Sends the final response to the remote client after the prepare phase has been executed. * This should be called whether the outcome was successful or not. */ synchronized void completed(final OperationResponse response) { assert prepared; if (responseChannel != null) { // Normal case, where a COMPLETE_TX_REQUEST came in after the prepare() call and // established a new responseChannel so the client can correlate the response ControllerLogger.MGMT_OP_LOGGER.tracef("sending completed response %s for %d --- interrupted: %s", response.getResponseNode(), getOperationId(), Thread.currentThread().isInterrupted()); streamSupport.registerStreams(operation.getOperationId(), response.getInputStreams()); try { sendResponse(responseChannel, ModelControllerProtocol.PARAM_OPERATION_COMPLETED, response.getResponseNode()); responseChannel = null; // we've now sent a response to the COMPLETE_TX_REQUEST, so we can't use this one further } catch (IOException e) { ControllerLogger.MGMT_OP_LOGGER.failedSendingCompletedResponse(e, response.getResponseNode(), getOperationId()); } finally { getResultHandler().done(null); } } else { // We were cancelled or somehow failed after sending our prepare() message but before we got a COMPLETE_TX_REQUEST. // The client will not be able to deal with any response until it sends a COMPLETE_TX_REQUEST // (which is why we null out responseChannel in prepare()). So, just cache this response // so we can send it in completeTx when the COMPLETE_TX_REQUEST comes in. assert postPrepareRaceResponse == null; // else we got called twice locally! ControllerLogger.MGMT_OP_LOGGER.tracef("received a post-prepare response for %d but no " + "COMPLETE_TX_REQUEST has been received; caching the response", getOperationId()); postPrepareRaceResponse = response; } }
Integer operationID = registrationContext.activeOperation.getOperationId();
Integer operationID = registrationContext.activeOperation.getOperationId();