FileDocCategorySizeDatePackage
CurrentMessageInjectorInterceptorFactory.javaAPI DocJBoss 4.2.13403Fri Jul 13 20:53:56 BST 2007org.jboss.ejb3.mdb

CurrentMessageInjectorInterceptorFactory

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

Fields Summary
Constructors Summary
Methods Summary
public java.lang.ObjectcreatePerClass(org.jboss.aop.Advisor advisor)

      Class clazz = advisor.getClazz();
      ArrayList<Field> fs = new ArrayList<Field>();
      ArrayList<Method> ms = new ArrayList<Method>();

      search(advisor,clazz, fs, ms);

      Method[] methods = ms.toArray(new Method[ms.size()]);
      Field[] fields = fs.toArray(new Field[fs.size()]);
      if (methods.length == 0) methods = null;
      if (fields.length == 0) fields = null;
      return new CurrentMessageInjectorInterceptor(fields, methods);
   
public java.lang.ObjectcreatePerInstance(org.jboss.aop.Advisor advisor, org.jboss.aop.InstanceAdvisor instanceAdvisor)

      throw new IllegalArgumentException("NOT LEGAL");
   
public java.lang.ObjectcreatePerJoinpoint(org.jboss.aop.Advisor advisor, org.jboss.aop.joinpoint.Joinpoint jp)

      throw new IllegalArgumentException("NOT LEGAL");
   
public java.lang.ObjectcreatePerJoinpoint(org.jboss.aop.Advisor advisor, org.jboss.aop.InstanceAdvisor instanceAdvisor, org.jboss.aop.joinpoint.Joinpoint jp)

      throw new IllegalArgumentException("NOT LEGAL");
   
public java.lang.ObjectcreatePerVM()

      return null;
   
public java.lang.StringgetName()

      return CurrentMessageInjectorInterceptor.class.getName();
   
protected voidsearch(org.jboss.aop.Advisor advisor, java.lang.Class clazz, java.util.ArrayList fs, java.util.ArrayList ms)

      Method[] methods = clazz.getDeclaredMethods();
      Field[] fields = clazz.getDeclaredFields();
      for (Field field : fields)
      {
         if (advisor.resolveAnnotation(field, CurrentMessage.class) != null)
            fs.add(field);
      }
      for (Method method : methods)
      {
         if (advisor.resolveAnnotation(method, CurrentMessage.class) != null)
            ms.add(method);
      }
      if (clazz.getSuperclass() != null && !clazz.getSuperclass().equals(Object.class))
      {
         search(advisor, clazz.getSuperclass(), fs, ms);
      }