use of org.apache.cxf.jaxrs.rx3.server.ReactiveIOCustomizer in project cxf by apache.
the class RxJava2MaybeServer 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(RxJava2MaybeService.class);
sf.setResourceProvider(RxJava2MaybeService.class, new SingletonResourceProvider(new RxJava2MaybeService(), 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 RxJava2ObservableServer method createServer.
@Override
protected Server createServer(Bus bus) throws Exception {
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(RxJava2ObservableService.class);
sf.setResourceProvider(RxJava2ObservableService.class, new SingletonResourceProvider(new RxJava2ObservableService(), 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 RxJava2SingleServer 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(RxJava2SingleService.class);
sf.setResourceProvider(RxJava2SingleService.class, new SingletonResourceProvider(new RxJava2SingleService(), 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 RxJava3SingleServer 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(RxJava3SingleService.class);
sf.setResourceProvider(RxJava3SingleService.class, new SingletonResourceProvider(new RxJava3SingleService(), 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(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(RxJava2FlowableService.class);
sf.setResourceProvider(RxJava2FlowableService.class, new SingletonResourceProvider(new RxJava2FlowableService(), true));
sf.setAddress("http://localhost:" + PORT + relAddress);
return sf;
}
Aggregations