List of usage examples for org.springframework.aop.interceptor ConcurrencyThrottleInterceptor getConcurrencyLimit
public int getConcurrencyLimit()
From source file:org.springframework.aop.interceptor.ConcurrencyThrottleInterceptorTests.java
@Test public void testSerializable() throws Exception { DerivedTestBean tb = new DerivedTestBean(); ProxyFactory proxyFactory = new ProxyFactory(); proxyFactory.setInterfaces(new Class[] { ITestBean.class }); ConcurrencyThrottleInterceptor cti = new ConcurrencyThrottleInterceptor(); proxyFactory.addAdvice(cti);//from w w w .j a v a2 s. c om proxyFactory.setTarget(tb); ITestBean proxy = (ITestBean) proxyFactory.getProxy(); proxy.getAge(); ITestBean serializedProxy = (ITestBean) SerializationTestUtils.serializeAndDeserialize(proxy); Advised advised = (Advised) serializedProxy; ConcurrencyThrottleInterceptor serializedCti = (ConcurrencyThrottleInterceptor) advised.getAdvisors()[0] .getAdvice(); assertEquals(cti.getConcurrencyLimit(), serializedCti.getConcurrencyLimit()); serializedProxy.getAge(); }