On Tue, Nov 03, 2009 at 05:18:05PM +0100, Jeremias Maerki wrote: > Over the past few months, I've started to get FOP, Batik and Commons > running in an OSGi environment. The first easy step is to just add the > necessary metadata to the manifest. However, that is not enough in the > case here. The problem: we're using the JAR Service Provider mechanism > from the JAR specification (META-INF/services directory in the JARs). > > OSGi doesn't have a hierarchical class loader setup like traditional > Java applications which is why FOP, for example, may not see all > available plug-ins anymore if they are not compiled together into a > monster-JAR. > > The solution was to build an abstraction layer above the direct access > to the META-INF/services files. In an OSGi-environment, a special > component (a so-called extender) will watch all available bundles (=JARs) > in the application. If it finds plug-ins it make them available despite > the class loader isolation. Well, that's simply the executive summary. > In the end, this is a replacement for the "Services" class in XML > Graphics Commons which we use today.
I am surprised that such a utility does not yet exist. Surely FOP is not the only application that loads plug-ins. Eclipse is based on plug-ins, but I suppose they solve the problem because you have to install eclips plug-ins in known places. Simon -- Simon Pepping home page: http://www.leverkruid.eu --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
