org.springframework.aop.interceptor
Class ConcurrencyThrottleInterceptor

java.lang.Object
  extended byorg.springframework.aop.interceptor.ConcurrencyThrottleInterceptor
All Implemented Interfaces:
org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor

public class ConcurrencyThrottleInterceptor
extends java.lang.Object
implements org.aopalliance.intercept.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).

Since:
11.02.2004
Author:
Juergen Hoeller

Field Summary
protected  org.apache.commons.logging.Log logger
           
 
Constructor Summary
ConcurrencyThrottleInterceptor()
           
 
Method Summary
 java.lang.Object invoke(org.aopalliance.intercept.MethodInvocation methodInvocation)
           
 void setConcurrencyLimit(int concurrencyLimit)
          Set the maximum number of parallel invocations that this interceptor allows.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger
Constructor Detail

ConcurrencyThrottleInterceptor

public ConcurrencyThrottleInterceptor()
Method Detail

setConcurrencyLimit

public void setConcurrencyLimit(int concurrencyLimit)
Set the maximum number of parallel invocations that this interceptor allows. Default is 1 (having the same effect as a synchronized block).


invoke

public java.lang.Object invoke(org.aopalliance.intercept.MethodInvocation methodInvocation)
                        throws java.lang.Throwable
Specified by:
invoke in interface org.aopalliance.intercept.MethodInterceptor
Throws:
java.lang.Throwable


Copyright (C) 2003-2004 The Spring Framework Project.