You can try a Application. See https://osgi.org/specification/osgi.cmpn/7.0.0/service.jaxrs.html#service.jaxrs.resource.services @Component(service=Application.class) @JaxrsName("myApp") @JaxrsApplicationBase("foo") public class MyApplication extends Application {}
Cheers Christian Am Fr., 28. Dez. 2018 um 16:24 Uhr schrieb Oliver Schweitzer < oschweit...@me.com>: > Hi, > > I have an existing REST JAX-RS Application based on CXF mechanics. that is > the Resources are lifecycle managed by a programmatically setup > JAXRSServerFactoryBean, which itself gets started and stopped by an > immediate @Component > > Now I want to build new entrypoints (and eventually migrate old ones) > using the JAX-RS whiteboard, as discussed e.g. here > http://karaf.922171.n3.nabble.com/Aries-JAX-RS-Whiteboard-td4054440.html, > and go full dynamically discovered declarative services with my REST API > and application. > > The basic setup (without extensions) works very well, now I want to > replace all my programmatic CXF configuration with @Components annotated > with @JaxrsExtension, use only JAX-RS/Whiteboard mechanics and no more > CXF specialties if possible. > > Now for the questions: > > 1. Some of the providers I configure programmatically implement JAX-RS > interfaces and are provided by CXF or other frameworks, > e.g. CrossOriginResourceSharingFilter, MultipartProvider, > JacksonJsonProvider, WebApplicationExceptionMapper. > How do I make these known to my JAX-RS Whiteboard (Whiteboard service) > ?Just derive a new class, annotate as a Component and JaxrsExtension? > > 2. Swagger2Feature, JAASLoginInterceptor, FastInfosetFeature, GZIPFeature, > CORSPreflightInterceptor (my code, extends > AbstractPhaseInterceptor<Message>) are provided by CXF and implement CXF > interfaces. I gather I can't use these directly with the Whiteboard? What > do I do with those? Reimplement/port to JAX-RS? > > Best regards, > > Oliver > > > > > -- -- Christian Schneider http://www.liquid-reality.de Computer Scientist http://www.adobe.com