public void remove() { if (_bayeux.removeServerChannel(this)) { for (ServerSession subscriber : _subscribers) ((ServerSessionImpl) subscriber).unsubscribedFrom(this); _subscribers.clear(); } _listeners.clear(); }
private boolean unsubscribe(ServerSessionImpl session) { if (_subscribers.remove(session)) { session.unsubscribedFrom(this); for (ServerChannelListener listener : _listeners) if (listener instanceof SubscriptionListener) notifyUnsubscribed((SubscriptionListener) listener, session, this); for (BayeuxServer.BayeuxServerListener listener : _bayeux.getListeners()) if (listener instanceof BayeuxServer.SubscriptionListener) notifyUnsubscribed((BayeuxServer.SubscriptionListener) listener, session, this); } return true; }