1 22 package org.jboss.ejb3.interceptor; 23 24 import org.jboss.ejb3.BeanContext; 25 import org.jboss.ejb3.Container; 26 import org.jboss.ejb3.EJBContainer; 27 import org.jboss.injection.Injector; 28 import org.jboss.injection.PojoInjector; 29 import org.jboss.ejb3.metamodel.Interceptor; 30 31 import java.lang.reflect.AccessibleObject ; 32 import java.util.Map ; 33 34 39 public class InterceptorInjector 40 { 41 EJBContainer container; 42 InterceptorInfo info; 43 PojoInjector[] injectors; 44 protected Map <AccessibleObject , Injector> encInjections; 45 46 public InterceptorInjector(Container container, InterceptorInfo info, Map <AccessibleObject , Injector> injections) 47 { 48 this.container = (EJBContainer)container; 49 this.info = info; 50 injectors = injections.values().toArray(new PojoInjector[injections.size()]); 51 } 52 53 public Interceptor getXml() 54 { 55 return info.getXml(); 56 } 57 58 public Class getClazz() 59 { 60 return info.getClazz(); 61 } 62 63 public Container getContainer() 64 { 65 return container; 66 } 67 68 public void inject(BeanContext ctx, Object instance) 69 { 70 for (PojoInjector injector : injectors) 71 { 72 injector.inject(ctx, instance); 73 } 74 } 75 } 76 | Popular Tags |