Thanks BJ, > I believe this only applies to code running in an OSGi bundle. This is to support packaging OSGi-unware code in a bundle.
So there are no requirements to avoid disturbing other code running inside the same JVM, or to support embedding scenarios? But it is possible for a JNDI implementation to support calls from outside the OSGi framework to JNDI code inside the framework. However this is certainly not required by the OSGi spec. Life cycle issues would also be a problem. The life cycle would certainly be an issue if the outside application were to make its calls through the OSGI JNDI implementation, but maybe this is not the only way to allow the outside application to perform JNDI calls? The problem with JNDI is that global handlers are registered for the whole JVM, so the OSGI behaviour leaks outside the container... it would be more suitable if the OSGI behaviour was only exposed to bundles and not to the outside. Couldn't it make sense to have a general requirement that any OSGI implementation of a JVM-wide Java API should only be exposed to bundles in the same container (ie be container-wide instead of JVM-wide) and let behaviour fallback to the default JRE handling for calls originating from outside the container? I'm thinking this would also be a good thing when running multiple OSGI containers inside the same JVM, as this kind of leaked handler registrations outside the container would otherwise cause conflicts? Best regards Mike BJ Hargrave wrote: I believe this only applies to code running in an OSGi bundle. This is to support packaging OSGi-unware code in a bundle. But it is possible for a JNDI implementation to support calls from outside the OSGi framework to JNDI code inside the framework. However this is certainly not required by the OSGi spec. Life cycle issues would also be a problem. -- BJ Hargrave Senior Technical Staff Member, IBM OSGi Fellow and CTO of the <http://www.osgi.org/> OSGi Alliance <mailto:[email protected]> [email protected] office: +1 386 848 1781 mobile: +1 386 848 3788 From: Mike Wilson <[email protected]> To: <[email protected]>, Date: 2012/12/03 08:54 Subject: [osgi-dev] does OSGI JNDI allow coexistence with JNDI calls from non-OSGI code? Sent by: [email protected] _____ Reading chapter 126 of the OSGI Enterprise Release 5 specification, I see mentions of compatibility with the traditional JNDI programming model, and with OSGI-unaware code. Does this only apply to code running inside an OSGI bundle? Or, should an OSGI JNDI implementation also support JNDI calls being made from OSGI-unaware code from *outside* the OSGI container but within the same JVM, f ex when the container is embedded inside an application? [I've asked the same question on SO: <http://stackoverflow.com/questions/13682882/does-osgi-jndi-allow-coexistenc e> http://stackoverflow.com/questions/13682882/does-osgi-jndi-allow-coexistence -with-jndi-calls-from-non-osgi-code but later found this list which seems like a better suit for the subject. Sorry about the double post.] Best regards Mike Wilson _______________________________________________ OSGi Developer Mail List [email protected] <https://mail.osgi.org/mailman/listinfo/osgi-dev> https://mail.osgi.org/mailman/listinfo/osgi-dev
_______________________________________________ OSGi Developer Mail List [email protected] https://mail.osgi.org/mailman/listinfo/osgi-dev
