1
0
mirror of https://github.com/moparisthebest/davmail synced 2025-01-14 15:08:19 -05:00

Do not shutdown connection manager on restart

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1020 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2010-04-23 14:58:44 +00:00
parent ec76698bcc
commit d1391d9ffe
2 changed files with 23 additions and 10 deletions

View File

@ -168,6 +168,24 @@ public final class DavGateway {
* Stop all listeners, shutdown connection pool and clear session cache. * Stop all listeners, shutdown connection pool and clear session cache.
*/ */
public static void stop() { public static void stop() {
DavGateway.stopServers();
// close pooled connections
DavGatewayHttpClientFacade.stop();
// clear session cache
ExchangeSessionFactory.reset();
}
/**
* Stop all listeners and clear session cache.
*/
public static void restart() {
DavGateway.stopServers();
// clear session cache
ExchangeSessionFactory.reset();
DavGateway.start();
}
private static void stopServers() {
for (AbstractServer server : SERVER_LIST) { for (AbstractServer server : SERVER_LIST) {
server.close(); server.close();
try { try {
@ -176,10 +194,6 @@ public final class DavGateway {
DavGatewayTray.warn(new BundleMessage("LOG_EXCEPTION_WAITING_SERVER_THREAD_DIE"), e); DavGatewayTray.warn(new BundleMessage("LOG_EXCEPTION_WAITING_SERVER_THREAD_DIE"), e);
} }
} }
// close pooled connections
DavGatewayHttpClientFacade.stop();
// clear session cache
ExchangeSessionFactory.reset();
} }
/** /**

View File

@ -611,8 +611,7 @@ public class SettingsFrame extends JFrame {
dispose(); dispose();
Settings.save(); Settings.save();
// restart listeners with new config // restart listeners with new config
DavGateway.stop(); DavGateway.restart();
DavGateway.start();
} }
}; };
ok.addActionListener(save); ok.addActionListener(save);