@Override public ContainerRequest get() { return reference.get().request(); } }
@Override public RequestProcessingContext apply(RequestProcessingContext requestContext) { requestContext.request().setWorkers(workersFactory.get()); return requestContext; } }
@Override public ContainerResponse apply( final RequestProcessingContext requestContext) { return new ContainerResponse(requestContext.request(), abortResponse); } }));
@Override public RequestProcessingContext apply(RequestProcessingContext requestContext) { requestContext.request().setWorkers(workersFactory.get()); return requestContext; } }
@Override public ContainerRequest get() { return reference.get().request(); } }
@Override public ContainerResponse apply( final RequestProcessingContext requestContext) { return new ContainerResponse(requestContext.request(), abortResponse); } }));
public Responder(final RequestProcessingContext processingContext, final ServerRuntime runtime) { this.processingContext = processingContext; this.runtime = runtime; this.tracingLogger = TracingLogger.getInstance(processingContext.request()); }
public Responder(final RequestProcessingContext processingContext, final ServerRuntime runtime) { this.processingContext = processingContext; this.runtime = runtime; this.tracingLogger = TracingLogger.getInstance(processingContext.request()); }
@Override public boolean setTimeout(final long time, final TimeUnit unit) { try { responder.processingContext.request().getResponseWriter().setSuspendTimeout(time, unit); return true; } catch (final IllegalStateException ex) { LOGGER.log(Level.FINER, "Unable to set timeout on the AsyncResponse.", ex); return false; } }
@Override public boolean setTimeout(final long time, final TimeUnit unit) { try { responder.processingContext.request().getResponseWriter().setSuspendTimeout(time, unit); return true; } catch (final IllegalStateException ex) { LOGGER.log(Level.FINER, "Unable to set timeout on the AsyncResponse.", ex); return false; } }
private ContainerResponse convertResponse(final Response exceptionResponse) { final ContainerResponse containerResponse = new ContainerResponse(processingContext.request(), exceptionResponse); containerResponse.setMappedFromException(true); return containerResponse; }
private ContainerResponse convertResponse(final Response exceptionResponse) { final ContainerResponse containerResponse = new ContainerResponse(processingContext.request(), exceptionResponse); containerResponse.setMappedFromException(true); return containerResponse; }
@Override public boolean suspend() { synchronized (stateLock) { if (state == RUNNING) { if (responder.processingContext.request().getResponseWriter().suspend( AsyncResponse.NO_TIMEOUT, TimeUnit.SECONDS, this)) { state = SUSPENDED; return true; } } } return false; }
@Override public boolean suspend() { synchronized (stateLock) { if (state == RUNNING) { if (responder.processingContext.request().getResponseWriter().suspend( AsyncResponse.NO_TIMEOUT, TimeUnit.SECONDS, this)) { state = SUSPENDED; return true; } } } return false; }
/** * Initialize the request references using the incoming request processing context. * * * @param context incoming request context. * @return same (unmodified) request context. */ @Override public RequestProcessingContext apply(final RequestProcessingContext context) { processingContextRefProvider.get().set(context); final RequestScopedInitializer requestScopedInitializer = context.request().getRequestScopedInitializer(); if (requestScopedInitializer != null) { requestScopedInitializer.initialize(injectionManager); } return context; } }
@Override public void run() { try { requestScopeListener.resume(foreignScopeInstance, responder.runtime.injectionManager); final Response jaxrsResponse = (response instanceof Response) ? (Response) response : Response.ok(response).build(); if (!responder.runtime.disableLocationHeaderRelativeUriResolution) { ServerRuntime.ensureAbsolute(jaxrsResponse.getLocation(), jaxrsResponse.getHeaders(), responder.processingContext.request(), responder.runtime.rfc7231LocationHeaderRelativeUriResolution); } responder.process(new ContainerResponse(responder.processingContext.request(), jaxrsResponse)); } catch (final Throwable t) { responder.process(t); } } });
@Override public void run() { try { requestScopeListener.resume(foreignScopeInstance, responder.runtime.injectionManager); final Response response = responseValue.get(); responder.process(new ContainerResponse(responder.processingContext.request(), response)); } catch (final Throwable t) { responder.process(t); } } });
@Override public Continuation apply(final RequestProcessingContext processingContext) { final RoutingContext rc = processingContext.routingContext(); rc.pushMatchResult(new SingleMatchResult("/" + processingContext.request().getPath(false))); return Continuation.of(processingContext, rootRouter); } }
@Override public void run() { try { requestScopeListener.resume(foreignScopeInstance, responder.runtime.injectionManager); final Response response = responseValue.get(); responder.process(new ContainerResponse(responder.processingContext.request(), response)); } catch (final Throwable t) { responder.process(t); } } });
@Override public Continuation apply(final RequestProcessingContext processingContext) { final RoutingContext rc = processingContext.routingContext(); rc.pushMatchResult(new SingleMatchResult("/" + processingContext.request().getPath(false))); return Continuation.of(processingContext, rootRouter); } }