On Mon, Jan 19, 2009 at 2:40 PM, Nairon Viana <[email protected]> wrote: > > Hello, > > I'm trying to integrate the OSGi framework with other java-based platform. > Among the many problems I have encountered, there is one in particular: I > need to access an OSGi service using a non-bundle component. Somebody knows > any way for performing this without disagreeing with the specification?
You have several ways to do this; * Let the foreign component sit on the classpath, and have the Framework bundle export the packages needed. * Most non-bundles can be bundlized easily. * Each framework allows for embedded operation and letting the outside world become part of the OSGi world so to speak. I have personally only worked with Felix in this, and there you basically implement an Activator and it is passed as an argument when you shoot up Felix. Felix will then pass you the BundleContext as if you were inside the OSGi world, and you can then either provide or consume services. * There is a "last resort" called bootclasspath delegation, where the classloader will look in the parent classloader (i.e. System CL) for one or more packages, before using the module layer in OSGi. I recommend against this, and try the export via the framework first. Cheers Niclas -- http://www.qi4j.org - New Energy for Java _______________________________________________ OSGi Developer Mail List [email protected] https://mail.osgi.org/mailman/listinfo/osgi-dev
