Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 6.1.0
-
Fix Version/s: 6.1.0rc0
-
Component/s: J2EE/Extra
-
Labels:None
-
Environment:Jetty SVN version | GNU/Linux | JDK 5
-
Number of attachments :
Description
The aims of this improvment is to allow to set a java:comp (ENC) environment to a thread and not to a classloader.
For example, EasyBeans product (EJB3 container) can be packaged in a war file.
Then, when it runs inside Jetty, it has to provide an ENC environment to EJBs. (and to hook up into the existing java: namespace management done by Jetty)
Jetty allows only to set an ENC environment to a classloader. This is done through the org.mortbay.naming.ContextFactory class.
Currently, EasyBeans can be embedded inside Tomcat which allow this kind of settings (ENC per thread) but this is not available inside Jetty.
I agree that it could be considered outside of the scope of the Servlet/JSP specification (as for web application, an ENC should be associated to a classloader), but it will be great if this feature is present in Jetty.
I provide a patch enabling this feature (it uses JDK 5 generics so maybe you have to remove it if you want to ensure it compile with JDK 1.4)
Of course, this can be adapted but this is the basic feature I need to run the EasyBeans product inside Jetty.
The patch allows to set a context to a thread, and when no context is bound to a thread, it works as previously (with classloaders)
Regards,
Florent
Many thanks Florent, I'll take a look at this.