FileDocCategorySizeDatePackage
PersistenceUnitRegistry.javaAPI DocJBoss 4.2.12678Fri Jul 13 20:53:58 BST 2007org.jboss.ejb3

PersistenceUnitRegistry

public class PersistenceUnitRegistry extends Object
author
William DeCoste
version
$Revision: 60547 $

Fields Summary
private static final Logger
log
private static ConcurrentHashMap
persistenceUnits
Constructors Summary
Methods Summary
public static org.jboss.ejb3.entity.PersistenceUnitDeploymentgetPersistenceUnit(java.lang.String kernelName)

      PersistenceUnitDeployment unit = persistenceUnits.get(kernelName);
      log.trace("get " + kernelName + " = " + unit);
      if(unit == null)
         throw new IllegalStateException("Unable to find persistence unit " + kernelName);
      return unit;
   
public static java.util.CollectiongetPersistenceUnits()

      return persistenceUnits.values();
   
public static voidregister(org.jboss.ejb3.entity.PersistenceUnitDeployment container)


       
   
      String kernelName = container.getKernelName();
      if (persistenceUnits.contains(kernelName)) throw new RuntimeException("Persistence Unit is already registered: " + kernelName);
      log.trace("register " + kernelName);
      persistenceUnits.put(kernelName, container);
   
public static voidunregister(org.jboss.ejb3.entity.PersistenceUnitDeployment container)

      String kernelName = container.getKernelName();
      log.trace("unregister " + kernelName);
      persistenceUnits.remove(kernelName);