FileDocCategorySizeDatePackage
EntityManagerFactoryFieldInjector.javaAPI DocJBoss 4.2.12387Fri Jul 13 20:53:46 BST 2007org.jboss.injection

EntityManagerFactoryFieldInjector

public class EntityManagerFactoryFieldInjector extends Object implements Injector, PojoInjector
Comment
author
Bill Burke
version
$Revision: 60233 $

Fields Summary
private static final Logger
log
private Field
field
private Object
factory
Constructors Summary
public EntityManagerFactoryFieldInjector(Field field, Object factory)


       
   
      this.field = field;
      this.field.setAccessible(true);
      this.factory = factory;
   
Methods Summary
public java.lang.ClassgetInjectionClass()

      return field.getType();
   
public voidinject(org.jboss.ejb3.BeanContext ctx)

      inject(ctx, ctx.getInstance());
   
public voidinject(org.jboss.ejb3.BeanContext ctx, java.lang.Object instance)

      inject(instance);
   
public voidinject(java.lang.Object instance)

      try
      {
         field.set(instance, factory);
      }
      catch (IllegalAccessException e)
      {
         throw new RuntimeException(e);  //To change body of catch statement use Options | File Templates.
      }
      catch (IllegalArgumentException e)
      {
         throw new RuntimeException("Failed in setting EntityManager on setter field: " + field.toString());
      }