Merlin JNDI Avalon Development Team

Status: Under Development

Since: Merlin 3.4

The Merlin JNDI package provides support for the establishment of a Merlin Kernel via JNDI.

This is an initial minimal JNDI connector implementation that enables the establishment of a Merlin Kernel via JNDI. This allows establishment and access to a Merlin kernel based on a set of properties containing the system and home path, the root block and internal kernel logging priority.

Using the JNDI context, a servlet can do something like the following:

Context context = new InitialContext(); Context env = (Context) context.lookup("java:comp/env"); Kernel kernel = (Kernel) env.lookup("merlin/ServiceFactory"); // then use the kernel to get the service that you want

The current implementation relies on the fact that the server.xml has the definition of the root block to be loaded. Currently the connector is returning the kernel, however it should be possible to return a naming context from which services are access via JNDI lookups. If the initial lookup returns a context then it should be possible to eliminate knowledge of the kernel - and keep things focussed on simply accessing services. This also brings in the potential for including JNDI url resolution of services (i.e. service resolution with arguments) which seems to me a desirable direction.