Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » BundleFileWrapper does not wraps the invocation to getResourceURL
BundleFileWrapper does not wraps the invocation to getResourceURL [message #1626991] Sat, 21 February 2015 08:43 Go to next message
Violeta Georgieva is currently offline Violeta GeorgievaFriend
Messages: 278
Registered: October 2010
Senior Member
Hi,

I would like to provide my own BundleFileWrapperFactoryHook in order to wrap the BundleFile. Unfortunately calls to getResourceURL are always delegated to the BundleFile implementation.

Is it intentional that BundleFileWrapper does not wraps the getResourceURL?

The stack is the following:

BundleFileWrapperChain(BundleFile).getResourceURL(String, Module, int) line: 129	
ClasspathManager.findResourceImpl(String, BundleFile, int) line: 420	
ClasspathManager.findLocalResources(String) line: 397	
EquinoxClassLoader(ModuleClassLoader).findLocalResources(String) line: 320	
BundleLoader.findLocalResources(String) line: 797	
BundleLoader.findResources(String) line: 658	
EquinoxClassLoader(ModuleClassLoader).getResources(String) line: 230	


I can see that the wrapped in BundleFileWrapperChain is the one provided by me but when getResourceURL is invoked the implementation provided by BundleFile is returned.

Equinox version is Luna.

Thanks and Regards,
Violeta

[Updated on: Sat, 21 February 2015 08:54]

Report message to a moderator

Re: BundleFileWrapper does not wraps the invocation to getResourceURL [message #1631151 is a reply to message #1626991] Mon, 23 February 2015 16:16 Go to previous messageGo to next message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 503
Registered: July 2009
Senior Member
This is intentional because the BundleFile super class creates the framework specific protocol 'bundleresource' URLs and the builtin internal handler org.eclipse.osgi.storage.url.bundleresource.Handler object to wrap the entry that is found by delegating to the getEntry method.

As long as your wrapper can provide a BundleEntry for the path then the behavior of the BundleFile.getResourceURL method should work. Can you describe why you need to override the behavior of this method?
Re: BundleFileWrapper does not wraps the invocation to getResourceURL [message #1631295 is a reply to message #1631151] Mon, 23 February 2015 18:06 Go to previous messageGo to next message
Violeta Georgieva is currently offline Violeta GeorgievaFriend
Messages: 278
Registered: October 2010
Senior Member
Hi,

It is a common use case that web components (servlets etc.) ask classloader for a resource and then create File object from the returned URL.

We have the following Equinox extension in Virgo [1] which was working with Equinox versions previous to Luna.

Can you suggest how we can achieve the same with Luna?

Thanks,
Violeta

[1] http://git.eclipse.org/c/virgo/org.eclipse.virgo.kernel.git/tree/org.eclipse.virgo.kernel.equinox.extensions/src/main/java/org/eclipse/virgo/kernel/equinox/extensions/hooks/ExtendedBundleFileWrapperFactoryHook.java
Re: BundleFileWrapper does not wraps the invocation to getResourceURL [message #1631367 is a reply to message #1631295] Mon, 23 February 2015 19:03 Go to previous messageGo to next message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 503
Registered: July 2009
Senior Member
I don't have a good suggestion. Perhaps this usecase has been overlooked. Please open a bug to track. We could add the method to the wrapper as a possible solution.
Re: BundleFileWrapper does not wraps the invocation to getResourceURL [message #1631513 is a reply to message #1631367] Mon, 23 February 2015 20:51 Go to previous message
Violeta Georgieva is currently offline Violeta GeorgievaFriend
Messages: 278
Registered: October 2010
Senior Member
Here it is https://bugs.eclipse.org/bugs/show_bug.cgi?id=460637

Thanks,
Violeta
Previous Topic:Could not acquire the framework manipulator service
Next Topic:WebStart Java 7 update 71 72
Goto Forum:
  


Current Time: Tue Apr 16 05:10:25 GMT 2024

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

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

Back to the top