public class ServiceRegistryBuilder extends Object
ServiceRegistry
instances.StandardServiceRegistryImpl
,
BootstrapServiceRegistryBuilder
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_CFG_RESOURCE_NAME |
Constructor and Description |
---|
ServiceRegistryBuilder()
Create a default builder
|
ServiceRegistryBuilder(BootstrapServiceRegistry bootstrapServiceRegistry)
Create a builder with the specified bootstrap services.
|
Modifier and Type | Method and Description |
---|---|
ServiceRegistryBuilder |
addInitiator(BasicServiceInitiator initiator)
Adds a service initiator.
|
ServiceRegistryBuilder |
addService(Class serviceRole,
Service service)
Adds a user-provided service
|
ServiceRegistryBuilder |
applySetting(String settingName,
Object value)
Apply a setting value
|
ServiceRegistryBuilder |
applySettings(Map settings)
Apply a groups of setting values
|
ServiceRegistry |
buildServiceRegistry()
Build the service registry accounting for all settings and service initiators and services.
|
ServiceRegistryBuilder |
configure()
Read setting information from an XML file using the standard resource location
|
ServiceRegistryBuilder |
configure(String resourceName)
Read setting information from an XML file using the named resource location
|
static void |
destroy(ServiceRegistry serviceRegistry)
Destroy a service registry.
|
ServiceRegistryBuilder |
disableAutoClose()
By default, when a ServiceRegistry is no longer referenced by any other
registries as a parent it will be closed.
|
ServiceRegistryBuilder |
enableAutoClose()
See the discussion on
disableAutoClose() . |
ServiceRegistryBuilder |
loadProperties(String resourceName)
Read settings from a
Properties file. |
public static final String DEFAULT_CFG_RESOURCE_NAME
public ServiceRegistryBuilder()
public ServiceRegistryBuilder(BootstrapServiceRegistry bootstrapServiceRegistry)
bootstrapServiceRegistry
- Provided bootstrap registry to use.public ServiceRegistryBuilder loadProperties(String resourceName)
Properties
file. Differs from configure()
and configure(String)
in that here we 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 ServiceRegistryBuilder configure()
DEFAULT_CFG_RESOURCE_NAME
,
configure(String)
,
loadProperties(String)
public ServiceRegistryBuilder configure(String resourceName)
resourceName
- The named resourceloadProperties(String)
public ServiceRegistryBuilder applySetting(String settingName, Object value)
settingName
- The name of the settingvalue
- The value to use.public ServiceRegistryBuilder applySettings(Map settings)
settings
- The incoming settings to applypublic ServiceRegistryBuilder addInitiator(BasicServiceInitiator initiator)
initiator
- The initiator to be addedpublic ServiceRegistryBuilder addService(Class serviceRole, Service service)
serviceRole
- The role of the service being addedservice
- The service implementationpublic ServiceRegistryBuilder disableAutoClose()
public ServiceRegistryBuilder enableAutoClose()
disableAutoClose()
. This method enables
the auto-closing.public ServiceRegistry buildServiceRegistry()
public static void destroy(ServiceRegistry serviceRegistry)
serviceRegistry
- The registry to be closed.Copyright © 2018 JBoss by Red Hat. All rights reserved.