public final class InstancePropertiesManager extends Object
Single InstanceProperties instance created by the manager usually serves to persist properties of single server instance. By definition many InstanceProperties can be created in the same namespace. For common use case client module will use one namespace with several InstanceProperties.
The namespace
used in both non-static methods is just
the symbolic name for the InstanceProperties logically connected
(like instances of the same server type for example) and retrievable
by calling InstancePropertiesManager.getProperties(String)
respectively.
Typical use case:
// we have some instance to persist InstancePropertiesManager manager = InstancePropertiesManager.getInstance(); InstanceProperties props1 = manager.createProperties("myspace"); props1.put("property", "value"); // we want to persist yet another instance InstanceProperties props2 = manager.createProperties("myspace"); props2.put("property", "value"); // we want to retrieve all InstanceProperties from "myspace" // the list will have two elements List<InstanceProperties> props = manager.getInstanceProperties("myspace");
This class is ThreadSafe.
Modifier and Type | Method and Description |
---|---|
InstanceProperties |
createProperties(String namespace)
Creates and returns properties in the given namespace.
|
static InstancePropertiesManager |
getInstance()
Returns the instance of the default manager.
|
List<InstanceProperties> |
getProperties(String namespace)
Returns all existing properties created in the given namespace.
|
public static InstancePropertiesManager getInstance()
public InstanceProperties createProperties(String namespace)
namespace
- string identifying the namespace of created InstancePropertiespublic List<InstanceProperties> getProperties(String namespace)
namespace
- string identifying the namespace