use of org.aspectj.lang.ProceedingJoinPoint in project trafficController by amitkhosla.
the class TaskHelper method getTaskExecutorBasedOnAsyncProps.
/**
* Get task executor for Controlled.
* This method creates task executor with max consumer details.
* @param async Controlled
* @param joinPoint Join point
* @return Task executor for required inputs
*/
protected TaskExecutor getTaskExecutorBasedOnAsyncProps(Controlled async, ProceedingJoinPoint joinPoint) {
int maxConsumers = getConsumers(async.maxConsumer(), joinPoint);
int maxSlowConsumers = getConsumers(async.maxSlowConsumer(), joinPoint);
return getTaskExecutorForConsumersDetails(maxConsumers, maxSlowConsumers);
}
use of org.aspectj.lang.ProceedingJoinPoint in project gocd by gocd.
the class InterceptorInjectorTest method testShouldMergeInterceptors.
@Test
public void testShouldMergeInterceptors() throws Throwable {
HandlerInterceptor interceptorOfFramework = new HandlerInterceptorSub();
HandlerInterceptor interceptorOfTab = new HandlerInterceptorSub();
HandlerInterceptor[] interceptorsOfFramework = new HandlerInterceptor[] { interceptorOfFramework };
HandlerInterceptor[] interceptorsOfTab = new HandlerInterceptor[] { interceptorOfTab };
ProceedingJoinPoint proceedingJoinPoint = mock(ProceedingJoinPoint.class);
when(proceedingJoinPoint.proceed()).thenReturn(new HandlerExecutionChain(null, interceptorsOfTab));
InterceptorInjector injector = new InterceptorInjector();
injector.setInterceptors(interceptorsOfFramework);
HandlerExecutionChain handlers = injector.mergeInterceptorsToTabs(proceedingJoinPoint);
assertEquals(2, handlers.getInterceptors().length);
assertSame(interceptorOfFramework, handlers.getInterceptors()[0]);
assertSame(interceptorOfTab, handlers.getInterceptors()[1]);
}
use of org.aspectj.lang.ProceedingJoinPoint in project gocd by gocd.
the class InterceptorInjectorTest method testShouldJustReturnInterceptorsOfFrameworkIfNoTabInterceptors.
@Test
public void testShouldJustReturnInterceptorsOfFrameworkIfNoTabInterceptors() throws Throwable {
HandlerInterceptor interceptorOfFramework = new HandlerInterceptorSub();
HandlerInterceptor[] interceptorsOfFramework = new HandlerInterceptor[] { interceptorOfFramework };
ProceedingJoinPoint proceedingJoinPoint = mock(ProceedingJoinPoint.class);
when(proceedingJoinPoint.proceed()).thenReturn(new HandlerExecutionChain(null, null));
InterceptorInjector injector = new InterceptorInjector();
injector.setInterceptors(interceptorsOfFramework);
HandlerExecutionChain handlers = injector.mergeInterceptorsToTabs(proceedingJoinPoint);
assertEquals(1, handlers.getInterceptors().length);
assertSame(interceptorOfFramework, handlers.getInterceptors()[0]);
}
use of org.aspectj.lang.ProceedingJoinPoint in project gocd by gocd.
the class InterceptorInjectorTest method testShouldNotChangeHandler.
@Test
public void testShouldNotChangeHandler() throws Throwable {
SimpleUrlHandlerMapping handler = new SimpleUrlHandlerMapping();
ProceedingJoinPoint proceedingJoinPoint = mock(ProceedingJoinPoint.class);
when(proceedingJoinPoint.proceed()).thenReturn(new HandlerExecutionChain(handler, null));
InterceptorInjector injector = new InterceptorInjector();
HandlerExecutionChain handlers = injector.mergeInterceptorsToTabs(proceedingJoinPoint);
assertSame(handler, handlers.getHandler());
}
use of org.aspectj.lang.ProceedingJoinPoint in project spring-framework by spring-projects.
the class ProxyTargetClassTrueConfig method doubleReturnValue.
@Around("execution(int *.getAge())")
public Object doubleReturnValue(ProceedingJoinPoint pjp) throws Throwable {
++this.invocations;
int result = (Integer) pjp.proceed();
return result * this.multiple;
}
Aggregations