[ http://issues.apache.org/jira/browse/FELIX-42?page=comments#action_12362327 ]
Jeff McAffer commented on FELIX-42: ----------------------------------- FWIW, Equinox has addressed this issue using a notion called "buddy loading" (named after SCUBA buddy breathing in case you were interested) whereby bundles can specify a classloading policy of last resort. This approach also uses a mechanism called the ContextFinder which is essentially a dummy classloader (installed as the default context classloader) that searches down the current execution stack for a likely suspect classloader to use. The current behaviour is to find the first non-system classloader but we have played with several other approaches. The ContextFinder, in combination with buddy loading, can then be used by clients of code using context classloaders to call without having to mess with setting/unsetting the context classloader. There is some level of discussion on this in the Eclipse Help and details in Chapter 20 of the Eclipse RCP book. > Define a strategy for dealing with context class loader usage > ------------------------------------------------------------- > > Key: FELIX-42 > URL: http://issues.apache.org/jira/browse/FELIX-42 > Project: Felix > Type: New Feature > Components: Framework > Reporter: Richard S. Hall > Priority: Minor > > Many third-party libraries use the context class loader associated with a > thread as a means to implement plugins or as a way to gain access to classes > in a context outside of the library itself, such as from another component or > module. This mechanism does not play well with the OSGi framework, which does > its own fair share of class loader magic. Further, the context class loader > provides access to potentially arbitrary classes, which (from the perspective > of the OSGi framework) breaks modularity. Regardless, in the interest of > making Felix play well with these third-party libraries, it is worthwhile to > investigate whether a strategy for dealing with the context class loader can > be devised, such as setting the context class loader at the callback entry > points for each bundle. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

