Package org.hibernate.internal
Class SessionFactoryRegistry
java.lang.Object
org.hibernate.internal.SessionFactoryRegistry
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.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSessionFactory
(String uuid, String name, String jndiName, SessionFactoryImplementor instance, JndiService jndiService) Adds a SessionFactory to the registryvoid
findSessionFactory
(String uuid, String name) getNamedSessionFactory
(String name) Get a registered SessionFactory by namegetSessionFactory
(String uuid) boolean
Does this registry currently contain registrations?void
removeSessionFactory
(String uuid, String name, String jndiName, JndiService jndiService) Remove a previously added SessionFactory
-
Field Details
-
INSTANCE
Singleton access
-
-
Method Details
-
addSessionFactory
public void addSessionFactory(String uuid, String name, String jndiName, 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 SessionFactoryjndiName
- An optional name to use for binding the SessionFactory into JNDIinstance
- 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, String jndiName, JndiService jndiService) Remove a previously added SessionFactory- Parameters:
uuid
- The uuidname
- The optional namejndiName
- An optional name to use for binding the SessionFactory nto JNDIjndiService
- The JNDI service
-
getNamedSessionFactory
Get a registered SessionFactory by name- Parameters:
name
- The name- Returns:
- The SessionFactory
-
getSessionFactory
-
findSessionFactory
-
hasRegistrations
public boolean hasRegistrations()Does this registry currently contain registrations? -
clearRegistrations
public void clearRegistrations()
-