public class ConcurrencyThrottleInterceptor extends ConcurrencyThrottleSupport implements MethodInterceptor, java.io.Serializable
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.
ConcurrencyThrottleSupport.setConcurrencyLimit(int)
,
Serialized Formlogger, NO_CONCURRENCY, UNBOUNDED_CONCURRENCY
Constructor and Description |
---|
ConcurrencyThrottleInterceptor() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
invoke(MethodInvocation methodInvocation)
Implement this method to perform extra treatments before and
after the invocation.
|
afterAccess, beforeAccess, getConcurrencyLimit, isThrottleActive, setConcurrencyLimit
public java.lang.Object invoke(MethodInvocation methodInvocation) throws java.lang.Throwable
MethodInterceptor
Joinpoint.proceed()
.invoke
in interface MethodInterceptor
methodInvocation
- the method invocation joinpointJoinpoint.proceed()
;
might be intercepted by the interceptorjava.lang.Throwable
- if the interceptors or the target object
throws an exception