Class 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.

    • Method Detail

      • 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
      • hasRegistrations

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

        public void clearRegistrations()