public class StandardServiceRegistryBuilder extends Object
ServiceRegistry
instances.Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_CFG_RESOURCE_NAME
The default resource name for a hibernate configuration xml file.
|
Constructor and Description |
---|
StandardServiceRegistryBuilder()
Create a default builder.
|
StandardServiceRegistryBuilder(BootstrapServiceRegistry bootstrapServiceRegistry)
Create a builder with the specified bootstrap services.
|
StandardServiceRegistryBuilder(BootstrapServiceRegistry bootstrapServiceRegistry,
LoadedConfig loadedConfigBaseline)
Create a builder with the specified bootstrap services.
|
Modifier and Type | Method and Description |
---|---|
StandardServiceRegistryBuilder |
addInitiator(StandardServiceInitiator initiator)
Adds a service initiator.
|
StandardServiceRegistryBuilder |
addService(Class serviceRole,
Service service)
Adds a user-provided service.
|
StandardServiceRegistryBuilder |
applySetting(String settingName,
Object value)
Apply a setting value.
|
StandardServiceRegistryBuilder |
applySettings(Map settings)
Apply a groups of setting values.
|
StandardServiceRegistry |
build()
Build the StandardServiceRegistry.
|
StandardServiceRegistryBuilder |
configure()
Read setting information from an XML file using the standard resource location.
|
StandardServiceRegistryBuilder |
configure(File configurationFile) |
StandardServiceRegistryBuilder |
configure(LoadedConfig loadedConfig) |
StandardServiceRegistryBuilder |
configure(String resourceName)
Read setting information from an XML file using the named resource location.
|
StandardServiceRegistryBuilder |
configure(URL url) |
static void |
destroy(ServiceRegistry serviceRegistry)
Destroy a service registry.
|
StandardServiceRegistryBuilder |
disableAutoClose()
By default, when a ServiceRegistry is no longer referenced by any other
registries as a parent it will be closed.
|
StandardServiceRegistryBuilder |
enableAutoClose()
See the discussion on
disableAutoClose() . |
LoadedConfig |
getAggregatedCfgXml()
Intended for internal testing use only!!
|
BootstrapServiceRegistry |
getBootstrapServiceRegistry() |
Map |
getSettings()
Deprecated.
Temporarily exposed since Configuration is still around and much code still uses Configuration.
This allows code to configure the builder and access that to configure Configuration object.
|
StandardServiceRegistryBuilder |
loadProperties(File file)
Read settings from a
Properties file by File reference
Differs from configure() and configure(String) in that here we expect to read a
Properties file while for configure() we read the XML variant. |
StandardServiceRegistryBuilder |
loadProperties(String resourceName)
Read settings from a
Properties file by resource name. |
public static final String DEFAULT_CFG_RESOURCE_NAME
public StandardServiceRegistryBuilder()
public StandardServiceRegistryBuilder(BootstrapServiceRegistry bootstrapServiceRegistry)
bootstrapServiceRegistry
- Provided bootstrap registry to use.public StandardServiceRegistryBuilder(BootstrapServiceRegistry bootstrapServiceRegistry, LoadedConfig loadedConfigBaseline)
bootstrapServiceRegistry
- Provided bootstrap registry to use.public LoadedConfig getAggregatedCfgXml()
public BootstrapServiceRegistry getBootstrapServiceRegistry()
public StandardServiceRegistryBuilder loadProperties(String resourceName)
Properties
file by resource name.
Differs from configure()
and configure(String)
in that here we expect to read a
Properties
file while for configure()
we read the XML variant.resourceName
- The name by which to perform a resource look up for the properties file.configure()
,
configure(String)
public StandardServiceRegistryBuilder loadProperties(File file)
Properties
file by File reference
Differs from configure()
and configure(String)
in that here we expect to read a
Properties
file while for configure()
we read the XML variant.file
- The properties File referenceconfigure()
,
configure(String)
public StandardServiceRegistryBuilder configure()
DEFAULT_CFG_RESOURCE_NAME
,
configure(String)
,
loadProperties(String)
public StandardServiceRegistryBuilder configure(String resourceName)
resourceName
- The named resourcepublic StandardServiceRegistryBuilder configure(File configurationFile)
public StandardServiceRegistryBuilder configure(URL url)
public StandardServiceRegistryBuilder configure(LoadedConfig loadedConfig)
public StandardServiceRegistryBuilder applySetting(String settingName, Object value)
settingName
- The name of the settingvalue
- The value to use.public StandardServiceRegistryBuilder applySettings(Map settings)
settings
- The incoming settings to applypublic StandardServiceRegistryBuilder addInitiator(StandardServiceInitiator initiator)
initiator
- The initiator to be addedpublic StandardServiceRegistryBuilder addService(Class serviceRole, Service service)
serviceRole
- The role of the service being addedservice
- The service implementationpublic StandardServiceRegistryBuilder disableAutoClose()
public StandardServiceRegistryBuilder enableAutoClose()
disableAutoClose()
. This method enables
the auto-closing.public StandardServiceRegistry build()
@Deprecated public Map getSettings()
public static void destroy(ServiceRegistry serviceRegistry)
serviceRegistry
- The registry to be closed.Copyright © 2001-2017 Red Hat, Inc. All Rights Reserved.