Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
("AtmosphereResourceEventListener should be invoked after the real broadcast")

See issue description
  • Loading branch information
jfarcand committed Oct 6, 2010
1 parent 8c78a93 commit cb3722a
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -119,6 +119,7 @@ public void destroy() {
broadcasterCache = null;
started.set(false);
destroyed.set(true);
BroadcasterFactory.getDefault().remove(this, name);
}

/**
Expand Down Expand Up @@ -304,9 +305,6 @@ protected void push(AtmosphereResource<?, ?> r, Object msg) {
trackBroadcastMessage(r, msg);
e = r.getAtmosphereResourceEvent();
e.setMessage(msg);
if (r instanceof AtmosphereEventLifecycle) {
((AtmosphereEventLifecycle) r).notifyListeners();
}

if (r.getAtmosphereResourceEvent() != null && !r.getAtmosphereResourceEvent().isCancelled()
&& HttpServletRequest.class.isAssignableFrom(r.getRequest().getClass())) {
Expand All @@ -322,6 +320,9 @@ protected void push(AtmosphereResource<?, ?> r, Object msg) {
}
}
broadcast(r, e);
if (r instanceof AtmosphereEventLifecycle) {
((AtmosphereEventLifecycle) r).notifyListeners();
}
}
}

Expand Down

0 comments on commit cb3722a

Please sign in to comment.