Class ConcurrencyThrottleInterceptor

  • All Implemented Interfaces:, Advice, Interceptor, MethodInterceptor

    public class ConcurrencyThrottleInterceptor
    extends ConcurrencyThrottleSupport
    implements MethodInterceptor,
    Interceptor that throttles concurrent access, blocking invocations if a specified concurrency limit is reached.

    Can be applied to methods of local services that involve heavy use of system resources, in a scenario where it is more efficient to throttle concurrency for a specific service rather than restricting the entire thread pool (e.g. the web container's thread pool).

    The default concurrency limit of this interceptor is 1. Specify the "concurrencyLimit" bean property to change this value.

    Juergen Hoeller
    See Also:
    ConcurrencyThrottleSupport.setConcurrencyLimit(int), Serialized Form
    • Constructor Detail

      • ConcurrencyThrottleInterceptor

        public ConcurrencyThrottleInterceptor()
    • Method Detail

      • invoke

        public java.lang.Object invoke(MethodInvocation methodInvocation)
                                throws java.lang.Throwable
        Description copied from interface: MethodInterceptor
        Implement this method to perform extra treatments before and after the invocation. Polite implementations would certainly like to invoke Joinpoint.proceed().
        Specified by:
        invoke in interface MethodInterceptor
        methodInvocation - the method invocation joinpoint
        the result of the call to Joinpoint.proceed(); might be intercepted by the interceptor
        java.lang.Throwable - if the interceptors or the target object throws an exception