Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 361376 - Provide ObjectFactory that web applications can use when need to lookup OSGi service with java:comp/env
Summary: Provide ObjectFactory that web applications can use when need to lookup OSGi ...
Status: CLOSED FIXED
Alias: None
Product: Gemini.Web
Classification: RT
Component: unknown (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 2.1.0.M01   Edit
Assignee: Violeta Georgieva CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 361173
  Show dependency tree
 
Reported: 2011-10-19 07:21 EDT by Violeta Georgieva CLA
Modified: 2011-10-31 14:00 EDT (History)
1 user (show)

See Also:


Attachments
Sample application (3.45 KB, application/x-zip-compressed)
2011-10-19 07:21 EDT, Violeta Georgieva CLA
no flags Details
Patch proposal (6.46 KB, patch)
2011-10-19 07:22 EDT, Violeta Georgieva CLA
glyn.normington: review+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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