On Wed, Jul 21, 2010 at 3:49 AM, David Jencks <[email protected]> wrote: > > On Jul 20, 2010, at 10:24 PM, Jarek Gawor wrote: > >> David, >> >> Most jndi lookups via the java namespace are supposed to return an >> unique instance on each lookup. If we route the java namespace lookups >> directly to service registry lookups we will no longer be returning >> unique instances because service registry lookups are cached >> automatically. So we really need to do what we have done before and >> lookup a gbean in SR and call .$getResource() on it. That also means >> that each gbean that implements ResourceSource interface must not >> implement the ServiceFactory interface where getService() calls >> $getResource(). >> > > Does this mean that if we want to make the datasources available directly in > the osgi or aries namespace, perhaps always returning the same instance, and > also want to satisfy the uniqueness requirement for looking it up in the > java: namespace, we need to register 2 services in the service registry?
Yes, I think so - if we want to lookup gbeans in service registry instead of the kernel registry. We could also revert the code and go back to old way of doing things. That is, lookup gbeans in kernel registry for java namespace and register service factories for these gbeans in service registry for osgi/aries namespace lookups. Jarek
