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[]
abortHandlerChain
protected static String
CUSTOM_RR_PROPERTIES_PREFIX
protected H[]
handlers
protected static org.jboss.logging.Logger
log
protected int
position
protected Throwable
throwable
-
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 void
beginAsyncProcessing()
ThreadSetupAction.ThreadState
captureCDIRequestScope()
Captures the CDI request scope for use outside of handler chains.void
close()
H[]
getAbortHandlerChain()
Executor
getContextExecutor()
protected abstract Executor
getEventLoop()
H[]
getHandlers()
int
getPosition()
Object
getProperty(String name)
Collection<String>
getPropertyNames()
Throwable
getThrowable()
void
handleException(Throwable t)
If we are on the abort chain already, send a 500.void
handleException(Throwable t, boolean keepSameTarget)
protected abstract void
handleRequestScopeActivation()
protected abstract void
handleUnrecoverableError(Throwable throwable)
protected void
invokeHandler(int pos)
protected boolean
isRequestScopeManagementRequired()
boolean
isSuspended()
void
registerCompletionCallback(javax.ws.rs.container.CompletionCallback callback)
void
registerConnectionCallback(javax.ws.rs.container.ConnectionCallback callback)
void
removeProperty(String name)
protected void
requestScopeDeactivated()
void
requireCDIRequestScope()
Ensures the CDI request scope is running when inside a handler chainvoid
restart(H[] newHandlerChain)
Restarts handler chain processing on a chain that does not target a specific resourcevoid
restart(H[] newHandlerChain, boolean keepTarget)
protected abstract void
restarted(boolean keepTarget)
void
resume()
void
resume(Throwable throwable)
void
resume(Throwable throwable, boolean keepTarget)
void
resume(Executor executor)
void
run()
T
setAbortHandlerChain(H[] abortHandlerChain)
void
setAbortHandlerChainStarted(boolean value)
T
setPosition(int position)
void
setProperty(String name, Object object)
T
setSuspended(boolean suspended)
void
suspend()
protected Throwable
unwrapException(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:
close
in interfaceAutoCloseable
- Specified by:
close
in 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(javax.ws.rs.container.CompletionCallback callback)
- Specified by:
registerCompletionCallback
in interfaceResteasyReactiveCallbackContext
-
registerConnectionCallback
public void registerConnectionCallback(javax.ws.rs.container.ConnectionCallback callback)
- Specified by:
registerConnectionCallback
in interfaceResteasyReactiveCallbackContext
-
setAbortHandlerChainStarted
public void setAbortHandlerChainStarted(boolean value)
-
-