Class SessionFactoryRegistry

java.lang.Object
org.hibernate.internal.SessionFactoryRegistry

public class SessionFactoryRegistry extends Object
A registry of all SessionFactory instances for the same classloader as this class.

This registry is used for serialization/deserialization as well as JNDI binding.

Author:
Steve Ebersole
  • Field Details

  • Method Details

    • addSessionFactory

      public void addSessionFactory(String uuid, String name, boolean isNameAlsoJndiName, SessionFactoryImplementor instance, JndiService jndiService)
      Adds a SessionFactory to the registry
      Parameters:
      uuid - The uuid under which to register the SessionFactory
      name - The optional name under which to register the SessionFactory
      isNameAlsoJndiName - Is name, if provided, also a JNDI name?
      instance - The SessionFactory instance
      jndiService - The JNDI service, so we can register a listener if name is a JNDI name
    • removeSessionFactory

      public void removeSessionFactory(String uuid, String name, boolean isNameAlsoJndiName, JndiService jndiService)
      Remove a previously added SessionFactory
      Parameters:
      uuid - The uuid
      name - The optional name
      isNameAlsoJndiName - Is name, if provided, also a JNDI name?
      jndiService - The JNDI service
    • getNamedSessionFactory

      public SessionFactoryImplementor getNamedSessionFactory(String name)
      Get a registered SessionFactory by name
      Parameters:
      name - The name
      Returns:
      The SessionFactory
    • getSessionFactory

      public SessionFactoryImplementor getSessionFactory(String uuid)
    • findSessionFactory

      public SessionFactoryImplementor findSessionFactory(String uuid, String name)
    • hasRegistrations

      public boolean hasRegistrations()
      Does this registry currently contain registrations?
      Returns:
      true/false
    • clearRegistrations

      public void clearRegistrations()