org.hibernate.engine.config.internal.ConfigurationServiceImpl 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
Hibernate's core ORM functionality
/*
* 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.engine.config.internal;
import java.util.Collections;
import java.util.Map;
import java.util.function.Function;
import java.util.function.Supplier;
import org.hibernate.boot.registry.classloading.spi.ClassLoaderService;
import org.hibernate.boot.registry.classloading.spi.ClassLoadingException;
import org.hibernate.engine.config.spi.ConfigurationService;
import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.service.spi.ServiceRegistryAwareService;
import org.hibernate.service.spi.ServiceRegistryImplementor;
import org.jboss.logging.Logger;
/**
* The standard ConfigurationService implementation
*
* @author Steve Ebersole
*/
public class ConfigurationServiceImpl implements ConfigurationService, ServiceRegistryAwareService {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(
CoreMessageLogger.class,
ConfigurationServiceImpl.class.getName()
);
private final Map settings;
private ServiceRegistryImplementor serviceRegistry;
/**
* Constructs a ConfigurationServiceImpl
*
* @param settings The map of settings
*/
@SuppressWarnings( "unchecked" )
public ConfigurationServiceImpl(Map settings) {
this.settings = Collections.unmodifiableMap( settings );
}
@Override
public Map getSettings() {
return settings;
}
@Override
public void injectServices(ServiceRegistryImplementor serviceRegistry) {
this.serviceRegistry = serviceRegistry;
}
@Override
public T getSetting(String name, Function