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

PuEncInjector

public class PuEncInjector extends Object implements EncInjector
Comment
author
Bill Burke
version
$Revision: 60233 $

Fields Summary
private String
encName
private Class
injectionType
private String
unitName
private String
error
Constructors Summary
public PuEncInjector(String encName, Class injectionType, String unitName, String error)

      this.encName = encName;
      this.injectionType = injectionType;
      this.error = error;
      this.unitName = unitName;
   
Methods Summary
public voidinject(InjectionContainer container)

      Object factory = null;
      try
      {
         factory = PersistenceUnitHandler.getFactory(injectionType, unitName, container);
      }
      catch (NameNotFoundException e)
      {
         throw new RuntimeException(e);
      }
      if (factory == null)
      {
         throw new RuntimeException("Failed to locate " + error + " of unit name: " + unitName + " for " + container.getIdentifier());
      }

      try
      {
         Util.rebind(container.getEnc(), encName, factory);
      }
      catch (Exception e)
      {
         throw new RuntimeException("Failed to bind " + error + " of unit name: " + unitName + " ref-name" + encName + " for container " + container.getIdentifier(), e);
      }