| Spring/Rest and OSGi HttpService [message #759269] |
Mon, 28 November 2011 03:31  |
Leen Toelen Messages: 2 Registered: July 2009 |
Junior Member |
|
|
Hi,
does anyone have an example on how to use a Bundle Activator or some other way of service registration and Spring REST support? I would like to add and remove REST resources dynamically using spring rest in virgo.
Regards,
Leen
[Updated on: Mon, 28 November 2011 03:32] Report message to a moderator
|
|
|
|
| Re: Spring/Rest and OSGi HttpService [message #765498 is a reply to message #760419] |
Wed, 14 December 2011 02:45   |
Leen Toelen Messages: 2 Registered: July 2009 |
Junior Member |
|
|
Hi,
I have a running equinox environment (quite bare bones) and an OSGi HttpService is registered as a Service. I would like to register a Servlet of my own. I normally do this by listening for HttpService services and then registering a servlet in it using registerServlet(alias,servlet,...,...)
The servlets I use currently are simple extenders of HttpServlets. I would like to use some spiring rest magic, like @Controller and @PathVariable annotations etc but I have not seen an example of how to create these programatically. the goal is to be able to add and remove these servlets at runtime of course.
Regards,
Leen
[Updated on: Wed, 14 December 2011 02:45] Report message to a moderator
|
|
|
| Re: Spring/Rest and OSGi HttpService [message #771238 is a reply to message #765498] |
Mon, 26 December 2011 13:42  |
Chris Frost Messages: 222 Registered: January 2010 Location: Southampton, England |
Senior Member |

|
|
Hi,
I don't know of any examples. Am I right in saying that you want to automatically deploy a servlet when a bundle is installed in OSGi that contains @Controller?
If so, I think you would have to write a bundle that listens to bundle install events and does it's own scanning for the annotations. Using Gemini Blueprint would help you with some of this though.
Have you considered using WABs. This will all just work with no extra code needed. WABs are defined in the Enterprise OSGi spec and are different to the HttpService but if you want to work with Spring features etc then you will probably find it much easier.
Chris.
------------------------------------------------
Chris Frost, Twitter @cgfrost
Springsource, a divison of VMware.
|
|
|
Powered by
FUDForum. Page generated in 0.06117 seconds