public class RegistryContext extends Object
RegistryFactoryclass to instantiate a
Registry; it expects the
org.sapia.regis.factoryproperty to correspond to the name of the
RegistryFactoryimplementation to use.
Additionally, an instance of this class allows setting a property indicating one or multiple
Java property resources to load within this instance's given properties (which are passed at
instantiation time). That property is:
org.sapia.regis.boostrap, and allows
setting a comma-delimited list of resources are to be exclusively loaded. Each resource is
interpreted as being either (whichever matches first):
Note that specified resource names can contain variables of the form
variables are resolved using the properties passed to the instance of this class at construction
time, or using system properties.
The properties in the resource that was found will be added to the ones passed to the instance of this class at contruction time, prior to the actual registry factory being instantiated.
This feature was introduced to allow connecting to different registries, depending on the environment.
For example, imagine that a
registry.properties file is kept in the user home directory on developer
workstations. That file contains the properties necessary to connect to a
(in order to avoid dealing with remote connections when developing). But let's say that when in other environments
(dev, QA, prod...), the
registry.properties file to use is stored by convention in the classpath, under the
regis/conf/registry.properties, and holds properties used to connect to a remote registry, shared by
distributed applications (see
In order to load the appropriate
registry.properties, we could set a property (in the
Properties passed to the
constructor of this class) :
Then, upon its
connect() method being called, the instance of this class resolves the boostrap properties (according
to the above-described algorithm), which add themselves to the properties that were passed in at construction time. Thus, the
boostrap properties are additive, and are used just as the others when instantiation registry factory.
|Modifier and Type||Field and Description|
This constant corresponds to the property that indicates which Java propertis (file, URL, classpath resource) to use to initialiase an instance of this class.
This constant corresponds to the property that indicates which
This constant corresponds to the property indicating if properties should be interpolated prior to being returned (defaults to true).
public static final String FACTORY_CLASS
RegistryFactoryto use to instantiate a
public static final String BOOTSTRAP
public RegistryContext(Properties props)
Propertiesto used to connect to the desired
Copyright © 2014 Sapia OSS. All rights reserved.