Search in sources :

Example 1 with Book

use of org.apache.cxf.customer.book.Book in project cxf by apache.

the class AbstractBookServerHttp2 method run.

protected void run() {
    SpringBusFactory factory = new SpringBusFactory();
    Bus bus = factory.createBus(context);
    bus.setProperty(HttpServerEngineSupport.ENABLE_HTTP2, true);
    setBus(bus);
    JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
    sf.setBus(bus);
    sf.setResourceClasses(BookStore.class);
    sf.setProvider(new StreamingResponseProvider<Book>());
    sf.setResourceProvider(BookStore.class, new SingletonResourceProvider(new BookStore(), true));
    sf.setAddress(scheme + "://localhost:" + port + "/http2");
    server = sf.create();
}
Also used : Bus(org.apache.cxf.Bus) SpringBusFactory(org.apache.cxf.bus.spring.SpringBusFactory) Book(org.apache.cxf.customer.book.Book) JAXRSServerFactoryBean(org.apache.cxf.jaxrs.JAXRSServerFactoryBean) SingletonResourceProvider(org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider)

Example 2 with Book

use of org.apache.cxf.customer.book.Book in project cxf by apache.

the class AbstractBookServerHttp2 method run.

protected void run() {
    SpringBusFactory factory = new SpringBusFactory();
    Bus bus = factory.createBus(context);
    bus.setProperty(HttpServerEngineSupport.ENABLE_HTTP2, true);
    setBus(bus);
    JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
    sf.setBus(bus);
    sf.setResourceClasses(BookStoreWebSocket.class, BookStorePerRequest.class);
    sf.setProvider(new StreamingResponseProvider<Book>());
    sf.setResourceProvider(BookStoreWebSocket.class, new SingletonResourceProvider(new BookStoreWebSocket(), true));
    sf.setAddress(scheme + "://localhost:" + port + "/http2");
    server = sf.create();
}
Also used : BookStoreWebSocket(org.apache.cxf.systest.http_undertow.websocket.BookStoreWebSocket) Bus(org.apache.cxf.Bus) SpringBusFactory(org.apache.cxf.bus.spring.SpringBusFactory) Book(org.apache.cxf.customer.book.Book) JAXRSServerFactoryBean(org.apache.cxf.jaxrs.JAXRSServerFactoryBean) SingletonResourceProvider(org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider)

Example 3 with Book

use of org.apache.cxf.customer.book.Book in project cxf by apache.

the class AbstractBookServerHttp2 method run.

protected void run() {
    SpringBusFactory factory = new SpringBusFactory();
    Bus bus = factory.createBus(context);
    bus.setProperty(HttpServerEngineSupport.ENABLE_HTTP2, true);
    setBus(bus);
    JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
    sf.setBus(bus);
    sf.setResourceClasses(BookStore.class);
    sf.setProvider(new StreamingResponseProvider<Book>());
    sf.setResourceProvider(BookStore.class, new SingletonResourceProvider(new BookStore(), true));
    sf.setAddress(scheme + "://localhost:" + port + "/http2");
    server = sf.create();
}
Also used : Bus(org.apache.cxf.Bus) SpringBusFactory(org.apache.cxf.bus.spring.SpringBusFactory) Book(org.apache.cxf.customer.book.Book) JAXRSServerFactoryBean(org.apache.cxf.jaxrs.JAXRSServerFactoryBean) SingletonResourceProvider(org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider)

Aggregations

Bus (org.apache.cxf.Bus)3 SpringBusFactory (org.apache.cxf.bus.spring.SpringBusFactory)3 Book (org.apache.cxf.customer.book.Book)3 JAXRSServerFactoryBean (org.apache.cxf.jaxrs.JAXRSServerFactoryBean)3 SingletonResourceProvider (org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider)3 BookStoreWebSocket (org.apache.cxf.systest.http_undertow.websocket.BookStoreWebSocket)1