A simple algorithm for determining the full set of visible resources on the classpath of an OSGi bundle
Original Publication Date: 2010-Jan-27
Included in the Prior Art Database: 2010-Jan-27
There are many applications and libraries in Java that rely on being able to list the contents of a ClassLoader's Class Path. These libraries often fail when deployed in an OSGi framework due to the radically different ClassLoader hierarchy. This article outlines an algorithm for listing the complete set of resources accessible via an OSGi bundle's ClassLoader. This algorithm can be used to perform the equivalent of Class-Path scanning in a JSE or JEE environment, and can be used to provide the functionality expected in these libraries. This algorithm does not rely on provider specific interfaces, and can be implemented on any compliant OSGi framework.