We would need the possibility to configure, if createDefaultHttpContext returns shared or non-shared http context.
Currently, an instance of DefaultHttpContext is returned, where one of the keys is the bundle context. Therefore, in the case of system I currently work on, JAX-RS Provider receives HttpContext with JAX-RS bundle id, and I'm unable to register HttpSessionListener in that context from another bundle.
When using the Equinox implementation (org.eclipse.equinox.http.servlet) I can get org.eclipse.jetty.server.Server instance where I can register HttpSessionListener that will work in global context (so for the sessions created by JAX-RS in particular). I was enable to find similar way in pax-web. When I use WebContainer.registerEventListener, my listener is not notified for sessions created by JAX-RS, because I'm unable to get the HttpContext that JAX-RS bundle is using.
If I was able to change how createDefaultHttpContext would work, we would have the same context.
The method would change from :
Am I overseeing some reason, why the given solution would not work, or not give me the functionality or need, or is otherwise unappropriate?
Or there is already some (even hacky) solution to register global session listener that would be used by all contextes?