Class ResteasyReactiveRequestContext
java.lang.Object
org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext<ResteasyReactiveRequestContext,ServerRestHandler>
org.jboss.resteasy.reactive.server.core.ResteasyReactiveRequestContext
- All Implemented Interfaces:
Closeable,AutoCloseable,Runnable,org.jboss.resteasy.reactive.common.core.ResteasyReactiveCallbackContext,ResteasyReactiveInjectionContext,ServerRequestContext
public abstract class ResteasyReactiveRequestContext
extends org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext<ResteasyReactiveRequestContext,ServerRestHandler>
implements Closeable, ResteasyReactiveInjectionContext, ServerRequestContext
-
Field Summary
FieldsFields inherited from class org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext
abortHandlerChain, CUSTOM_RR_PROPERTIES_PREFIX, handlers, log, logWebApplicationExceptions, position, throwable -
Constructor Summary
ConstructorsConstructorDescriptionResteasyReactiveRequestContext(Deployment deployment, org.jboss.resteasy.reactive.spi.ThreadSetupAction requestContext, ServerRestHandler[] handlerChain, ServerRestHandler[] abortHandlerChain) -
Method Summary
Modifier and TypeMethodDescriptionvoidabortWith(jakarta.ws.rs.core.Response response) Meant to be used when an error occurred early in processing chainvoidclose()protected jakarta.ws.rs.core.SecurityContextprotected voidgetAllPathParameters(boolean encoded) Collects all path parameters, first from the current RuntimeResource, also known as target, and then from the previous RuntimeResources, including path parameters from sub resource locators in the process.<T> TgetBeanParameter(Class<T> type) Gets the bean parameter instance by type via CDI, and registers a cleanup for it.<T> TgetContextParameter(Class<T> type) Gets the context parameter instance by type for predefined types, also calls unwrap, and CDI.getCookieParameter(String name) protected abstract ExecutorgetFormParameter(String name, boolean single, boolean encoded) getMatrixParameter(String name, boolean single, boolean encoded) Object[]getPath()Returns the normalised non-decoded path including any prefix.getPathParam(int index, boolean encoded) getPathParameter(String name, boolean encoded) List<jakarta.ws.rs.core.PathSegment> Return the path segmentsReturns the normalised non-decoded path excluding any prefix.getQueryParameter(String name, boolean single, boolean encoded) getQueryParameter(String name, boolean single, boolean encoded, String separator) jakarta.ws.rs.ext.ReaderInterceptor[]jakarta.ws.rs.core.Requestjakarta.ws.rs.core.HttpHeadersgetResourceLocatorPathParam(String name, boolean encoded) Returns the current response content type.jakarta.ws.rs.core.MediaTypejakarta.ws.rs.core.SecurityContextjakarta.ws.rs.core.UriInfojakarta.ws.rs.ext.WriterInterceptor[]protected voidbooleanvoidhandleUnmappedException(Throwable throwable) protected voidhandleUnrecoverableError(Throwable throwable) booleanbooleanvoidinitializes the path segments and removes any matrix params for the path used for matching.booleanbooleanvoidabstract RunnableregisterTimer(long millis, Runnable task) protected voidvoidResets the build time serialization assumptions.voidrestart(RuntimeResource target) Restarts handler chain processing with a new chain targeting a new resource.voidrestart(RuntimeResource target, boolean setLocatorTarget) protected voidrestarted(boolean keepTarget) booleanRestarts handler chain processing if another initial match is found.abstract booleanvoidprotected voidsecurityContextUpdated(jakarta.ws.rs.core.SecurityContext securityContext) abstract ServerHttpRequestabstract ServerHttpResponsevoidsetAdditionalAnnotations(Annotation[] additionalAnnotations) voidsetAllAnnotations(Annotation[] annotations) setAsyncResponse(AsyncResponseImpl asyncResponse) setEndpointInstance(Object endpointInstance) setEntityWriter(EntityWriter entityWriter) setFormData(FormData formData) setGenericReturnType(Type genericReturnType) setInputStream(InputStream inputStream) voidsetMaxPathParams(int maxPathParams) voidsetMethodAnnotations(Annotation[] methodAnnotations) voidsetOutputStream(OutputStream outputStream) setPathParamValue(int index, String value) voidsetProducesChecked(boolean checked) protected voidsetQueryParamsFrom(String uri) setReaderInterceptors(jakarta.ws.rs.ext.ReaderInterceptor[] readerInterceptors) voidsetRemaining(String remaining) setRequestEntity(Object requestEntity) setRequestUri(URI requestURI) setResponse(LazyResponse response) setResponseContentType(jakarta.ws.rs.core.MediaType responseContentType) setResponseContentType(EncodedMediaType responseContentType) setSecurityContext(jakarta.ws.rs.core.SecurityContext securityContext) voidsetSseEventSink(SseEventSinkImpl sseEventSink) voidsetupInitialMatchAndRestart(RequestMapper.RequestMatch<RestInitialHandler.InitialMatch> initialMatch) voidsetUriInfo(jakarta.ws.rs.core.UriInfo uriInfo) setWriterInterceptors(jakarta.ws.rs.ext.WriterInterceptor[] writerInterceptors) <T> TMethods inherited from class org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext
beginAsyncProcessing, captureCDIRequestScope, getAbortHandlerChain, getContextExecutor, getHandlers, getPosition, getProperty, getPropertyNames, handleException, handleException, invokeHandler, isRequestScopeManagementRequired, isSuspended, onPreRequestScopeActivation, registerCompletionCallback, registerConnectionCallback, removeProperty, requireCDIRequestScope, restart, restart, resume, resume, resume, resume, run, setAbortHandlerChain, setAbortHandlerChainStarted, setPosition, setProperty, setSuspended, suspend, unwrapExceptionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jboss.resteasy.reactive.common.core.ResteasyReactiveCallbackContext
registerCompletionCallback, registerConnectionCallback
-
Field Details
-
EMPTY_ARRAY
-
deployment
-
-
Constructor Details
-
ResteasyReactiveRequestContext
public ResteasyReactiveRequestContext(Deployment deployment, org.jboss.resteasy.reactive.spi.ThreadSetupAction requestContext, ServerRestHandler[] handlerChain, ServerRestHandler[] abortHandlerChain)
-
-
Method Details
-
serverRequest
-
serverResponse
- Specified by:
serverResponsein interfaceServerRequestContext
-
getRequestHeaders
public jakarta.ws.rs.core.HttpHeaders getRequestHeaders()- Specified by:
getRequestHeadersin interfaceServerRequestContext
-
getDeployment
-
getProviders
-
restart
Restarts handler chain processing with a new chain targeting a new resource.- Parameters:
target- The resource target
-
restart
-
setupInitialMatchAndRestart
public void setupInitialMatchAndRestart(RequestMapper.RequestMatch<RestInitialHandler.InitialMatch> initialMatch) -
restartWithNextInitialMatch
public boolean restartWithNextInitialMatch()Restarts handler chain processing if another initial match is found.- Returns:
- true if a restart occurred
-
abortWith
public void abortWith(jakarta.ws.rs.core.Response response) Meant to be used when an error occurred early in processing chain- Specified by:
abortWithin interfaceServerRequestContext
-
resetBuildTimeSerialization
public void resetBuildTimeSerialization()Resets the build time serialization assumptions. Called if a filter modifies the response -
getUriInfo
public jakarta.ws.rs.core.UriInfo getUriInfo() -
getHttpHeaders
-
getParameters
-
setMaxPathParams
public void setMaxPathParams(int maxPathParams) -
getPathParam
-
setPathParamValue
-
setUriInfo
public void setUriInfo(jakarta.ws.rs.core.UriInfo uriInfo) -
getRequestEntity
-
setRequestEntity
-
getEntityWriter
-
setEntityWriter
-
getEndpointInstance
-
setEndpointInstance
-
getResult
-
getThrowable
- Overrides:
getThrowablein classorg.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext<ResteasyReactiveRequestContext,ServerRestHandler>
-
getResponseEntity
-
setResult
-
handlesUnmappedException
public boolean handlesUnmappedException() -
handleUnmappedException
-
getTarget
-
mapExceptionIfPresent
public void mapExceptionIfPresent() -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classorg.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext<ResteasyReactiveRequestContext,ServerRestHandler>
-
getResponse
-
setResponse
-
getRequest
public jakarta.ws.rs.core.Request getRequest() -
getContainerRequestContext
-
getContainerResponseContext
-
getMethod
-
setMethod
-
setRemaining
-
getRemaining
-
getPathWithoutPrefix
Returns the normalised non-decoded path excluding any prefix. -
getPath
Returns the normalised non-decoded path including any prefix. -
getAbsoluteURI
-
getScheme
-
getAuthority
-
setRequestUri
-
setQueryParamsFrom
-
getResponseContentType
Returns the current response content type. If a response has been set and has an explicit content type then this is used, otherwise it returns any content type that has been explicitly set.- Specified by:
getResponseContentTypein interfaceServerRequestContext
-
getResponseMediaType
public jakarta.ws.rs.core.MediaType getResponseMediaType()- Specified by:
getResponseMediaTypein interfaceServerRequestContext
-
setResponseContentType
-
setResponseContentType
public ResteasyReactiveRequestContext setResponseContentType(jakarta.ws.rs.core.MediaType responseContentType) -
getAllAnnotations
-
setAllAnnotations
-
getMethodAnnotations
-
setMethodAnnotations
-
getAdditionalAnnotations
-
setAdditionalAnnotations
-
hasGenericReturnType
public boolean hasGenericReturnType() -
getGenericReturnType
-
setGenericReturnType
-
getAsyncResponse
-
setAsyncResponse
-
getReaderInterceptors
public jakarta.ws.rs.ext.ReaderInterceptor[] getReaderInterceptors() -
setReaderInterceptors
public ResteasyReactiveRequestContext setReaderInterceptors(jakarta.ws.rs.ext.ReaderInterceptor[] readerInterceptors) -
getWriterInterceptors
public jakarta.ws.rs.ext.WriterInterceptor[] getWriterInterceptors() -
setWriterInterceptors
public ResteasyReactiveRequestContext setWriterInterceptors(jakarta.ws.rs.ext.WriterInterceptor[] writerInterceptors) -
handleUnrecoverableError
- Specified by:
handleUnrecoverableErrorin classorg.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext<ResteasyReactiveRequestContext,ServerRestHandler>
-
endResponse
protected void endResponse() -
handleRequestScopeActivation
protected void handleRequestScopeActivation()- Specified by:
handleRequestScopeActivationin classorg.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext<ResteasyReactiveRequestContext,ServerRestHandler>
-
requestScopeDeactivated
protected void requestScopeDeactivated()- Overrides:
requestScopeDeactivatedin classorg.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext<ResteasyReactiveRequestContext,ServerRestHandler>
-
restarted
protected void restarted(boolean keepTarget) - Specified by:
restartedin classorg.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext<ResteasyReactiveRequestContext,ServerRestHandler>
-
saveUriMatchState
public void saveUriMatchState() -
getMatchedURIs
-
hasInputStream
public boolean hasInputStream() -
getInputStream
- Specified by:
getInputStreamin interfaceServerRequestContext
-
setInputStream
-
getSseEventSink
-
setSseEventSink
-
getPathSegments
Return the path segmentsThis is lazily initialized
-
initPathSegments
public void initPathSegments()initializes the path segments and removes any matrix params for the path used for matching. -
setProducesChecked
public void setProducesChecked(boolean checked) -
isProducesChecked
public boolean isProducesChecked() -
getHeader
- Specified by:
getHeaderin interfaceResteasyReactiveInjectionContext
-
getQueryParameter
-
getQueryParameter
- Specified by:
getQueryParameterin interfaceResteasyReactiveInjectionContext
-
getMatrixParameter
- Specified by:
getMatrixParameterin interfaceResteasyReactiveInjectionContext
-
getCookieParameter
- Specified by:
getCookieParameterin interfaceResteasyReactiveInjectionContext
-
getFormParameter
- Specified by:
getFormParameterin interfaceResteasyReactiveInjectionContext
-
getBeanParameter
Description copied from interface:ResteasyReactiveInjectionContextGets the bean parameter instance by type via CDI, and registers a cleanup for it. This does not call __inject on it, and it does not work for records (which cannot be gotten via CDI).- Specified by:
getBeanParameterin interfaceResteasyReactiveInjectionContext
-
getContextParameter
Description copied from interface:ResteasyReactiveInjectionContextGets the context parameter instance by type for predefined types, also calls unwrap, and CDI.- Specified by:
getContextParameterin interfaceResteasyReactiveInjectionContext
-
getPathParameter
- Specified by:
getPathParameterin interfaceResteasyReactiveInjectionContext
-
unwrap
- Specified by:
unwrapin interfaceResteasyReactiveInjectionContext
-
getSecurityContext
public jakarta.ws.rs.core.SecurityContext getSecurityContext() -
isSecurityContextSet
public boolean isSecurityContextSet() -
createSecurityContext
protected jakarta.ws.rs.core.SecurityContext createSecurityContext() -
setSecurityContext
public ResteasyReactiveRequestContext setSecurityContext(jakarta.ws.rs.core.SecurityContext securityContext) -
securityContextUpdated
protected void securityContextUpdated(jakarta.ws.rs.core.SecurityContext securityContext) -
setOutputStream
-
getOutputStream
-
getOrCreateOutputStream
- Specified by:
getOrCreateOutputStreamin interfaceServerRequestContext
-
getResteasyReactiveResourceInfo
- Specified by:
getResteasyReactiveResourceInfoin interfaceServerRequestContext
-
getEventLoop
- Specified by:
getEventLoopin classorg.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext<ResteasyReactiveRequestContext,ServerRestHandler>
-
registerTimer
-
getResourceLocatorPathParam
-
getAllPathParameters
Collects all path parameters, first from the current RuntimeResource, also known as target, and then from the previous RuntimeResources, including path parameters from sub resource locators in the process.- Parameters:
encoded-- Returns:
- MultivaluedMap with path parameters. May be empty, but is never null
-
getFormData
-
setFormData
-
resumeExternalProcessing
public abstract boolean resumeExternalProcessing()
-