Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Question about custom HttpContext (Followup on Bug 287033)
Question about custom HttpContext (Followup on Bug 287033) [message #482181] Tue, 25 August 2009 15:40 Go to next message
Oliver Rau is currently offline Oliver RauFriend
Messages: 1
Registered: July 2009
Junior Member
Hi,

I started playing around with the HttpContext and how to implement /
optimize it for my own needs. But I'm stuck on a similar question like
asked on this thread:

http://dev.eclipse.org/newslists/news.eclipse.technology.equ inox/msg02525.html

But I don't really get the point on how I can access resource
contributions that are made outside of the bundle where I implemented the
context in.

e.g.

<extension point="org.eclipse.equinox.http.registry.resources">
<resource alias="/bootstrap/config.properties"
base-name="resources/bootstrap/config.properties"
httpcontextId="com.foo.bar.httpContextId" />
<resource alias="/bootstrap/include"
base-name="resources/bootstrap/include"
httpcontextId="com.foo.bar.httpContextId" />

As far as I can tell, most of it is internal API stuff. There is special
logic inside of equinox for the default registry.

Regards

Oliver

Gunnar Wagenknecht wrote:
> Oliver, as a workaround, can you try defining your own HttpContext extension
> (extension point "org.eclipse.equinox.http.registry.httpcontexts") and
> reference this in the resource registrations? You can then provide your own
> optimized HttpContext implementation which does not call Bundle#findEntries
(if
> you don't need that behavior).
Re: Question about custom HttpContext (Followup on Bug 287033) [message #482305 is a reply to message #482181] Wed, 26 August 2009 07:35 Go to previous message
Gunnar Wagenknecht is currently offline Gunnar WagenknechtFriend
Messages: 486
Registered: July 2009
Location: San Francisco ✈ Germany
Senior Member

Oliver Rau schrieb:
> But I don't really get the point on how I can access resource
> contributions that are made outside of the bundle where I implemented the
> context in.

I can see the issue here. Usually a ResourceRegistration uses a
HttpContext created particular for the bundle which registers a
resource. It then calls HttpContext#getResource on that context which
returns an URL to the resource from within the bundle. Of course, that
context has a reference to the bundle, because it was created
specifically for that bundle and has a mapping.

When you specify a httpcontextId the ResourceRegistration doesn't create
one but uses that one particular context instance for all
resource/servlet registrations.

I can see two option.

(1) You modify your HttpContext in a way that is also reads the
extension registry and processes any
org.eclipse.equinox.http.registry.resources contribution to build an
internal map of which bundle contributes which resource (similar to what
DefaultRegistryHttpContext with ResourceMapping). This allows you to get
a list of bundles contributing resources.

(2) The behavior above is reviewed and new functionality (API?) is added
which allows a contributed HttpContext to better participate in resource
registrations to avoid the workaround of extra registry processing as
mentioned above.

I'm not sure if the behavior is intended. You should probably open a new
issue for option (2) to investigate if such an enhancement is needed.

-Gunnar



--
Gunnar Wagenknecht
gunnar@wagenknecht.org
http://wagenknecht.org/
Previous Topic:Why my bundle is always in state resolved initially
Next Topic:Equinox in a Servlet Container Threading Model
Goto Forum:
  


Current Time: Tue Apr 16 22:01:21 GMT 2024

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

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

Back to the top