org.springframework.web.context.request.async

Class CallableProcessingInterceptorAdapter

  • java.lang.Object
    • org.springframework.web.context.request.async.CallableProcessingInterceptorAdapter
  • All Implemented Interfaces:
    CallableProcessingInterceptor

    Deprecated. 
    as of 5.0 where CallableProcessingInterceptor has default methods

    @Deprecated
    public abstract class CallableProcessingInterceptorAdapter
    extends java.lang.Object
    implements CallableProcessingInterceptor
    Abstract adapter class for the CallableProcessingInterceptor interface, for simplified implementation of individual methods.
    Since:
    3.2
    Author:
    Rossen Stoyanchev, Rob Winch
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method and Description
      <T> void afterCompletion(NativeWebRequest request, java.util.concurrent.Callable<T> task)
      Deprecated. 
      Invoked from a container thread when async processing completes for any reason including timeout or network error.
      <T> void beforeConcurrentHandling(NativeWebRequest request, java.util.concurrent.Callable<T> task)
      Deprecated. 
      Invoked before the start of concurrent handling in the original thread in which the Callable is submitted for concurrent handling.
      <T> java.lang.Object handleError(NativeWebRequest request, java.util.concurrent.Callable<T> task, java.lang.Throwable t)
      Deprecated. 
      Invoked from a container thread when an error occurred while processing the async request before the Callable task completes.
      <T> java.lang.Object handleTimeout(NativeWebRequest request, java.util.concurrent.Callable<T> task)
      Deprecated. 
      Invoked from a container thread when the async request times out before the Callable task completes.
      <T> void postProcess(NativeWebRequest request, java.util.concurrent.Callable<T> task, java.lang.Object concurrentResult)
      Deprecated. 
      Invoked after the Callable has produced a result in the async thread in which the Callable is executed.
      <T> void preProcess(NativeWebRequest request, java.util.concurrent.Callable<T> task)
      Deprecated. 
      Invoked after the start of concurrent handling in the async thread in which the Callable is executed and before the actual invocation of the Callable.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CallableProcessingInterceptorAdapter

        public CallableProcessingInterceptorAdapter()
        Deprecated. 
    • Method Detail

      • beforeConcurrentHandling

        public <T> void beforeConcurrentHandling(NativeWebRequest request,
                                                 java.util.concurrent.Callable<T> task)
                                          throws java.lang.Exception
        Deprecated. 
        Description copied from interface: CallableProcessingInterceptor
        Invoked before the start of concurrent handling in the original thread in which the Callable is submitted for concurrent handling.

        This is useful for capturing the state of the current thread just prior to invoking the Callable. Once the state is captured, it can then be transferred to the new Thread in CallableProcessingInterceptor.preProcess(NativeWebRequest, Callable). Capturing the state of Spring Security's SecurityContextHolder and migrating it to the new Thread is a concrete example of where this is useful.

        The default implementation is empty.

        Specified by:
        beforeConcurrentHandling in interface CallableProcessingInterceptor
        Parameters:
        request - the current request
        task - the task for the current async request
        Throws:
        java.lang.Exception - in case of errors
      • preProcess

        public <T> void preProcess(NativeWebRequest request,
                                   java.util.concurrent.Callable<T> task)
                            throws java.lang.Exception
        Deprecated. 
        Description copied from interface: CallableProcessingInterceptor
        Invoked after the start of concurrent handling in the async thread in which the Callable is executed and before the actual invocation of the Callable.

        The default implementation is empty.

        Specified by:
        preProcess in interface CallableProcessingInterceptor
        Parameters:
        request - the current request
        task - the task for the current async request
        Throws:
        java.lang.Exception - in case of errors
      • postProcess

        public <T> void postProcess(NativeWebRequest request,
                                    java.util.concurrent.Callable<T> task,
                                    java.lang.Object concurrentResult)
                             throws java.lang.Exception
        Deprecated. 
        Description copied from interface: CallableProcessingInterceptor
        Invoked after the Callable has produced a result in the async thread in which the Callable is executed. This method may be invoked later than afterTimeout or afterCompletion depending on when the Callable finishes processing.

        The default implementation is empty.

        Specified by:
        postProcess in interface CallableProcessingInterceptor
        Parameters:
        request - the current request
        task - the task for the current async request
        concurrentResult - the result of concurrent processing, which could be a Throwable if the Callable raised an exception
        Throws:
        java.lang.Exception - in case of errors
      • handleError

        public <T> java.lang.Object handleError(NativeWebRequest request,
                                                java.util.concurrent.Callable<T> task,
                                                java.lang.Throwable t)
                                         throws java.lang.Exception
        Deprecated. 
        Description copied from interface: CallableProcessingInterceptor
        Invoked from a container thread when an error occurred while processing the async request before the Callable task completes. Implementations may return a value, including an Exception, to use instead of the value the Callable did not return in time.

        The default implementation always returns CallableProcessingInterceptor.RESULT_NONE.

        Specified by:
        handleError in interface CallableProcessingInterceptor
        Parameters:
        request - the current request
        task - the task for the current async request
        t - the error that occurred while request processing
        Returns:
        a concurrent result value; if the value is anything other than CallableProcessingInterceptor.RESULT_NONE or CallableProcessingInterceptor.RESPONSE_HANDLED, concurrent processing is resumed and subsequent interceptors are not invoked
        Throws:
        java.lang.Exception - in case of errors
      • afterCompletion

        public <T> void afterCompletion(NativeWebRequest request,
                                        java.util.concurrent.Callable<T> task)
                                 throws java.lang.Exception
        Deprecated. 
        Description copied from interface: CallableProcessingInterceptor
        Invoked from a container thread when async processing completes for any reason including timeout or network error.

        The default implementation is empty.

        Specified by:
        afterCompletion in interface CallableProcessingInterceptor
        Parameters:
        request - the current request
        task - the task for the current async request
        Throws:
        java.lang.Exception - in case of errors