Hi Laszlo,

my comments inline:

Am 27.03.2012 14:41, schrieb László Hordós:
Hi Achim,

I'm sorry to be rude but I was upset and in a very bad mood after spending days 
and debugging the problem and suddenly it was just closed without discussing. 
If you accept my apology I'd suggest lets forget what happened and I'd like to 
fresh start and discuss the Pax Web issue. I'm sorry and I'm very appreciate 
your donation and work to OpenSource and I hope we can work well together in 
the future. :)

apologies accepted so let's get on with it :)

My original issue start with the situation when I want to create a shared 
HttpContext and the WhiteBoard extender can register this. Any time in the 
future I want to allow to other bundles to use the WhiteBoard extender to 
register servlets, resources, filters and use the same HttpContextId to 
register with the same HttpContext  instance.

If I understand you correctly you want to be able to share a httpContext between bundles. AFAIK the compendium spec says that the context can only be used by servlets and filters of the same bundle. The reason for this, the OSGi HTTP Service spec only takes care about the std. Servlet registration, there is no whiteboard pattern available yet. So we have to be careful about it. After doing some research on this there are some ideas about the whiteboard pattern on the OSGi-Wiki at
http://wiki.osgi.org/wiki/WebExperience


First time I didn't use the WhiteBoard extender and I get the shared  
HttpContext and the WebContainer from the service registry when I noticed the 
WebContainer instance made by a service factory so I can not get the same 
instance from different bundles. I'm sure there is a reason why it's made by a 
ServiceFactory by design but this lead to a situation when the filter and the 
servlet is registered from different bundles the last registered overwrites the 
previous so either the filter or the servlet only handles the HTTP request.

  The DefaultSharedHttpContext was a good hint to get resources from multiple 
bundles but there is no way to create an instance of SharedHttpContext. I'd 
like to use that Shared Context so I can add bundles dynamically.

The second option to use the pure WhiteBoard extender and it has only the NPE 
problem. The shutdown order of the bundles is unpredictable and sometimes the 
HttpContext is unregistered before the servlets or the filters and the 
WhiteBoard extender tries to unregister filters and servlets after and the 
HttpContext is null. In the issue i pointed to the exact location of where it 
happens. The sample code I pointed in OpenIDM use this code at this moment so 
when you stop the system you can see these exceptions.

Unless you have better suggestion I have only these two issues. That's an 
addition to this I have to use the same BundleContext to register the Servlets 
and Filters because of the same issue with the ServiceFactory if I want to 
access to the same HttpContext instance even if I use the HttpContextId.

The NPE should be fixed, there where already some catches for null contexts but somehow I missed the others :) Regarding the Shared Context this a new feature which breaks some behavior so I guess this can only be added to a 2.0 of Pax-Web.




Thank you your help in advance.
Laszlo



_______________________________________________
general mailing list
general@lists.ops4j.org
http://lists.ops4j.org/mailman/listinfo/general


--
- Apache Karaf<http://karaf.apache.org/>  Committer&  PMC
- OPS4J Pax Web<http://wiki.ops4j.org/display/paxweb/Pax+Web/>    Committer&  
Project Lead
- Blog<http://notizblog.nierbeck.de/>


_______________________________________________
general mailing list
general@lists.ops4j.org
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to