new RequestProcessingInitializationStage(clientRequest, bootstrapBag.getMessageBodyWorkers(), injectionManager); Stage.Builder<ClientRequest> requestingChainBuilder = Stages.chain(requestProcessingInitializationStage); this.responseProcessingRoot = responseFilteringStage != null ? responseFilteringStage : Stages.identity(); this.managedObjectsFinalizer = bootstrapBag.getManagedObjectsFinalizer(); this.config = config;
private void processResponse(final ClientResponse response, final ResponseCallback callback) { final ClientResponse processedResponse; try { processedResponse = Stages.process(response, responseProcessingRoot); } catch (final Throwable throwable) { processFailure(throwable, callback); return; } callback.completed(processedResponse, requestScope); }
@Override public Continuation<RequestProcessingContext> apply(final RequestProcessingContext processingContext) { final Endpoint endpoint = processingContext.routingContext().getEndpoint(); return endpoint != null ? Continuation.of(processingContext, Stages.asStage(endpoint)) : Continuation.of(processingContext); } }
.chain(referencesInitializer) .to(preMatchRequestFilteringStage) .to(routingStage)
/** * Run the data through a chain of stages identified by the root stage. * * If an inflector is found in the leaf stage, it's reference is set into the {@code inflectorRef} * parameter. * * @param <DATA> processed data type. * @param data data to be processed. * @param rootStage root stage of the stage chain. * @param inflectorRef a mutable reference to an inflector. * @return processing result. */ public static <DATA, RESULT, T extends Inflector<DATA, RESULT>> DATA process( DATA data, Stage<DATA> rootStage, Ref<T> inflectorRef) { Stage<DATA> lastStage = rootStage; Stage.Continuation<DATA> continuation = Stage.Continuation.of(data, lastStage); while (continuation.next() != null) { lastStage = continuation.next(); continuation = lastStage.apply(continuation.result()); } inflectorRef.set(Stages.<DATA, RESULT, T>extractInflector(lastStage)); return continuation.result(); }
.chain(referencesInitializer) .to(preMatchRequestFilteringStage) .to(routingStage)
/** * Run the data through a chain of stages identified by the root stage. * * If an inflector is found in the leaf stage, it's reference is set into the {@code inflectorRef} * parameter. * * @param <DATA> processed data type. * @param data data to be processed. * @param rootStage root stage of the stage chain. * @param inflectorRef a mutable reference to an inflector. * @return processing result. */ public static <DATA, RESULT, T extends Inflector<DATA, RESULT>> DATA process( DATA data, Stage<DATA> rootStage, Ref<T> inflectorRef) { Stage<DATA> lastStage = rootStage; Stage.Continuation<DATA> continuation = Stage.Continuation.of(data, lastStage); while (continuation.next() != null) { lastStage = continuation.next(); continuation = lastStage.apply(continuation.result()); } inflectorRef.set(Stages.<DATA, RESULT, T>extractInflector(lastStage)); return continuation.result(); }
private void processResponse(final ClientResponse response, final ResponseCallback callback) { final ClientResponse processedResponse; try { processedResponse = Stages.process(response, responseProcessingRoot); } catch (final Throwable throwable) { processFailure(throwable, callback); return; } callback.completed(processedResponse, requestScope); }
new RequestProcessingInitializationStage(clientRequest, bootstrapBag.getMessageBodyWorkers(), injectionManager); Stage.Builder<ClientRequest> requestingChainBuilder = Stages.chain(requestProcessingInitializationStage); this.responseProcessingRoot = responseFilteringStage != null ? responseFilteringStage : Stages.identity(); this.managedObjectsFinalizer = bootstrapBag.getManagedObjectsFinalizer(); this.config = config;
@Override public Continuation<RequestProcessingContext> apply(final RequestProcessingContext processingContext) { final Endpoint endpoint = processingContext.routingContext().getEndpoint(); return endpoint != null ? Continuation.of(processingContext, Stages.asStage(endpoint)) : Continuation.of(processingContext); } }
.chain(referencesInitializer) .to(preMatchRequestFilteringStage) .to(routingStage)
/** * Run the data through a chain of stages identified by the root stage. * * If an inflector is found in the leaf stage, it's reference is set into the {@code inflectorRef} * parameter. * * @param <DATA> processed data type. * @param data data to be processed. * @param rootStage root stage of the stage chain. * @param inflectorRef a mutable reference to an inflector. * @return processing result. */ public static <DATA, RESULT, T extends Inflector<DATA, RESULT>> DATA process( DATA data, Stage<DATA> rootStage, Ref<T> inflectorRef) { Stage<DATA> lastStage = rootStage; Stage.Continuation<DATA> continuation = Stage.Continuation.of(data, lastStage); while (continuation.next() != null) { lastStage = continuation.next(); continuation = lastStage.apply(continuation.result()); } inflectorRef.set(Stages.<DATA, RESULT, T>extractInflector(lastStage)); return continuation.result(); }
private void processResponse(final ClientResponse response, final ResponseCallback callback) { final ClientResponse processedResponse; try { processedResponse = Stages.process(response, responseProcessingRoot); } catch (final Throwable throwable) { processFailure(throwable, callback); return; } callback.completed(processedResponse, requestScope); }
new RequestProcessingInitializationStage(clientRequest, bootstrapBag.getMessageBodyWorkers(), injectionManager); Stage.Builder<ClientRequest> requestingChainBuilder = Stages.chain(requestProcessingInitializationStage); this.responseProcessingRoot = responseFilteringStage != null ? responseFilteringStage : Stages.identity(); this.managedObjectsFinalizer = bootstrapBag.getManagedObjectsFinalizer(); this.config = config;
if (abortResponse != null) { return Continuation.of(context, Stages.asStage( new Endpoint() { @Override
.chain(referencesInitializer) .to(preMatchRequestFilteringStage) .to(routingStage)
/** * Run the data through a chain of stages identified by the root stage. * * If an inflector is found in the leaf stage, it's reference is set into the {@code inflectorRef} * parameter. * * @param <DATA> processed data type. * @param data data to be processed. * @param rootStage root stage of the stage chain. * @param inflectorRef a mutable reference to an inflector. * @return processing result. */ public static <DATA, RESULT, T extends Inflector<DATA, RESULT>> DATA process( DATA data, Stage<DATA> rootStage, Ref<T> inflectorRef) { Stage<DATA> lastStage = rootStage; Stage.Continuation<DATA> continuation = Stage.Continuation.of(data, lastStage); while (continuation.next() != null) { lastStage = continuation.next(); continuation = lastStage.apply(continuation.result()); } inflectorRef.set(Stages.<DATA, RESULT, T>extractInflector(lastStage)); return continuation.result(); }
private ContainerResponse processResponse(ContainerResponse response) { final Stage<ContainerResponse> respondingRoot = processingContext.createRespondingRoot(); if (respondingRoot != null) { response = Stages.process(response, respondingRoot); } writeResponse(response); // no-exception zone // the methods below are guaranteed to not throw any exceptions completionCallbackRunner.onComplete(null); return response; }
.chain(locator.createAndInitialize(RequestProcessingInitializationStage.class)); final ChainableStage<ClientRequest> requestFilteringStage = ClientFilteringStages.createRequestFilteringStage(locator); this.requestProcessingRoot = requestFilteringStage != null ? responseFilteringStage : Stages.<ClientResponse>identity();
if (abortResponse != null) { return Continuation.of(context, Stages.asStage( new Endpoint() { @Override