public interface GlobalVariablesResolver
Title: Open Service Framework
Description: This interface defines a mechanism for resolving Global Variable
definitions that may be used by the
service framework. It is presented as an interface because it is possible to have container-specific implementations
of the resolver.
Global variables are static variables defined in a service container infrastructure that can be accessed by the Service at run-time. At run-time the value of the variable is substituted for it's place holder in a Service Property's definition providing a late-binding mechanism for Service configuration. Global variables are instrumental in simplifying deployment and facilitate location transparency for components that run in a distributed environment.
Consider a set of components that have been written to interact with a database and require a URL for connection to a specific instance. Given the
typical life cycle of a Service component a developer will test a local implementation, move the components to a different environment for user
acceptance testing before finally deploying the components into production. When using a static configuration developers must often change a
single configuration parameter across multiple artifacts as they move the component between environments. This tends to be a time consuming and
error prone process. If such a parameter is converted into a Global Variable
it would be defined once per environment and no further
manual reconfiguration would be required allowing developers to easily move a component between environments.
Global variables are identified by a proceeding string symbol and enclosed in brackets: ${..variable name..}
. Additionally a
variable must belong to a pool of literals allowing users to group variables. For example a pool named DBMS_Connections
may be
defined and may have a variable called LoggerDatabase
. This variable is defined as ${DBMS_Connections.LoggerDatabase}
.
The general format for specifying a global variable can therefore be described as ${[POOL NAME].[VARIABLE NAME]}
.
When a Service is loaded its global variables are evaluated and resolved by the validation framework, expanding to actual values. If a configuration property contains a global variable in it's definition and the property is required by the Service the framework will attempt to resolve the variable. If variable resolution fails the service will halt its startup. If a property that is not required fails it's variable resolution the Service continues to load but the property run-time will be replaced with a blank value.
Copyright: Copyright (c) 2008
Company: StreamScape Technologies
Modifier and Type | Method and Description |
---|---|
java.util.List |
getPropertiesWithVariables(ConfigurationObject sco)
Returns a list of property objects that have a variable defined.
|
java.util.List |
getVariableDefinitions(ConfigurationObject sco)
Returns a list of
Global Variables that are being used by the Service. |
boolean |
hasGlobalVariableDefinitions(ConfigurationObject sco)
Returns
true if the service configuration has any global variables defined. |
ClientFactory |
resolveVariables(ClientFactory factory)
Resolves the variables, substituting their expanded values in the run-time configuration registry.
|
ConfigurationObject |
resolveVariables(ConfigurationObject sco)
Resolves the variables, substituting their expanded values in the run-time configuration registry.
|
JDBCFactory |
resolveVariables(JDBCFactory factory)
Resolves the variables, substituting their expanded values in the run-time configuration registry.
|
TransportFactory |
resolveVariables(TransportFactory factory)
Resolves the variables, substituting their expanded values in the run-time configuration registry.
|
boolean hasGlobalVariableDefinitions(ConfigurationObject sco)
true
if the service configuration has any global variables defined.sco
- IServiceConfigurationObject The Service Configuration Object
.true
if the specified SCO has global variables, false
otherwise.java.util.List getPropertiesWithVariables(ConfigurationObject sco)
sco
- the Service Configuration Object
.java.util.List getVariableDefinitions(ConfigurationObject sco)
Global Variables
that are being used by the Service.sco
- the Service Configuration Object
.ConfigurationObject resolveVariables(ConfigurationObject sco) throws ResolutionException, ServiceConfigurationException, UnresolvedVariableException
sco
- the Service Configuration Object
.ResolutionException
- if some resolution error occurs.ServiceConfigurationException
- if some error with occurs with the specified SCO.UnresolvedVariableException
- if any variable is not resolved.ClientFactory resolveVariables(ClientFactory factory) throws ResolutionException
factory
- the client factory.ResolutionException
- if some resolution error occurs.JDBCFactory resolveVariables(JDBCFactory factory) throws ResolutionException
factory
- the JDBC factory.ResolutionException
- if some resolution error occurs.TransportFactory resolveVariables(TransportFactory factory) throws ResolutionException
factory
- the transport factory.ResolutionException
- if some resolution error occurs.Copyright © 2015-2024 StreamScape Technologies. All rights reserved.