Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 361376

Summary: Provide ObjectFactory that web applications can use when need to lookup OSGi service with java:comp/env
Product: [RT] Gemini.Web Reporter: Violeta Georgieva <milesg78>
Component: unknownAssignee: Violeta Georgieva <milesg78>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: glyn.normington
Version: unspecified   
Target Milestone: 2.1.0.M01   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 361173    
Attachments:
Description Flags
Sample application
none
Patch proposal glyn.normington: review+

Description Violeta Georgieva CLA 2011-10-19 07:21:37 EDT
Created attachment 205504 [details]
Sample application

Hi,

When one application wants to lookup an OSGi service with "java:comp/env", or wants to specify in a servlet, @Resource annotation for OSGi service, then additional bridge is needed because otherwise OSGi services can be looked up only with "osgi" URL scheme. (I'm attaching such sample application)

According to Tomcat's documentation [1] Gemini Web can provide custom ObjectFactory that can be used as such bridge. (I'm attaching patch proposal)

The example that is attached uses this approach - see TestServlet class and context.xml.

Could you please comment?

The application can be requested like this: http://localhost:8080/test/TestServlet

Thanks in advance
Regards
Violeta


[1] http://tomcat.apache.org/tomcat-7.0-doc/jndi-resources-howto.html#Adding_Custom_Resource_Factories
Comment 1 Violeta Georgieva CLA 2011-10-19 07:22:49 EDT
Created attachment 205505 [details]
Patch proposal
Comment 2 Violeta Georgieva CLA 2011-10-19 14:46:58 EDT
Change is tested, committed and pushed.
Commit Id: 0420d18a9e8ab30e26469261a4be2214f8051585