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 Details

    • log

      protected static final org.jboss.logging.Logger log
    • logWebApplicationExceptions

      protected static final org.jboss.logging.Logger logWebApplicationExceptions
    • 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:
  • Constructor Details

    • AbstractResteasyReactiveContext

      public AbstractResteasyReactiveContext(H[] handlerChain, H[] abortHandlerChain, ThreadSetupAction requestContext)
  • Method Details

    • 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()
    • setAbortHandlerChain

      public T setAbortHandlerChain(H[] abortHandlerChain)
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • getThrowable

      public Throwable getThrowable()
    • getEventLoop

      protected abstract Executor getEventLoop()
    • getContextExecutor

      public Executor getContextExecutor()
    • isRequestScopeManagementRequired

      protected boolean isRequestScopeManagementRequired()
    • run

      public void run()
      Specified by:
      run in interface Runnable
    • invokeHandler

      protected void invokeHandler(int pos) throws Exception
      Throws:
      Exception
    • 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 resource

      Generally 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)
    • unwrapException

      protected Throwable unwrapException(Throwable t)
    • handleUnrecoverableError

      protected abstract void handleUnrecoverableError(Throwable throwable)
    • getProperty

      public Object getProperty(String name)
    • getPropertyNames

      public Collection<String> getPropertyNames()
    • setProperty

      public void setProperty(String name, Object object)
    • removeProperty

      public void removeProperty(String name)
    • registerCompletionCallback

      public void registerCompletionCallback(jakarta.ws.rs.container.CompletionCallback callback)
      Specified by:
      registerCompletionCallback in interface ResteasyReactiveCallbackContext
    • registerConnectionCallback

      public void registerConnectionCallback(jakarta.ws.rs.container.ConnectionCallback callback)
      Specified by:
      registerConnectionCallback in interface ResteasyReactiveCallbackContext
    • setAbortHandlerChainStarted

      public void setAbortHandlerChainStarted(boolean value)