Search in sources :

Example 6 with ReactiveIOCustomizer

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;
}
Also used : ReactiveIOCustomizer(org.apache.cxf.jaxrs.rx3.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)

Example 7 with ReactiveIOCustomizer

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();
}
Also used : ReactiveIOCustomizer(org.apache.cxf.jaxrs.rx3.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)

Example 8 with ReactiveIOCustomizer

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();
}
Also used : ReactiveIOCustomizer(org.apache.cxf.jaxrs.rx3.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)

Example 9 with ReactiveIOCustomizer

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;
}
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)9 LoggingOutInterceptor (org.apache.cxf.ext.logging.LoggingOutInterceptor)9 JAXRSServerFactoryBean (org.apache.cxf.jaxrs.JAXRSServerFactoryBean)9 SingletonResourceProvider (org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider)9 ReactiveIOCustomizer (org.apache.cxf.jaxrs.rx2.server.ReactiveIOCustomizer)5 ReactiveIOCustomizer (org.apache.cxf.jaxrs.rx3.server.ReactiveIOCustomizer)4