示例#1
0
 public static void closeSessions() {
   Iterator<Entry<String, Stack<SessionAndTransport>>> it = sessions.entrySet().iterator();
   Entry<String, Stack<SessionAndTransport>> entry;
   Stack<SessionAndTransport> oldStack;
   Stack<SessionAndTransport> newStack;
   while (it.hasNext()) {
     entry = it.next();
     oldStack = entry.getValue();
     if (oldStack.isEmpty()) continue;
     newStack = new Stack<SMTPConnectionPool.SessionAndTransport>();
     entry.setValue(newStack);
     closeSessions(oldStack, newStack);
   }
 }
示例#2
0
 private void doClearMailConnections() {
   SMTPConnectionPool.closeSessions();
 }