Top Description Fields Constructors Methods
org.hibernate.engine.config.internal

public Class ConfigurationServiceImpl

extends Object
implements ConfigurationService, ServiceRegistryAwareService
Class Inheritance
All Implemented Interfaces
org.hibernate.service.spi.ServiceRegistryAwareService, org.hibernate.engine.config.spi.ConfigurationService, org.hibernate.service.Service, java.io.Serializable
Imports
java.util.Collections, .Map, org.hibernate.boot.registry.classloading.spi.ClassLoaderService, .ClassLoadingException, org.hibernate.engine.config.spi.ConfigurationService, org.hibernate.internal.CoreMessageLogger, org.hibernate.service.spi.ServiceRegistryAwareService, .ServiceRegistryImplementor, org.jboss.logging.Logger

The standard ConfigurationService implementation
Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private static final CoreMessageLogger
private ServiceRegistryImplementor
private final Map<K, V>

Constructor Summary

AccessConstructor and Description
public
ConfigurationServiceImpl(Map<K, V>
The map of settings
settings
)

Constructs a ConfigurationServiceImpl

Method Summary

Modifier and TypeMethod and Description
public <T> T
cast(Class<T>
The type of instance expected to return.
expected
,
Object
The candidate object to be casted.
candidate
)

Implements org.hibernate.engine.config.spi.ConfigurationService.cast.

Cast candidate to the instance of expected type.
public <T> T
getSetting(String
The name of the setting to get.
name
,
ConfigurationService.Converter<T>
The converter to apply
converter
)

Implements org.hibernate.engine.config.spi.ConfigurationService.getSetting.

Get the named setting, using the specified converter.
public <T> T
getSetting(String
The name of the setting to get.
name
,
ConfigurationService.Converter<T>
The converter to apply
converter
,
T
If no setting with that name is found, return this default value as the result.
defaultValue
)

Implements org.hibernate.engine.config.spi.ConfigurationService.getSetting.

Get the named setting, using the specified converter and default value.
public <T> T
getSetting(String
The name of the setting to get.
name
,
Class<T>
The expected Java type.
expected
,
T
If no setting with that name is found, return this default value as the result.
defaultValue
)

Implements org.hibernate.engine.config.spi.ConfigurationService.getSetting.

Get the named setting.
public Map<K, V>
getSettings()

Implements org.hibernate.engine.config.spi.ConfigurationService.getSettings.

Access to the complete map of config settings.
public void
injectServices(ServiceRegistryImplementor
The registry
serviceRegistry
)

Implements org.hibernate.service.spi.ServiceRegistryAwareService.injectServices.

Callback to inject the registry.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

LOGback to summary
private static final CoreMessageLogger LOG
serviceRegistryback to summary
private ServiceRegistryImplementor serviceRegistry
settingsback to summary
private final Map<K, V> settings

Constructor Detail

ConfigurationServiceImplback to summary
public ConfigurationServiceImpl(Map<K, V> settings)

Constructs a ConfigurationServiceImpl

Parameters
settings:Map<K, V>

The map of settings

Annotations
@SuppressWarnings:unchecked

Method Detail

castback to summary
public <T> T cast(Class<T> expected, Object candidate)

Implements org.hibernate.engine.config.spi.ConfigurationService.cast.

Doc from org.hibernate.engine.config.spi.ConfigurationService.cast.

Cast candidate to the instance of expected type.

Parameters
<T>
The java type of the expected return
expected:Class<T>

The type of instance expected to return.

candidate:Object

The candidate object to be casted.

Returns:T

The instance of expected type or null if this cast fail.

Annotations
@Override
@SuppressWarnings:unchecked
getSettingback to summary
public <T> T getSetting(String name, ConfigurationService.Converter<T> converter)

Implements org.hibernate.engine.config.spi.ConfigurationService.getSetting.

Doc from org.hibernate.engine.config.spi.ConfigurationService.getSetting.

Get the named setting, using the specified converter.

Parameters
<T>
The Java type of the conversion
name:String

The name of the setting to get.

converter:ConfigurationService.Converter<T>

The converter to apply

Returns:T

The converted (typed) setting. May return null (see getSetting(String, Class, Object))

Annotations
@Override
getSettingback to summary
public <T> T getSetting(String name, ConfigurationService.Converter<T> converter, T defaultValue)

Implements org.hibernate.engine.config.spi.ConfigurationService.getSetting.

Doc from org.hibernate.engine.config.spi.ConfigurationService.getSetting.

Get the named setting, using the specified converter and default value.

Parameters
<T>
The Java type of the conversion
name:String

The name of the setting to get.

converter:ConfigurationService.Converter<T>

The converter to apply

defaultValue:T

If no setting with that name is found, return this default value as the result.

Returns:T

The converted (typed) setting. Will be the defaultValue if no such setting was defined.

Annotations
@Override
getSettingback to summary
public <T> T getSetting(String name, Class<T> expected, T defaultValue)

Implements org.hibernate.engine.config.spi.ConfigurationService.getSetting.

Doc from org.hibernate.engine.config.spi.ConfigurationService.getSetting.

Get the named setting. Differs from the form taking a Converter in that here we expect to have a simple cast rather than any involved conversion.

Parameters
<T>
The Java type of the conversion
name:String

The name of the setting to get.

expected:Class<T>

The expected Java type.

defaultValue:T

If no setting with that name is found, return this default value as the result.

Returns:T

The converted (typed) setting. Will be the defaultValue if no such setting was defined.

Annotations
@Override
getSettingsback to summary
public Map<K, V> getSettings()

Implements org.hibernate.engine.config.spi.ConfigurationService.getSettings.

Doc from org.hibernate.engine.config.spi.ConfigurationService.getSettings.

Access to the complete map of config settings. The returned map is immutable

Returns:Map<K, V>

The immutable map of config settings.

Annotations
@Override
injectServicesback to summary
public void injectServices(ServiceRegistryImplementor serviceRegistry)

Implements org.hibernate.service.spi.ServiceRegistryAwareService.injectServices.

Doc from org.hibernate.service.spi.ServiceRegistryAwareService.injectServices.

Callback to inject the registry.

Parameters
serviceRegistry:ServiceRegistryImplementor

The registry

Annotations
@Override