org.hibernate.service.spi.SessionFactoryServiceInitiator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hibernate-core Show documentation
Show all versions of hibernate-core Show documentation
JPMS Module-Info's for a few of the Jakarta Libraries just until they add them in themselves
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or .
*/
package org.hibernate.service.spi;
import org.hibernate.boot.spi.SessionFactoryOptions;
import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.service.Service;
/**
* Contract for an initiator of services that target the specialized service registry
* {@link SessionFactoryServiceRegistry}
*
* @author Steve Ebersole
*/
public interface SessionFactoryServiceInitiator extends ServiceInitiator{
/**
* Initiates the managed service.
*
* Note for implementors: signature is guaranteed to change once redesign of SessionFactory building is complete
*
* @param context Access to initialization contextual info
*
* @return The initiated service.
*/
default R initiateService(SessionFactoryServiceInitiatorContext context) {
return initiateService(
context.getSessionFactory(),
context.getSessionFactoryOptions(),
context.getServiceRegistry()
);
}
/**
* Initiates the managed service.
*
* Note for implementors: signature is guaranteed to change once redesign of SessionFactory building is complete
*
* @param sessionFactory The session factory. Note the the session factory is still in flux; care needs to be taken
* in regards to what you call.
* @param sessionFactoryOptions Options specified for building the SessionFactory
* @param registry The service registry. Can be used to locate services needed to fulfill initiation.
*
* @return The initiated service.
*
* @deprecated Use {@link SessionFactoryServiceInitiator#initiateService(SessionFactoryServiceInitiatorContext)} instead.
*/
@Deprecated
R initiateService(
SessionFactoryImplementor sessionFactory,
SessionFactoryOptions sessionFactoryOptions,
ServiceRegistryImplementor registry);
}