Search in sources :

Example 16 with Request

use of jakarta.ws.rs.core.Request in project resteasy by resteasy.

the class SynchronousDispatcher method invokePropagateNotFound.

/**
 * Propagate NotFoundException.  This is used for Filters.
 *
 * @param request http request
 * @param response http response
 */
public void invokePropagateNotFound(HttpRequest request, HttpResponse response) throws NotFoundException {
    try {
        pushContextObjects(request, response);
        preprocess(request, response, () -> {
            ResourceInvoker invoker = null;
            try {
                try {
                    invoker = getInvoker(request);
                } catch (Exception failure) {
                    if (failure instanceof NotFoundException) {
                        throw ((NotFoundException) failure);
                    } else {
                        // logger.error("getInvoker() failed mapping exception", failure);
                        writeException(request, response, failure, t -> {
                        });
                        return;
                    }
                }
                invoke(request, response, invoker);
            } finally {
                // we're probably clearing it twice but still required
                clearContextData();
            }
        });
    } finally {
        clearContextData();
    }
}
Also used : Registry(org.jboss.resteasy.spi.Registry) HashMap(java.util.HashMap) ResteasyConfiguration(org.jboss.resteasy.spi.ResteasyConfiguration) ArrayList(java.util.ArrayList) RESTEasyTracingLogger(org.jboss.resteasy.tracing.RESTEasyTracingLogger) HashSet(java.util.HashSet) ResteasyProviderFactory(org.jboss.resteasy.spi.ResteasyProviderFactory) Messages(org.jboss.resteasy.resteasy_jaxrs.i18n.Messages) Response(jakarta.ws.rs.core.Response) RequestImpl(org.jboss.resteasy.specimpl.RequestImpl) ResourceInvoker(org.jboss.resteasy.spi.ResourceInvoker) LogMessages(org.jboss.resteasy.resteasy_jaxrs.i18n.LogMessages) ContainerRequestFilter(jakarta.ws.rs.container.ContainerRequestFilter) Dispatcher(org.jboss.resteasy.spi.Dispatcher) Map(java.util.Map) Cleanable(org.jboss.resteasy.plugins.server.Cleanable) Request(jakarta.ws.rs.core.Request) Cleanables(org.jboss.resteasy.plugins.server.Cleanables) NotFoundException(jakarta.ws.rs.NotFoundException) Iterator(java.util.Iterator) UnhandledException(org.jboss.resteasy.spi.UnhandledException) Set(java.util.Set) HttpRequest(org.jboss.resteasy.spi.HttpRequest) IOException(java.io.IOException) CompletionException(java.util.concurrent.CompletionException) UriInfo(jakarta.ws.rs.core.UriInfo) HttpRequestPreprocessor(org.jboss.resteasy.spi.HttpRequestPreprocessor) HttpResponse(org.jboss.resteasy.spi.HttpResponse) Consumer(java.util.function.Consumer) ResteasyAsynchronousContext(org.jboss.resteasy.spi.ResteasyAsynchronousContext) List(java.util.List) BuiltResponse(org.jboss.resteasy.specimpl.BuiltResponse) HttpHeaders(jakarta.ws.rs.core.HttpHeaders) ResourceContext(jakarta.ws.rs.container.ResourceContext) Failure(org.jboss.resteasy.spi.Failure) InternalServerErrorException(org.jboss.resteasy.spi.InternalServerErrorException) Providers(jakarta.ws.rs.ext.Providers) PreMatchContainerRequestContext(org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext) NotFoundException(jakarta.ws.rs.NotFoundException) ResourceInvoker(org.jboss.resteasy.spi.ResourceInvoker) NotFoundException(jakarta.ws.rs.NotFoundException) UnhandledException(org.jboss.resteasy.spi.UnhandledException) IOException(java.io.IOException) CompletionException(java.util.concurrent.CompletionException) InternalServerErrorException(org.jboss.resteasy.spi.InternalServerErrorException)

Aggregations

Request (jakarta.ws.rs.core.Request)16 Response (jakarta.ws.rs.core.Response)11 UriInfo (jakarta.ws.rs.core.UriInfo)9 List (java.util.List)9 HttpHeaders (jakarta.ws.rs.core.HttpHeaders)8 Map (java.util.Map)8 NotFoundException (jakarta.ws.rs.NotFoundException)7 IOException (java.io.IOException)7 ResourceContext (jakarta.ws.rs.container.ResourceContext)6 Providers (jakarta.ws.rs.ext.Providers)6 HashMap (java.util.HashMap)6 ContainerRequestFilter (jakarta.ws.rs.container.ContainerRequestFilter)4 ArrayList (java.util.ArrayList)4 HashSet (java.util.HashSet)4 Iterator (java.util.Iterator)4 Set (java.util.Set)4 CompletionException (java.util.concurrent.CompletionException)4 Consumer (java.util.function.Consumer)4 PreMatchContainerRequestContext (org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext)4 Cleanable (org.jboss.resteasy.plugins.server.Cleanable)4