jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jukka Zitting <jukka.zitt...@gmail.com>
Subject Re: MicroKernel.getInstance
Date Tue, 10 Apr 2012 16:32:12 GMT

On Tue, Apr 10, 2012 at 5:23 PM, Julian Reschke <julian.reschke@gmx.de> wrote:
> Proposal: rename to "locator".

Alternative proposal: Get rid of MicroKernelFactory entirely.

Components that need to instantiate a MK implementation should
directly use the appropriate constructor or other
implementation-specific instantiation mechanism. That way whoever
starts the repository or the MK instance is clearly in charge of also
shutting it down when appropriate. The current approach with the MKF
and MK.dispose() doesn't properly address that issue.

URL-based access or other lookups should IMHO only be used for cases
where the repository has already been initialized and only a reference
to it is needed. For such cases we should use JNDI, OSGi service
references, or other existing mechanisms instead of a custom MKF

As an example of using such a solution, see the new
AbstractMicroKernelIT class in oak-it-mk and the standard Java service
provider mechanism it leverages.


Jukka Zitting

View raw message