synchronized public void removeSession(long sessionId) { LOG.debug("Removing session 0x" + Long.toHexString(sessionId)); SessionImpl s = sessionsById.remove(sessionId); sessionsWithTimeout.remove(sessionId); if (LOG.isTraceEnabled()) { ZooTrace.logTraceMessage(LOG, ZooTrace.SESSION_TRACE_MASK, "SessionTrackerImpl --- Removing session 0x" + Long.toHexString(sessionId)); } if (s != null) { sessionExpiryQueue.remove(s); } }
/** * De-registers the connection from the various mappings maintained * by the factory. */ public boolean removeCnxn(NIOServerCnxn cnxn) { // If the connection is not in the master list it's already been closed if (!cnxns.remove(cnxn)) { return false; } cnxnExpiryQueue.remove(cnxn); removeCnxnFromSessionMap(cnxn); InetAddress addr = cnxn.getSocketAddress(); if (addr != null) { Set<NIOServerCnxn> set = ipMap.get(addr); if (set != null) { set.remove(cnxn); // Note that we make no effort here to remove empty mappings // from ipMap. } } // unregister from JMX unregisterConnection(cnxn); return true; }