use of org.apache.cxf.jaxrs.JAXRSServerFactoryBean in project cxf by apache.
the class BookServer20 method createServer.
@Override
protected Server createServer(Bus bus) throws Exception {
JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
sf.setResourceClasses(BookStore.class);
List<Object> providers = new ArrayList<>();
providers.add(new PreMatchContainerRequestFilter2());
providers.add(new PreMatchContainerRequestFilter());
providers.add(new PostMatchContainerResponseFilter());
providers.add((Feature) context -> {
context.register(new PostMatchContainerResponseFilter3());
return true;
});
providers.add(new PostMatchContainerResponseFilter2());
providers.add(new CustomReaderBoundInterceptor());
providers.add(new CustomReaderInterceptor());
providers.add(new CustomWriterInterceptor());
providers.add(new CustomDynamicFeature());
providers.add(new PostMatchContainerRequestFilter());
providers.add(new FaultyContainerRequestFilter());
providers.add(new PreMatchReplaceStreamOrAddress());
providers.add(new ServerTestFeature());
providers.add(new JacksonJaxbJsonProvider());
providers.add(new IOExceptionMapper());
providers.add(new GregorianCalendarMessageBodyWriter());
sf.setApplication(new Application());
sf.setProviders(providers);
sf.setResourceProvider(BookStore.class, new SingletonResourceProvider(new BookStore(), true));
sf.setAddress("http://localhost:" + PORT + "/");
return sf.create();
}
use of org.apache.cxf.jaxrs.JAXRSServerFactoryBean in project cxf by apache.
the class BookServerResourceCreatedOutside method createServer.
@Override
protected Server createServer(Bus bus) throws Exception {
JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
BookStore bs = new BookStore();
sf.setServiceBean(bs);
sf.setAddress("http://localhost:" + PORT + "/");
return sf.create();
}
use of org.apache.cxf.jaxrs.JAXRSServerFactoryBean in project cxf by apache.
the class BookServerSub method createServer.
@Override
protected Server createServer(Bus bus) throws Exception {
JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
sf.setStaticSubresourceResolution(true);
sf.setResourceClasses(BookStoreSubObject.class);
sf.setResourceProvider(BookStoreSubObject.class, new SingletonResourceProvider(new BookStoreSubObject(), true));
sf.setAddress("http://localhost:" + PORT + "/");
return sf.create();
}
use of org.apache.cxf.jaxrs.JAXRSServerFactoryBean in project cxf by apache.
the class BookCxfContinuationServlet3Server method serverFactory.
private JAXRSServerFactoryBean serverFactory(Bus bus) {
JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
sf.setBus(bus);
sf.setResourceClasses(BookCxfContinuationStore.class);
sf.setResourceProvider(BookCxfContinuationStore.class, new SingletonResourceProvider(new BookCxfContinuationStore()));
sf.setAddress("/");
return sf;
}
use of org.apache.cxf.jaxrs.JAXRSServerFactoryBean in project cxf by apache.
the class BookCxfContinuationServer method createServer.
@Override
protected Server createServer(Bus bus) throws Exception {
JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
sf.setResourceClasses(BookCxfContinuationStore.class);
sf.setResourceProvider(BookCxfContinuationStore.class, new SingletonResourceProvider(new BookCxfContinuationStore()));
sf.setAddress("http://localhost:" + PORT + "/");
return sf.create();
}
Aggregations