Package org.hibernate.internal
Class SessionFactoryRegistry
- java.lang.Object
-
- org.hibernate.internal.SessionFactoryRegistry
-
public class SessionFactoryRegistry extends Object
A registry of allSessionFactory
instances for the same classloader as this class.This registry is used for serialization/deserialization as well as JNDI binding.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SessionFactoryRegistry.ObjectFactoryImpl
-
Field Summary
Fields Modifier and Type Field Description static SessionFactoryRegistry
INSTANCE
Singleton access
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSessionFactory(String uuid, String name, boolean isNameAlsoJndiName, SessionFactoryImplementor instance, JndiService jndiService)
Adds a SessionFactory to the registryvoid
clearRegistrations()
SessionFactoryImplementor
findSessionFactory(String uuid, String name)
SessionFactoryImplementor
getNamedSessionFactory(String name)
Get a registered SessionFactory by nameSessionFactoryImplementor
getSessionFactory(String uuid)
boolean
hasRegistrations()
Does this registry currently contain registrations?void
removeSessionFactory(String uuid, String name, boolean isNameAlsoJndiName, JndiService jndiService)
Remove a previously added SessionFactory
-
-
-
Field Detail
-
INSTANCE
public static final SessionFactoryRegistry INSTANCE
Singleton access
-
-
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 SessionFactoryname
- The optional name under which to register the SessionFactoryisNameAlsoJndiName
- Is name, if provided, also a JNDI name?instance
- The SessionFactory instancejndiService
- 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 uuidname
- The optional nameisNameAlsoJndiName
- 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()
-
-