Search in sources :

Example 1 with ReactiveIOCustomizer

use of org.apache.cxf.jaxrs.rx2.server.ReactiveIOCustomizer in project cxf by apache.

the class RxJava2FlowableServer method createFactoryBean.

private JAXRSServerFactoryBean createFactoryBean(Bus bus, boolean useStreamingSubscriber, String relAddress) {
    JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
    sf.getProperties(true).put("useStreamingSubscriber", useStreamingSubscriber);
    sf.setProvider(new JacksonJsonProvider());
    new ReactiveIOCustomizer().customize(sf);
    sf.getOutInterceptors().add(new LoggingOutInterceptor());
    sf.setResourceClasses(RxJava2FlowableService.class);
    sf.setResourceProvider(RxJava2FlowableService.class, new SingletonResourceProvider(new RxJava2FlowableService(), true));
    sf.setAddress("http://localhost:" + PORT + relAddress);
    return sf;
}
Also used : ReactiveIOCustomizer(org.apache.cxf.jaxrs.rx2.server.ReactiveIOCustomizer) LoggingOutInterceptor(org.apache.cxf.ext.logging.LoggingOutInterceptor) JacksonJsonProvider(com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider) JAXRSServerFactoryBean(org.apache.cxf.jaxrs.JAXRSServerFactoryBean) SingletonResourceProvider(org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider)

Aggregations

JacksonJsonProvider (com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider)1 LoggingOutInterceptor (org.apache.cxf.ext.logging.LoggingOutInterceptor)1 JAXRSServerFactoryBean (org.apache.cxf.jaxrs.JAXRSServerFactoryBean)1 SingletonResourceProvider (org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider)1 ReactiveIOCustomizer (org.apache.cxf.jaxrs.rx2.server.ReactiveIOCustomizer)1