Search in sources :

Example 1 with JavaScriptProtocol

use of org.atmosphere.interceptor.JavaScriptProtocol in project cxf by apache.

the class AtmosphereUtils method addInterceptors.

public static void addInterceptors(AtmosphereFramework framework, Bus bus) {
    Object ais = bus.getProperty("atmosphere.interceptors");
    // pre-install those atmosphere default interceptors before the custom interceptors.
    framework.interceptor(new CacheHeadersInterceptor()).interceptor(new HeartbeatInterceptor()).interceptor(new SSEAtmosphereInterceptor()).interceptor(new JavaScriptProtocol());
    if (ais == null || ais instanceof AtmosphereInterceptor) {
        framework.interceptor(ais == null ? new DefaultProtocolInterceptor() : (AtmosphereInterceptor) ais);
        return;
    }
    if (ais instanceof List<?>) {
        List<AtmosphereInterceptor> icps = CastUtils.cast((List<?>) ais);
        // add the custom interceptors
        for (AtmosphereInterceptor icp : icps) {
            framework.interceptor(icp);
        }
    }
}
Also used : AtmosphereInterceptor(org.atmosphere.cpr.AtmosphereInterceptor) SSEAtmosphereInterceptor(org.atmosphere.interceptor.SSEAtmosphereInterceptor) HeartbeatInterceptor(org.atmosphere.interceptor.HeartbeatInterceptor) JavaScriptProtocol(org.atmosphere.interceptor.JavaScriptProtocol) CacheHeadersInterceptor(org.atmosphere.interceptor.CacheHeadersInterceptor) SSEAtmosphereInterceptor(org.atmosphere.interceptor.SSEAtmosphereInterceptor) List(java.util.List)

Aggregations

List (java.util.List)1 AtmosphereInterceptor (org.atmosphere.cpr.AtmosphereInterceptor)1 CacheHeadersInterceptor (org.atmosphere.interceptor.CacheHeadersInterceptor)1 HeartbeatInterceptor (org.atmosphere.interceptor.HeartbeatInterceptor)1 JavaScriptProtocol (org.atmosphere.interceptor.JavaScriptProtocol)1 SSEAtmosphereInterceptor (org.atmosphere.interceptor.SSEAtmosphereInterceptor)1