Is there a way to inject servlet filters into a JAX-RS application
deployed in OSGi without resorting to turning my bundle into a WAR?
Currently, my RESTful application is deployed into Karaf 2.2.5 using CXF
2.4.6, and started using a Spring configuration
(META-INF/spring/bundle-context.xml), like this:
<jaxrs:server address="http://0.0.0.0:${web.serverListenPort}"
beanNames="fooBean barBean">
<jaxrs:inInterceptors>
<ref bean="requestTimeInInterceptor" />
</jaxrs:inInterceptors>
<jaxrs:outInterceptors>
<ref bean="requestTimeOutInterceptor" />
</jaxrs:outInterceptors>
<jaxrs:features>
<cxf:logging />
</jaxrs:features>
</jaxrs:server>
Placeholder web.serverListenPort is resolved using the OSGi
Configuration Manager (META-INF/spring/bundle-context-osgi.xml).
When I deploy my bundle, it starts up Jetty and listens to that port.
What I would like to do is specify a servlet filter (namely, Spring's
DelegatingFilterProxy / springSecurityFilterChain) to sit in front of
CXF without resorting to using web.xml. Is this even possible using pure
Spring, or do I need to write a custom invoker, or something like that?
--sgp