Evidence Controller Hook Registrar & Manager

Following on from the Evidence Registrar and the underlying Dependency Injection pattern, a similar approach has been taken for the registration of the Evidence Controller Hook class. An Evidence Controller Hook Registrar interface is shipped as part of the evidence infrastructure. As before, at runtime, the Evidence Controller invokes the Registrar's register method which performs the dependency injection of the associated custom Evidence Controller Hook. This is the class which will have extended the out-of-the-box Evidence Controller Hook and overridden the methods being customized. This "injector" class is located through runtime configuration where the injector class itself is referred to as the "Evidence Controller Hook Registrar".

The dependency injection involves two steps. First, a custom Evidence Controller Hook Registrar, which implements the Evidence Controller Hook Registrar interface, must be located and the Registrar then invoked to register the customized hook class. For example, the product type and custom Evidence Controller Hook class pairing will be entered into a hashmap and then the class looked up via the product type when it's required. In order to locate the Evidence Controller Hook Registrar, its class name must be configured using the environment variable "curam.case.evidencecontrollerhook.registrars". Note: additional entries need to be added to this environment variable in a comma delimited format.

The implementation of the Registrar's register method must reference the customized Evidence Controller Hook class. Doing this in code, rather than as configuration, provides a compile time check that the referenced class exists. The existence of the Registrar, though, is only ascertained from the provided configuration, and may result in a runtime failure if the application is mis-configured.

The Evidence Controller Hook Manager class manages the static initialization of the Evidence Controller Hook mapping as well as the retrieval of the subclass of the Evidence Controller Hook. If no subclass is found, the out-of-the-box version of the Evidence Controller Hook class is returned.