/** * Invoked if the session is closed. */ private void cleanup() { connection.removeSyncStanzaListener(this.dataPacketListener); }
@Override public void connectionClosed() { // Reset the state if the connection was cleanly closed. Note that this is not strictly necessary, // because we also reset in authenticated() if the stream got not resumed, but for maximum correctness, // also reset here. enabled_state = false; boolean removed = connection().removeSyncStanzaListener(carbonsListener); assert (removed); } @Override
/** * Remove the connection callbacks (PacketListener, PacketInterceptor, StanzaCollector) used by this MUC from the * connection. */ private void removeConnectionCallbacks() { connection.removeSyncStanzaListener(messageListener); connection.removeSyncStanzaListener(presenceListener); connection.removeSyncStanzaListener(subjectListener); connection.removeSyncStanzaListener(declinesListener); connection.removeStanzaInterceptor(presenceInterceptor); if (messageCollector != null) { messageCollector.cancel(); messageCollector = null; } }
/** * Unregister a listener for item delete events. * * @param listener The handler to unregister */ public void removeItemDeleteListener(ItemDeleteListener listener) { StanzaListener conListener = itemDeleteToListenerMap .remove(listener); if (conListener != null) pubSubManager.getConnection().removeSyncStanzaListener(conListener); }
/** * Remove the connection callbacks used by this MUC Light from the * connection. */ private void removeConnectionCallbacks() { connection.removeSyncStanzaListener(messageListener); if (messageCollector != null) { messageCollector.cancel(); messageCollector = null; } }
/** * Unregister a listener for configuration events. * * @param listener The handler to unregister */ public void removeConfigurationListener(NodeConfigListener listener) { StanzaListener conListener = configEventToListenerMap .remove(listener); if (conListener != null) pubSubManager.getConnection().removeSyncStanzaListener(conListener); }
/** * Unregister a listener for publication events. * * @param listener The handler to unregister */ public void removeItemEventListener(@SuppressWarnings("rawtypes") ItemEventListener listener) { StanzaListener conListener = itemEventToListenerMap.remove(listener); if (conListener != null) pubSubManager.getConnection().removeSyncStanzaListener(conListener); }
@Override public void connectionClosed() { // Reset the state if the connection was cleanly closed. Note that this is not strictly necessary, // because we also reset in authenticated() if the stream got not resumed, but for maximum correctness, // also reset here. enabled_state = false; boolean removed = connection().removeSyncStanzaListener(carbonsListener); assert (removed); } @Override
/** * Remove the connection callbacks used by this MUC Light from the * connection. */ private void removeConnectionCallbacks() { connection.removeSyncStanzaListener(messageListener); if (messageCollector != null) { messageCollector.cancel(); messageCollector = null; } }
protected void removeListeners() { // Remove info listener infoButton.removeActionListener(this); addToRosterButton.removeActionListener(this); SparkManager.getConnection().removeSyncStanzaListener(this); }