throw new IllegalArgumentException(AOPBasedInterceptorRegistry.class + " can only handle "
+ org.jboss.ejb3.BeanContext.class + " , was passed " + targetBeanContext.getClass());
}
AOPBasedContainerInvocation aopInvocationContext = (AOPBasedContainerInvocation) containerInvocation;
// form a AOP invocation
MethodInfo methodInfo = aopInvocationContext.getMethodInfo();
EJBContainerInvocation<AOPBasedSingletonContainer, LegacySingletonBeanContext> invocation = new SessionContainerInvocation<AOPBasedSingletonContainer, LegacySingletonBeanContext>(
containerInvocation.getInvokedBusinessInterface(), aopInvocationContext.getMethodInfo());
invocation.setAdvisor(methodInfo.getAdvisor());
invocation.setArguments(containerInvocation.getArgs());
// set the target bean context of the AOP invocation
invocation.setBeanContext((org.jboss.ejb3.interceptors.container.BeanContext<?>) targetBeanContext);