Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Getting root folder of single-jar'd plugins causes significant delay
Getting root folder of single-jar'd plugins causes significant delay [message #294238] Mon, 07 November 2005 12:06 Go to next message
Eclipse UserFriend
Originally posted by: mark_melvin.amis.com

Hi There,

I am trying to graft a scripting language (Jython) into Eclipse. I have
it basically working, but I have a bottleneck I was hoping I could get
some advice on in terms of reducing the delay.

Basically, I need to add the classpath for each plugin I want access to
the classpath in Jython. I have finally figured out how to do this, and
have got classloading to work for basically all of Eclipse, however -
when I resolve the "classpath" of the single-JAR'd plugins (most of the
base Eclipse), it proceeds to inflate the plugins into a local cache in
my configuration folder. It only has to do this once, and I have added
progress feedback for it, but it still takes quite awhile. I was
wondering what I could do to avoid this. It seems to be my call to
Platform.asLocalURL() that causes the unJAR'ing to occur. Ideally,
Eclipse would not unJAR the plugin until a class was needed from it, or
not unJAR at all (Eclipse itself doesn't seem to require the unJAR'd
version). Currently, I am getting the full path to this "cached"
location with:

File binPath = new File(Platform.asLocalURL(binUrl).getPath());
binPath.getAbsolutePath()

So, I have two questions:

1) Is there any way to get access to the same information without
causing the unjar'ing to occur?

2) Will this even work? What happens at classloading time? Will
Eclipse cache the files the first time a class is accessed from that
plugin, or does it use some other magical method and load the class
directly from the JAR file, so Jython won't be able to see it anyway
unless I do some fancy classloading stuff myself? It appears that
Eclipse does not use the cache itself, because running the platform and
doing a considerable amount of messing about requiring classes from
these JARs does not cause any unjar'ing/caching to occur. I only see
the SWT dll's being cached.

So, perhaps I can tap into this *magical* classloading myself somehow,
avoiding the time-consuming unJAR'ing? Where would I look to find out
how this works?

Thanks,
Mark.
Re: Getting root folder of single-jar'd plugins causes significant delay [message #294243 is a reply to message #294238] Mon, 07 November 2005 12:34 Go to previous message
Eclipse UserFriend
Originally posted by: mark_melvin.amis.com

Nevermind... ;o)

I found out that I can parse the manifest headers for the
Export-Package: part, and simply add each package to the classpath
individually, and then just let the Eclipse classloading take over to
actually load the class. It works *much* faster as there is no
unJAR'ing taking place, and it seems to do exactly what I need.

Mark.

Mark Melvin wrote:
> Hi There,
>
> I am trying to graft a scripting language (Jython) into Eclipse. I have
> it basically working, but I have a bottleneck I was hoping I could get
> some advice on in terms of reducing the delay.
>
> Basically, I need to add the classpath for each plugin I want access to
> the classpath in Jython. I have finally figured out how to do this, and
> have got classloading to work for basically all of Eclipse, however -
> when I resolve the "classpath" of the single-JAR'd plugins (most of the
> base Eclipse), it proceeds to inflate the plugins into a local cache in
> my configuration folder. It only has to do this once, and I have added
> progress feedback for it, but it still takes quite awhile. I was
> wondering what I could do to avoid this. It seems to be my call to
> Platform.asLocalURL() that causes the unJAR'ing to occur. Ideally,
> Eclipse would not unJAR the plugin until a class was needed from it, or
> not unJAR at all (Eclipse itself doesn't seem to require the unJAR'd
> version). Currently, I am getting the full path to this "cached"
> location with:
>
> File binPath = new File(Platform.asLocalURL(binUrl).getPath());
> binPath.getAbsolutePath()
>
> So, I have two questions:
>
> 1) Is there any way to get access to the same information without
> causing the unjar'ing to occur?
>
> 2) Will this even work? What happens at classloading time? Will
> Eclipse cache the files the first time a class is accessed from that
> plugin, or does it use some other magical method and load the class
> directly from the JAR file, so Jython won't be able to see it anyway
> unless I do some fancy classloading stuff myself? It appears that
> Eclipse does not use the cache itself, because running the platform and
> doing a considerable amount of messing about requiring classes from
> these JARs does not cause any unjar'ing/caching to occur. I only see
> the SWT dll's being cached.
>
> So, perhaps I can tap into this *magical* classloading myself somehow,
> avoiding the time-consuming unJAR'ing? Where would I look to find out
> how this works?
>
> Thanks,
> Mark.
Previous Topic:Setting enablement for editorActions based on file contentType?
Next Topic:Question about implementation of a mor flexible project structure
Goto Forum:
  


Current Time: Sat Jun 07 10:14:15 EDT 2025

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

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

Back to the top