Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » how to get bundle classloader in eclipse 3.0M9
how to get bundle classloader in eclipse 3.0M9 [message #244214] Mon, 24 May 2004 08:01 Go to next message
Eclipse UserFriend
hi,
i am using JNDI naming in my plugin and i need to get reference to the
classloader...the PluginDescriptor class is deprecated from 3.0M9...how can
i get handle to the Bundle classloader in 3.0 M9?

thanks in advance...
balaji
Re: how to get bundle classloader in eclipse 3.0M9 [message #247691 is a reply to message #244214] Mon, 31 May 2004 16:26 Go to previous messageGo to next message
Eclipse UserFriend
So, is there a non-deprecated way to get the class loader of a plug-in
(bundle) in 3.0? My plug-in depends on keeping track of its own class
loader and the class loaders of the plug-ins that use it. The new
Bundle#loadClass() method is not good enough. Should I open a bug for
this request?

balaji wrote:

> hi,
> i am using JNDI naming in my plugin and i need to get reference to the
> classloader...the PluginDescriptor class is deprecated from 3.0M9...how can
> i get handle to the Bundle classloader in 3.0 M9?
>
> thanks in advance...
> balaji
>
>
Re: how to get bundle classloader in eclipse 3.0M9 [message #247699 is a reply to message #247691] Mon, 31 May 2004 17:20 Go to previous message
Eclipse UserFriend
Originally posted by: hani.naguib.info

Hi I just started writing plugins, so I might be way off. But this sounds similar to what I have done.
My plugin also uses JNDI and I had alot of problems related to the class loader (mainly because I did
not know how eclipse handled classloading (not sure I do even now))

What I did was this something like this....

ClassLoader orig = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(MyPlugin.class. getClassLoader());
// Performed my JNDI lookup
....
finally {
Thread.currentThread().setContextClassLoader(orig);
}

Now if someone knows a better way to do this please let me know.


adrian wrote:
> So, is there a non-deprecated way to get the class loader of a plug-in
> (bundle) in 3.0? My plug-in depends on keeping track of its own class
> loader and the class loaders of the plug-ins that use it. The new
> Bundle#loadClass() method is not good enough. Should I open a bug for
> this request?
>
> balaji wrote:
>
>> hi,
>> i am using JNDI naming in my plugin and i need to get reference to the
>> classloader...the PluginDescriptor class is deprecated from
>> 3.0M9...how can i get handle to the Bundle classloader in 3.0 M9?
>>
>> thanks in advance...
>> balaji
>>
>
Previous Topic:Un-Folding opens super-class
Next Topic:[M9] - welcome, samples, swt - Samples do not start
Goto Forum:
  


Current Time: Thu Jul 17 04:52:22 EDT 2025

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

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

Back to the top