use of org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider in project cxf by apache.
the class LoggingServer method createServer.
@Override
protected Server createServer(Bus bus) throws Exception {
final JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
sf.setResourceClasses(BookStore.class);
sf.setResourceProvider(BookStore.class, new SingletonResourceProvider(new BookStore(), false));
sf.setAddress("http://localhost:" + PORT + "/");
sf.getFeatures().add(new LoggingFeature());
return sf.create();
}
use of org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider in project cxf by apache.
the class Server method createEndpoint.
private void createEndpoint(String address) {
JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
sf.setResourceClasses(BookStore.class);
sf.setResourceProvider(BookStore.class, new SingletonResourceProvider(new BookStore(), false));
sf.setAddress(address);
servers.add(sf.create());
}
use of org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider in project cxf by apache.
the class FormWithFilterServer method serverFactory.
private JAXRSServerFactoryBean serverFactory(Bus bus) {
JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
sf.setBus(bus);
sf.setResourceClasses(FormResource.class);
sf.setResourceProvider(FormResource.class, new SingletonResourceProvider(new FormResource()));
sf.setAddress("/");
return sf;
}
use of org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider in project cxf by apache.
the class JAXRSMultipartLocalTransportTest method startServers.
@BeforeClass
public static void startServers() throws Exception {
final JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
sf.setResourceClasses(MultipartStore.class);
sf.setResourceProvider(MultipartStore.class, new SingletonResourceProvider(new MultipartStore(), true));
sf.setAddress(ENDPOINT_ADDRESS);
server = sf.create();
}
use of org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider in project cxf by apache.
the class CompletableFutureServer method createServer.
@Override
protected Server createServer(Bus bus) throws Exception {
JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
sf.setResourceClasses(CompletableFutureService.class);
sf.setResourceProvider(CompletableFutureService.class, new SingletonResourceProvider(new CompletableFutureService(), true));
sf.setAddress("http://localhost:" + PORT + "/");
sf.setProvider(new MappedExceptionMapper());
return sf.create();
}
Aggregations