Top Description Fields Constructors Methods
org.springframework.aop.interceptor

public Class ConcurrencyThrottleInterceptor

extends ConcurrencyThrottleSupport
implements MethodInterceptor, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, org.aopalliance.intercept.MethodInterceptor, org.aopalliance.intercept.Interceptor, org.aopalliance.aop.Advice
Annotations
@SuppressWarnings:serial
Imports
java.io.Serializable, org.aopalliance.intercept.MethodInterceptor, .MethodInvocation, org.springframework.lang.Nullable, org.springframework.util.ConcurrencyThrottleSupport

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.

Author
Juergen Hoeller
Since
11.02.2004
See Also
setConcurrencyLimit

Field Summary

Inherited from org.springframework.util.ConcurrencyThrottleSupport:
loggerNO_CONCURRENCYUNBOUNDED_CONCURRENCY

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Object
invoke(MethodInvocation
the method invocation joinpoint
methodInvocation
)

Implements org.aopalliance.intercept.MethodInterceptor.invoke.

Implement this method to perform extra treatments before and after the invocation.
Inherited from org.springframework.util.ConcurrencyThrottleSupport:
afterAccessbeforeAccessgetConcurrencyLimitisThrottleActivesetConcurrencyLimit

Constructor Detail

ConcurrencyThrottleInterceptorback to summary
public ConcurrencyThrottleInterceptor()

Method Detail

invokeback to summary
public Object invoke(MethodInvocation methodInvocation) throws Throwable

Implements org.aopalliance.intercept.MethodInterceptor.invoke.

Doc from org.aopalliance.intercept.MethodInterceptor.invoke.

Implement this method to perform extra treatments before and after the invocation. Polite implementations would certainly like to invoke Joinpoint#proceed().

Parameters
methodInvocation:MethodInvocation

the method invocation joinpoint

Returns:Object

the result of the call to Joinpoint#proceed(); might be intercepted by the interceptor

Annotations
@Override
@Nullable
Exceptions
Throwable:
if the interceptors or the target object throws an exception