public void onStateChange(AtmosphereResourceEvent event) throws IOException {
// Original Value
AtmosphereResourceImpl r = AtmosphereResourceImpl.class.cast(event.getResource());
AtmosphereRequest request = r.getRequest(false);
Boolean resumeOnBroadcast = r.resumeOnBroadcast();
if (!resumeOnBroadcast) {
// For legacy reason, check the attribute as well
Object o = request.getAttribute(ApplicationConfig.RESUME_ON_BROADCAST);
if (o != null && Boolean.class.isAssignableFrom(o.getClass())) {
resumeOnBroadcast = Boolean.class.cast(o);