FileDocCategorySizeDatePackage
EJB3InterceptorsInterceptor.javaAPI DocJBoss 4.2.12649Fri Jul 13 20:53:52 BST 2007org.jboss.ejb3.interceptor

EJB3InterceptorsInterceptor

public class EJB3InterceptorsInterceptor extends Object implements org.jboss.aop.advice.Interceptor
Comment
author
Bill Burke
version
$Revision: 60233 $

Fields Summary
protected static Logger
log
private InterceptorInfo[]
interceptorInfos
private Method[]
beanAroundInvokes
Constructors Summary
public EJB3InterceptorsInterceptor(InterceptorInfo[] interceptorInfos, Method[] beanAroundInvokes)


       
   
      this.interceptorInfos = interceptorInfos;
      this.beanAroundInvokes = beanAroundInvokes;
   
Methods Summary
public java.lang.StringgetName()

      return getClass().getName();
   
public java.lang.Objectinvoke(org.jboss.aop.joinpoint.Invocation invocation)

      EJBContainerInvocation inv = (EJBContainerInvocation) invocation;
                                
      //We need to do this every time to make sure we have interceptor instances corresponding 
      //to the bean instance
      //TODO Cache this for non-stateful beans?
      Object[] interceptors = inv.getBeanContext().getInterceptorInstances(interceptorInfos);
      if (interceptors != null && interceptors.length == 0 && beanAroundInvokes != null && beanAroundInvokes.length == 0) return invocation.invokeNext();
      InvocationContextImpl ctx = new InvocationContextImpl(inv, interceptorInfos, interceptors, beanAroundInvokes);
      return ctx.proceed();