Skip to content

Instantly share code, notes, and snippets.

@ggarber
Last active August 29, 2015 13:58
Show Gist options
  • Save ggarber/10070544 to your computer and use it in GitHub Desktop.
Save ggarber/10070544 to your computer and use it in GitHub Desktop.
//Inside publisher
@Override
public void setInActive(Reason reason) {
super.setInActive(reason);
notifier.streamCreated(super.getSession(), super.getConnection(), this);
for (PublisherListener pl : this.getListeners()) {
pl.publisherDestroyed(this);
}
}
@Override
public void setActive(Reason reason) {
notifier.streamCreated(super.getSession(), super.getConnection(), this);
for (PublisherListener pl : this.getListeners()) {
pl.publisherModified(this, "active");
}
}
//Inside Session
addPublisher(publisher) {
publisher.addListener(this);
}
publisherModified(publisher, property) {
if property == active
getPublisherListeners().publisherCreated(publisher)
}
@JsonIgnore
//PublisherListener
public interface PublisherListener {
void publisherModified(....)
void publisherDestroyed(....)
}
public interface NewPublisherListener {
void publisherCreated(....)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment