Search in sources :

Example 1 with SseAtmosphereEventSinkContextProvider

use of org.apache.cxf.jaxrs.sse.atmosphere.SseAtmosphereEventSinkContextProvider in project cxf by apache.

the class SseFeature method initialize.

@Override
public void initialize(Server server, Bus bus) {
    final List<Object> providers = new ArrayList<>();
    providers.add(new SseAtmosphereEventSinkContextProvider());
    providers.add(new SseContextProvider());
    ((ServerProviderFactory) server.getEndpoint().get(ServerProviderFactory.class.getName())).setUserProviders(providers);
}
Also used : ServerProviderFactory(org.apache.cxf.jaxrs.provider.ServerProviderFactory) SseAtmosphereEventSinkContextProvider(org.apache.cxf.jaxrs.sse.atmosphere.SseAtmosphereEventSinkContextProvider) ArrayList(java.util.ArrayList)

Example 2 with SseAtmosphereEventSinkContextProvider

use of org.apache.cxf.jaxrs.sse.atmosphere.SseAtmosphereEventSinkContextProvider in project cxf by apache.

the class SseTransportCustomizationExtension method customize.

@Override
public void customize(final JAXRSServerFactoryBean bean) {
    bean.setTransportId(SseHttpTransportFactory.TRANSPORT_ID);
    bean.setProvider(new SseContextProvider());
    bean.setProvider(new SseAtmosphereEventSinkContextProvider());
    final Bus bus = bean.getBus();
    if (bus != null) {
        bus.setProperty(AbstractTransportFactory.PREFERRED_TRANSPORT_ID, SseHttpTransportFactory.TRANSPORT_ID);
    }
}
Also used : Bus(org.apache.cxf.Bus) SseAtmosphereEventSinkContextProvider(org.apache.cxf.jaxrs.sse.atmosphere.SseAtmosphereEventSinkContextProvider) SseContextProvider(org.apache.cxf.jaxrs.sse.SseContextProvider)

Aggregations

SseAtmosphereEventSinkContextProvider (org.apache.cxf.jaxrs.sse.atmosphere.SseAtmosphereEventSinkContextProvider)2 ArrayList (java.util.ArrayList)1 Bus (org.apache.cxf.Bus)1 ServerProviderFactory (org.apache.cxf.jaxrs.provider.ServerProviderFactory)1 SseContextProvider (org.apache.cxf.jaxrs.sse.SseContextProvider)1