This is a core class used by application that use registry in the embedded mode. This class is used to create embedded registry instances for user sessions.
UserRegistry is the embedded mode implementation of the Registry API. In this mode, all registry accesses has to be done using a UserRegistry instance. And there has to be separate UserRegistry instance for each user to access the registry. These UserRegistry instances has be obtained from the {@link EmbeddedRegistry}. It is recommended to have only one EmbeddedRegistry instance per application. But there can be exceptions, where it is required to maintain two or more registries pointing to different data sources.
Applications should initialize an EmbeddedRegistry instance at the start-up using following code.
InputStream configStream = new FileInputStream("/projects/registry.xml"); RegistryContext registryContext = new RegistryContext(configStream); EmbeddedRegistry embeddedRegistry = new EmbeddedRegistry(registryContext);
After initializing an EmbeddedRegistry instance it should be stored in some globally accessible location, so that it can be used by necessary modules to create UserRegistry instances. From this, it is possible to create UserRegistry instances using various parameter combinations documented in getXXRegistry methods.
UserRegistry adminRegistry = embeddedRegistry.getRegistry("admin", "admin");
@see EmbeddedRegistry
@see UserRegistry