Class AbstractResteasyReactiveContext<T extends AbstractResteasyReactiveContext<T,H>,H extends RestHandler<T>>
- java.lang.Object
-
- org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext<T,H>
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Runnable,ResteasyReactiveCallbackContext
public abstract class AbstractResteasyReactiveContext<T extends AbstractResteasyReactiveContext<T,H>,H extends RestHandler<T>> extends Object implements Runnable, Closeable, ResteasyReactiveCallbackContext
-
-
Field Summary
Fields Modifier and Type Field Description protected H[]abortHandlerChainprotected static StringCUSTOM_RR_PROPERTIES_PREFIXprotected H[]handlersprotected static org.jboss.logging.Loggerlogprotected intpositionprotected Throwablethrowable
-
Constructor Summary
Constructors Constructor Description AbstractResteasyReactiveContext(H[] handlerChain, H[] abortHandlerChain, ThreadSetupAction requestContext)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidbeginAsyncProcessing()ThreadSetupAction.ThreadStatecaptureCDIRequestScope()Captures the CDI request scope for use outside of handler chains.voidclose()H[]getAbortHandlerChain()ExecutorgetContextExecutor()protected abstract ExecutorgetEventLoop()H[]getHandlers()intgetPosition()ObjectgetProperty(String name)Collection<String>getPropertyNames()ThrowablegetThrowable()voidhandleException(Throwable t)If we are on the abort chain already, send a 500.voidhandleException(Throwable t, boolean keepSameTarget)protected abstract voidhandleRequestScopeActivation()protected abstract voidhandleUnrecoverableError(Throwable throwable)protected voidinvokeHandler(int pos)protected booleanisRequestScopeManagementRequired()booleanisSuspended()voidregisterCompletionCallback(jakarta.ws.rs.container.CompletionCallback callback)voidregisterConnectionCallback(jakarta.ws.rs.container.ConnectionCallback callback)voidremoveProperty(String name)protected voidrequestScopeDeactivated()voidrequireCDIRequestScope()Ensures the CDI request scope is running when inside a handler chainvoidrestart(H[] newHandlerChain)Restarts handler chain processing on a chain that does not target a specific resourcevoidrestart(H[] newHandlerChain, boolean keepTarget)protected abstract voidrestarted(boolean keepTarget)voidresume()voidresume(Throwable throwable)voidresume(Throwable throwable, boolean keepTarget)voidresume(Executor executor)voidrun()TsetAbortHandlerChain(H[] abortHandlerChain)voidsetAbortHandlerChainStarted(boolean value)TsetPosition(int position)voidsetProperty(String name, Object object)TsetSuspended(boolean suspended)voidsuspend()protected ThrowableunwrapException(Throwable t)
-
-
-
Field Detail
-
log
protected static final org.jboss.logging.Logger log
-
handlers
protected H extends RestHandler<T>[] handlers
-
abortHandlerChain
protected H extends RestHandler<T>[] abortHandlerChain
-
position
protected int position
-
throwable
protected Throwable throwable
-
CUSTOM_RR_PROPERTIES_PREFIX
protected static final String CUSTOM_RR_PROPERTIES_PREFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractResteasyReactiveContext
public AbstractResteasyReactiveContext(H[] handlerChain, H[] abortHandlerChain, ThreadSetupAction requestContext)
-
-
Method Detail
-
suspend
public void suspend()
-
resume
public void resume()
-
resume
public void resume(Throwable throwable)
-
resume
public void resume(Throwable throwable, boolean keepTarget)
-
resume
public void resume(Executor executor)
-
getAbortHandlerChain
public H[] getAbortHandlerChain()
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
getThrowable
public Throwable getThrowable()
-
getEventLoop
protected abstract Executor getEventLoop()
-
getContextExecutor
public Executor getContextExecutor()
-
isRequestScopeManagementRequired
protected boolean isRequestScopeManagementRequired()
-
beginAsyncProcessing
protected void beginAsyncProcessing()
-
requestScopeDeactivated
protected void requestScopeDeactivated()
-
requireCDIRequestScope
public void requireCDIRequestScope()
Ensures the CDI request scope is running when inside a handler chain
-
captureCDIRequestScope
public ThreadSetupAction.ThreadState captureCDIRequestScope()
Captures the CDI request scope for use outside of handler chains.
-
handleRequestScopeActivation
protected abstract void handleRequestScopeActivation()
-
restart
public void restart(H[] newHandlerChain)
Restarts handler chain processing on a chain that does not target a specific resourceGenerally used to abort processing.
- Parameters:
newHandlerChain- The new handler chain
-
restart
public void restart(H[] newHandlerChain, boolean keepTarget)
-
restarted
protected abstract void restarted(boolean keepTarget)
-
isSuspended
public boolean isSuspended()
-
setSuspended
public T setSuspended(boolean suspended)
-
getPosition
public int getPosition()
-
setPosition
public T setPosition(int position)
-
getHandlers
public H[] getHandlers()
-
handleException
public void handleException(Throwable t)
If we are on the abort chain already, send a 500. If not, turn the throwable into a response result and switch to the abort chain
-
handleException
public void handleException(Throwable t, boolean keepSameTarget)
-
handleUnrecoverableError
protected abstract void handleUnrecoverableError(Throwable throwable)
-
getPropertyNames
public Collection<String> getPropertyNames()
-
removeProperty
public void removeProperty(String name)
-
registerCompletionCallback
public void registerCompletionCallback(jakarta.ws.rs.container.CompletionCallback callback)
- Specified by:
registerCompletionCallbackin interfaceResteasyReactiveCallbackContext
-
registerConnectionCallback
public void registerConnectionCallback(jakarta.ws.rs.container.ConnectionCallback callback)
- Specified by:
registerConnectionCallbackin interfaceResteasyReactiveCallbackContext
-
setAbortHandlerChainStarted
public void setAbortHandlerChainStarted(boolean value)
-
-