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);
}
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);
}
}
Aggregations