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