use of org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider 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.lifecycle.SingletonResourceProvider in project cxf by apache.
the class BookServerAsyncClient method createServer.
@Override
protected Server createServer(Bus bus) throws Exception {
JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
sf.setResourceClasses(BookStore.class);
sf.setResourceProvider(BookStore.class, new SingletonResourceProvider(new BookStore(), true));
sf.setAddress("http://localhost:" + PORT + "/");
sf.setProvider(new BooleanReaderWriter());
sf.setProvider(new JacksonJsonProvider());
sf.setProvider(new StreamingResponseProvider<Book>());
sf.getProperties(true).put("default.content.type", "*/*");
return sf.create();
}
use of org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider in project fabric8 by fabric8io.
the class RestJsonSchemaJMXTest method setUp.
@Before
public void setUp() {
SpringBusFactory bf = new SpringBusFactory();
Bus bus = bf.createBus("/io/fabric8/cxf/endpoint/jaxrs/jmx-enable.xml");
BusFactory.setDefaultBus(bus);
JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
sf.setResourceClasses(BookStore.class, BookStoreSpring.class);
sf.setResourceProvider(BookStore.class, new SingletonResourceProvider(new BookStore(), true));
sf.setResourceProvider(BookStoreSpring.class, new SingletonResourceProvider(new BookStoreSpring(), true));
sf.setTransportId(LocalTransportFactory.TRANSPORT_ID);
sf.setAddress("local://books");
sf.getFeatures().add(new ManagedApiFeature());
localServer = sf.create();
}
use of org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider in project fabric8 by jboss-fuse.
the class RestJsonSchemaJMXTest method setUp.
@Before
public void setUp() {
SpringBusFactory bf = new SpringBusFactory();
Bus bus = bf.createBus("/io/fabric8/cxf/endpoint/jaxrs/jmx-enable.xml");
BusFactory.setDefaultBus(bus);
JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
sf.setResourceClasses(BookStore.class, BookStoreSpring.class);
sf.setResourceProvider(BookStore.class, new SingletonResourceProvider(new BookStore(), true));
sf.setResourceProvider(BookStoreSpring.class, new SingletonResourceProvider(new BookStoreSpring(), true));
sf.setTransportId(LocalTransportFactory.TRANSPORT_ID);
sf.setAddress("local://books");
sf.getFeatures().add(new ManagedApiFeature());
localServer = sf.create();
}
Aggregations