Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Force buddy classloading programmatically
Force buddy classloading programmatically [message #1754557] Mon, 20 February 2017 09:08 Go to next message
Christian Pontesegger is currently offline Christian PonteseggerFriend
Messages: 191
Registered: July 2009
Location: Graz, Austria
Senior Member
In one of my plugins I have a very special usecase where I would need to use buddy classloading. Instead of adding
Eclipse-BuddyPolicy: global
to the Manifest I would like to force this behavior manually for one call like this:
MyClass.class.getClassLoader().loadClass(name);

As the bundle contains lots of other classes I do not want to take the performance penalty on class loading for all the rest. Only other option I could think of would be to move MyClass to its own plugin.

Any chance to force buddy loading from the classloader - or any global classloader I can get my hands on?

thanks
Christian
Re: Force buddy classloading programmatically [message #1754577 is a reply to message #1754557] Mon, 20 February 2017 13:58 Go to previous message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 481
Registered: July 2009
Senior Member
There is no global class loader to do what you suggest. But I can tell you the buddy global policy implementation uses the PackageAdmin service to find the package for the class being loaded. Perhaps you could do the same yourself:

http://git.eclipse.org/c/equinox/rt.equinox.framework.git/tree/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/buddy/GlobalPolicy.java?h=R4_6_2
Previous Topic:equinox uninstall eclipse features by command line
Next Topic:My bundles need a library in two versions, but only one is deployed.
Goto Forum:
  


Current Time: Mon Jun 18 02:28:17 GMT 2018

Powered by FUDForum. Page generated in 0.01710 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top