org.hibernate.ejb.internal
Class EntityManagerFactoryRegistry

java.lang.Object
  extended by org.hibernate.ejb.internal.EntityManagerFactoryRegistry

public class EntityManagerFactoryRegistry
extends Object

An internal registry of all EntityManagerFactoryImpl instances for the same classloader as this class. This registry is used for serialization/deserialization of entity managers.


Field Summary
static EntityManagerFactoryRegistry INSTANCE
           
 
Constructor Summary
EntityManagerFactoryRegistry()
           
 
Method Summary
 void addEntityManagerFactory(String name, EntityManagerFactory entityManagerFactory)
          register the specified entity manager factory
 EntityManagerFactory getNamedEntityManagerFactory(String name)
          Lookup the specified entity manager factory by name
 void removeEntityManagerFactory(String name, EntityManagerFactory entityManagerFactory)
          remove the specified entity manager factory from the EntityManagerFactoryRegistry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final EntityManagerFactoryRegistry INSTANCE
Constructor Detail

EntityManagerFactoryRegistry

public EntityManagerFactoryRegistry()
Method Detail

addEntityManagerFactory

public void addEntityManagerFactory(String name,
                                    EntityManagerFactory entityManagerFactory)
register the specified entity manager factory

Parameters:
name - to register the passed entity manager factory
entityManagerFactory -

removeEntityManagerFactory

public void removeEntityManagerFactory(String name,
                                       EntityManagerFactory entityManagerFactory)
                                throws HibernateException
remove the specified entity manager factory from the EntityManagerFactoryRegistry

Parameters:
name -
entityManagerFactory -
Throws:
HibernateException - if the specified entity manager factory could not be found in the registry

getNamedEntityManagerFactory

public EntityManagerFactory getNamedEntityManagerFactory(String name)
                                                  throws HibernateException
Lookup the specified entity manager factory by name

Parameters:
name -
Returns:
Throws:
HibernateException - if entity manager factory is not found or if more than one entity manager factory was registered with name.


Copyright © 2001-2015 Red Hat, Inc. All Rights Reserved.