Child pages
  • NewIn2JavaDefinitionAPI
Skip to end of metadata
Go to start of metadata

Java Registry Definition API

The Registry Definition API is a collection of interfaces for the definition of the constituents of a registry. This includes modules, extension points (services and configurations),
extensions (implementation, contributions, interceptors etc.) and their relationships.

The hivemind-framework library includes a default implementation of these interfaces.

The following example shows how two services (Calculator and Adder) are defined and wired:

In comparison to the XML or annotation based definition this is quite verbose, but it is the most versatile technique.

A main concept of the definition API is the use of constructor callbacks. The service implementation CalculatorImpl
of the Calculator service is constructed by a call to an implementation of the ImplementationConstructor interface.
The use of callbacks allows to realize lazy instantiation and service models (POOLED, THREADED) which require the
construction of multiple service instances.

The core services of the hivemind-framework library are defined by this API too. Have a look at CoreServicesProvider to see more example code.

  • No labels