/** * Get a store protocol object for use by a folder. */ IMAPProtocol getFolderStoreProtocol() throws ProtocolException { IMAPProtocol p = getStoreProtocol(); p.removeResponseHandler(this); p.addResponseHandler(nonStoreResponseHandler); return p; }
/** * Get a store protocol object for use by a folder. */ IMAPProtocol getFolderStoreProtocol() throws ProtocolException { IMAPProtocol p = getStoreProtocol(); p.removeResponseHandler(this); p.addResponseHandler(nonStoreResponseHandler); return p; }
/** * Empty the connection pool. */ private void emptyConnectionPool(boolean force) { synchronized (pool) { for (int index = pool.authenticatedConnections.size() - 1; index >= 0; --index) { try { IMAPProtocol p = pool.authenticatedConnections.elementAt(index); p.removeResponseHandler(this); if (force) p.disconnect(); else p.logout(); } catch (ProtocolException pex) {}; } pool.authenticatedConnections.removeAllElements(); } pool.logger.fine("removed all authenticated connections from pool"); }
/** * Release a store protocol object that was being used by a folder. */ void releaseFolderStoreProtocol(IMAPProtocol protocol) { if (protocol == null) return; // should never happen protocol.removeResponseHandler(nonStoreResponseHandler); protocol.addResponseHandler(this); synchronized (pool) { pool.storeConnectionInUse = false; pool.notifyAll(); // in case anyone waiting pool.logger.fine("releaseFolderStoreProtocol()"); timeoutConnections(); } }
/** * Empty the connection pool. */ private void emptyConnectionPool(boolean force) { synchronized (pool) { for (int index = pool.authenticatedConnections.size() - 1; index >= 0; --index) { try { IMAPProtocol p = pool.authenticatedConnections.elementAt(index); p.removeResponseHandler(this); if (force) p.disconnect(); else p.logout(); } catch (ProtocolException pex) {}; } pool.authenticatedConnections.removeAllElements(); } pool.logger.fine("removed all authenticated connections from pool"); }
/** * Release a store protocol object that was being used by a folder. */ void releaseFolderStoreProtocol(IMAPProtocol protocol) { if (protocol == null) return; // should never happen protocol.removeResponseHandler(nonStoreResponseHandler); protocol.addResponseHandler(this); synchronized (pool) { pool.storeConnectionInUse = false; pool.notifyAll(); // in case anyone waiting pool.logger.fine("releaseFolderStoreProtocol()"); timeoutConnections(); } }
/** * Release the protocol object. * * ASSERT: This method must be called only when holding the * messageCacheLock * * @param returnToPool return the protocol object to the pool? */ protected void releaseProtocol(boolean returnToPool) { if (protocol != null) { protocol.removeResponseHandler(this); if (returnToPool) ((IMAPStore)store).releaseProtocol(this, protocol); else { protocol.disconnect(); // make sure it's disconnected ((IMAPStore)store).releaseProtocol(this, null); } protocol = null; } }
/** * Release the protocol object. * * ASSERT: This method must be called only when holding the * messageCacheLock * * @param returnToPool return the protocol object to the pool? */ protected void releaseProtocol(boolean returnToPool) { if (protocol != null) { protocol.removeResponseHandler(this); if (returnToPool) ((IMAPStore)store).releaseProtocol(this, protocol); else { protocol.disconnect(); // make sure it's disconnected ((IMAPStore)store).releaseProtocol(this, null); } protocol = null; } }
"logging out the connection"); p.removeResponseHandler(this); pool.authenticatedConnections.removeElementAt(index);
"logging out the connection"); p.removeResponseHandler(this); pool.authenticatedConnections.removeElementAt(index);
p.removeResponseHandler(nonStoreResponseHandler); } catch(Exception ex1) { if (p != null) p.removeResponseHandler(this); p.addResponseHandler(nonStoreResponseHandler); p.noop(); p.removeResponseHandler(nonStoreResponseHandler); p.addResponseHandler(this); } catch (ProtocolException pex) { try { p.removeResponseHandler(nonStoreResponseHandler); p.disconnect(); } finally { p.removeResponseHandler(this); p.addResponseHandler(nonStoreResponseHandler); p.unauthenticate(); login(p, user, password); p.removeResponseHandler(nonStoreResponseHandler); p.addResponseHandler(this); } catch (ProtocolException pex) { try { p.removeResponseHandler(nonStoreResponseHandler); p.disconnect(); } finally { p.removeResponseHandler(this);
p.removeResponseHandler(nonStoreResponseHandler); } catch(Exception ex1) { if (p != null) p.removeResponseHandler(this); p.addResponseHandler(nonStoreResponseHandler); p.noop(); p.removeResponseHandler(nonStoreResponseHandler); p.addResponseHandler(this); } catch (ProtocolException pex) { try { p.removeResponseHandler(nonStoreResponseHandler); p.disconnect(); } catch (RuntimeException ignored) { p.removeResponseHandler(this); p.addResponseHandler(nonStoreResponseHandler); p.unauthenticate(); login(p, user, password); p.removeResponseHandler(nonStoreResponseHandler); p.addResponseHandler(this); } catch (ProtocolException pex) { try { p.removeResponseHandler(nonStoreResponseHandler); p.disconnect(); } catch (RuntimeException ignored) { p.removeResponseHandler(this);
protocol.addResponseHandler(nonStoreResponseHandler); login(protocol, user, password); protocol.removeResponseHandler(nonStoreResponseHandler); protocol.addResponseHandler(this);
protocol.addResponseHandler(nonStoreResponseHandler); login(protocol, user, password); protocol.removeResponseHandler(nonStoreResponseHandler); protocol.addResponseHandler(this);
/** * Get a store protocol object for use by a folder. */ IMAPProtocol getFolderStoreProtocol() throws ProtocolException { IMAPProtocol p = getStoreProtocol(); p.removeResponseHandler(this); p.addResponseHandler(nonStoreResponseHandler); return p; }
/** * Get a store protocol object for use by a folder. */ IMAPProtocol getFolderStoreProtocol() throws ProtocolException { IMAPProtocol p = getStoreProtocol(); p.removeResponseHandler(this); p.addResponseHandler(nonStoreResponseHandler); return p; }
/** * Get a store protocol object for use by a folder. */ IMAPProtocol getFolderStoreProtocol() throws ProtocolException { IMAPProtocol p = getStoreProtocol(); p.removeResponseHandler(this); p.addResponseHandler(nonStoreResponseHandler); return p; }
/** * Get a store protocol object for use by a folder. */ IMAPProtocol getFolderStoreProtocol() throws ProtocolException { IMAPProtocol p = getStoreProtocol(); p.removeResponseHandler(this); p.addResponseHandler(nonStoreResponseHandler); return p; }
/** * Get a store protocol object for use by a folder. */ IMAPProtocol getFolderStoreProtocol() throws ProtocolException { IMAPProtocol p = getStoreProtocol(); p.removeResponseHandler(this); p.addResponseHandler(nonStoreResponseHandler); return p; }
/** * Release a store protocol object that was being used by a folder. */ void releaseFolderStoreProtocol(IMAPProtocol protocol) { if (protocol == null) return; // should never happen protocol.removeResponseHandler(nonStoreResponseHandler); protocol.addResponseHandler(this); synchronized (pool) { pool.storeConnectionInUse = false; pool.notifyAll(); // in case anyone waiting pool.logger.fine("releaseFolderStoreProtocol()"); timeoutConnections(); } }