users@hk2.java.net

ServiceLocator Parent?

From: buko <buko_at_chiubarobot.com>
Date: Fri, 3 Jan 2014 01:46:28 -0500

Apparently ServiceLocators can have parents but it's not clear how to use
them. I have a case where I have a module that I'd like to reuse across
several ServiceLocators. I could instantiate this same module over and over
and bind it into each ServiceLocator but this is not ideal. It'd be nice to
define a root ServiceLocator with the parent module bound and have each
child/agent ServiceLocator use the root as a parent.

It's not clear how to specify the parent of a ServiceLocator. None of the
methods on ServiceLocatorUtilities seem to take a parent. There's one that
does take another ServiceLocator but it's not clear this does the right
thing.

Any suggestions?