public void connectionClosed() { cancel(); }
/** * Returns a new or existing RoomListenerMultiplexor for a given connection. * * @param conn the connection to monitor for room invitations. * @return a new or existing RoomListenerMultiplexor for a given connection. */ public static RoomListenerMultiplexor getRoomMultiplexor(Connection conn) { synchronized (monitors) { if (!monitors.containsKey(conn) || monitors.get(conn).get() == null) { RoomListenerMultiplexor rm = new RoomListenerMultiplexor(conn, new RoomMultiplexFilter(), new RoomMultiplexListener()); rm.init(); // We need to use a WeakReference because the monitor references the // connection and this could prevent the GC from collecting the monitor // when no other object references the monitor monitors.put(conn, new WeakReference<RoomListenerMultiplexor>(rm)); } // Return the InvitationsMonitor that monitors the connection return monitors.get(conn).get(); } }
declinesListener); roomListenerMultiplexor = RoomListenerMultiplexor.getRoomMultiplexor(connection); roomListenerMultiplexor.addRoom(room, packetMultiplexor);
private void cleanup() { try { if (connection != null) { roomListenerMultiplexor.removeRoom(room); // Remove all the PacketListeners added to the connection by this chat for (PacketListener connectionListener : connectionListeners) { connection.removePacketListener(connectionListener); } } } catch (Exception e) { // Do nothing } }
/** * Returns a new or existing RoomListenerMultiplexor for a given connection. * * @param conn the connection to monitor for room invitations. * @return a new or existing RoomListenerMultiplexor for a given connection. */ public static RoomListenerMultiplexor getRoomMultiplexor(Connection conn) { synchronized (monitors) { if (!monitors.containsKey(conn) || monitors.get(conn).get() == null) { RoomListenerMultiplexor rm = new RoomListenerMultiplexor(conn, new RoomMultiplexFilter(), new RoomMultiplexListener()); rm.init(); // We need to use a WeakReference because the monitor references the // connection and this could prevent the GC from collecting the monitor // when no other object references the monitor monitors.put(conn, new WeakReference<RoomListenerMultiplexor>(rm)); } // Return the InvitationsMonitor that monitors the connection return monitors.get(conn).get(); } }
declinesListener); roomListenerMultiplexor = RoomListenerMultiplexor.getRoomMultiplexor(connection); roomListenerMultiplexor.addRoom(room, packetMultiplexor);
protected void finalize() throws Throwable { try { if (connection != null) { roomListenerMultiplexor.removeRoom(room); // Remove all the PacketListeners added to the connection by this chat for (PacketListener connectionListener : connectionListeners) { connection.removePacketListener(connectionListener); } } } catch (Exception e) { // Do nothing } super.finalize(); }
/** * Returns a new or existing RoomListenerMultiplexor for a given connection. * * @param conn the connection to monitor for room invitations. * @return a new or existing RoomListenerMultiplexor for a given connection. */ public static RoomListenerMultiplexor getRoomMultiplexor(Connection conn) { synchronized (monitors) { if (!monitors.containsKey(conn) || monitors.get(conn).get() == null) { RoomListenerMultiplexor rm = new RoomListenerMultiplexor(conn, new RoomMultiplexFilter(), new RoomMultiplexListener()); rm.init(); // We need to use a WeakReference because the monitor references the // connection and this could prevent the GC from collecting the monitor // when no other object references the monitor monitors.put(conn, new WeakReference<RoomListenerMultiplexor>(rm)); } // Return the InvitationsMonitor that monitors the connection return monitors.get(conn).get(); } }
declinesListener); roomListenerMultiplexor = RoomListenerMultiplexor.getRoomMultiplexor(connection); roomListenerMultiplexor.addRoom(room, packetMultiplexor);
public void connectionClosed() { cancel(); }
protected void finalize() throws Throwable { try { if (connection != null) { roomListenerMultiplexor.removeRoom(room); // Remove all the PacketListeners added to the connection by this chat for (PacketListener connectionListener : connectionListeners) { connection.removePacketListener(connectionListener); } } } catch (Exception e) { // Do nothing } super.finalize(); }
public void connectionClosedOnError(Exception e) { cancel(); }
public void connectionClosedOnError(Exception e) { cancel(); }
public void connectionClosedOnError(Exception e) { cancel(); }
public void connectionClosed() { cancel(); }