use of org.apache.cxf.jaxrs.rx3.server.ReactiveIOCustomizer in project cxf by apache.
the class RxJava3FlowableServer method createFactoryBean.
private JAXRSServerFactoryBean createFactoryBean(boolean useStreamingSubscriber, String relAddress) {
JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
sf.getProperties(true).put("useStreamingSubscriber", useStreamingSubscriber);
sf.setProvider(new JacksonJsonProvider());
sf.setProvider(new IllegalArgumentExceptionMapper());
sf.setProvider(new IllegalStateExceptionMapper());
new ReactiveIOCustomizer().customize(sf);
sf.getOutInterceptors().add(new LoggingOutInterceptor());
sf.setResourceClasses(RxJava3FlowableService.class);
sf.setResourceProvider(RxJava3FlowableService.class, new SingletonResourceProvider(new RxJava3FlowableService(), true));
sf.setAddress("http://localhost:" + PORT + relAddress);
return sf;
}
use of org.apache.cxf.jaxrs.rx3.server.ReactiveIOCustomizer in project cxf by apache.
the class RxJava3MaybeServer method createServer.
@Override
protected Server createServer(Bus bus) throws Exception {
// Make sure default JSONProvider is not loaded
bus.setProperty("skip.default.json.provider.registration", true);
JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
sf.setProvider(new JacksonJsonProvider());
new ReactiveIOCustomizer().customize(sf);
sf.getOutInterceptors().add(new LoggingOutInterceptor());
sf.setResourceClasses(RxJava3MaybeService.class);
sf.setResourceProvider(RxJava3MaybeService.class, new SingletonResourceProvider(new RxJava3MaybeService(), true));
sf.setAddress("http://localhost:" + PORT + "/");
return sf.create();
}
use of org.apache.cxf.jaxrs.rx3.server.ReactiveIOCustomizer in project cxf by apache.
the class RxJava3ObservableServer method createServer.
@Override
protected Server createServer(Bus bus) throws Exception {
// Make sure default JSONProvider is not loaded
bus.setProperty("skip.default.json.provider.registration", true);
JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
sf.setProvider(new JacksonJsonProvider());
sf.setProvider(new IllegalStateExceptionMapper());
new ReactiveIOCustomizer().customize(sf);
sf.getOutInterceptors().add(new LoggingOutInterceptor());
sf.setResourceClasses(RxJava3ObservableService.class);
sf.setResourceProvider(RxJava3ObservableService.class, new SingletonResourceProvider(new RxJava3ObservableService(), true));
sf.setAddress("http://localhost:" + PORT + "/");
return sf.create();
}
use of org.apache.cxf.jaxrs.rx3.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;
}
Aggregations