org.hibernate.bytecode.internal.ProxyFactoryFactoryInitiator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hibernate-core-jakarta Show documentation
Show all versions of hibernate-core-jakarta Show documentation
Hibernate O/RM implementation of the Jakarta Persistence specification
/*
* 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.bytecode.internal;
import java.util.Map;
import org.hibernate.boot.registry.StandardServiceInitiator;
import org.hibernate.bytecode.spi.BytecodeProvider;
import org.hibernate.bytecode.spi.ProxyFactoryFactory;
import org.hibernate.service.spi.ServiceRegistryImplementor;
/**
* Most commonly the {@link ProxyFactoryFactory} will depend directly on the chosen {@link BytecodeProvider},
* however by registering them as two separate services we can allow to override either one
* or both of them.
* @author Sanne Grinovero
*/
public final class ProxyFactoryFactoryInitiator implements StandardServiceInitiator {
/**
* Singleton access
*/
public static final StandardServiceInitiator INSTANCE = new ProxyFactoryFactoryInitiator();
@Override
public ProxyFactoryFactory initiateService(Map configurationValues, ServiceRegistryImplementor registry) {
final BytecodeProvider bytecodeProvider = registry.getService( BytecodeProvider.class );
return bytecodeProvider.getProxyFactoryFactory();
}
@Override
public Class getServiceInitiated() {
return ProxyFactoryFactory.class;
}
}