Registries

Overview

Registries are the managers of objects in uPortal 3. All the application level code communicates with registries. The registries take care of communicating with the caching and persistence layers. Application code should never hold on to a reference to a registry managed object. Instead the objects ID should be referenced and used to query the appropriate registry for an instance of the object whenever it is needed.

Registry Concepts

  • Don't hold on to objects! - The core idea behind registries is removing the need for application code to hold on to object references while keeping DAO implementations simple. Application code should only keep references to IObjectId types and use them to retrieve the full object from the registries. This allows for a central layer of DAO interaction, object construction and object caching to be configured application wide.
  • Primary ID - The Primary ID is the unique primary key for the object being stored in the registry. All registry managed objects have a primary ID and it always implements the IObjectId interface.
  • Secondary Keys - Secondary keys are Strings that also uniquely identify an object. The registry provides direct access to an object by each of its secondary keys.
  • Parent IDs - Registered objects may be part of a hierarchy and may be retrieved in a Set by a single parent id. The registries keep track of each parent ID and the set of children associated with that parent id.

Design

Overview of registry hierarchy:

AbstractRegsitry

The AbstractRegsitry is the base of all registries in uP3. It provides the functionality for storing the object the registry is managing with a key, managing secondary keys for the object and sets of registered objects for parent ids.

GenericNotifyingRegistry extends AbstractRegsitry

The GenericNotifyingRegistry provides a common base for registries that send event notifications for changes that occur within the registry.

GenericCachingRegistry extends GenericNotifyingRegistry

The GenericCachingRegistry provides an implementation of IRegistryStore and the updateIdSetOn* methods to correctly handle registry actions when using a volatile cache for backing.

GenericPortletRegistry extends GenericCachingRegistry

The GenericPortletRegistry add portlet domain object specific features to the registry. The concepts of a parent object and a parent application object are well defined. An example of a parent object is a IPortletDeployment is the parent object of a IPortletDefinition. An example of a parent application object is a IPortletApplicationDefinition is the parent application of a IPortletDefinition. The methods provided manage the relationships of these parent objects and access to the domain object via the parent object's identifiers.