use of org.apache.cxf.jaxrs.JAXRSServerFactoryBean in project cxf by apache.
the class BookServerAsyncClient method run.
protected void run() {
Bus bus = BusFactory.getDefaultBus();
setBus(bus);
JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
sf.setBus(bus);
sf.setResourceClasses(BookStore.class);
sf.setResourceProvider(BookStore.class, new SingletonResourceProvider(new BookStore(), true));
sf.setAddress("http://localhost:" + PORT + "/");
sf.setProvider(new BooleanReaderWriter());
sf.getProperties(true).put("default.content.type", "*/*");
server = sf.create();
BusFactory.setDefaultBus(null);
BusFactory.setThreadDefaultBus(null);
}
use of org.apache.cxf.jaxrs.JAXRSServerFactoryBean in project cxf by apache.
the class BookServerResourceCreatedOutside method run.
protected void run() {
setBus(BusFactory.getDefaultBus());
JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
sf.setBus(getBus());
BookStore bs = new BookStore();
sf.setServiceBean(bs);
sf.setAddress("http://localhost:" + PORT + "/");
server = sf.create();
}
use of org.apache.cxf.jaxrs.JAXRSServerFactoryBean in project cxf by apache.
the class BookContinuationServer method run.
protected void run() {
JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
sf.setResourceClasses(BookContinuationStore.class);
sf.setResourceProvider(BookContinuationStore.class, new SingletonResourceProvider(new BookContinuationStore()));
sf.setAddress("http://localhost:" + PORT + "/");
sf.create();
}
use of org.apache.cxf.jaxrs.JAXRSServerFactoryBean in project cxf by apache.
the class BookCxfContinuationServer method run.
protected void run() {
JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
sf.setResourceClasses(BookCxfContinuationStore.class);
sf.setResourceProvider(BookCxfContinuationStore.class, new SingletonResourceProvider(new BookCxfContinuationStore()));
sf.setAddress("http://localhost:" + PORT + "/");
sf.create();
}
use of org.apache.cxf.jaxrs.JAXRSServerFactoryBean 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