1
0
mirror of https://github.com/moparisthebest/davmail synced 2025-01-13 06:28: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,20 +168,34 @@ public final class DavGateway {
* Stop all listeners, shutdown connection pool and clear session cache.
*/
public static void stop() {
for (AbstractServer server : SERVER_LIST) {
server.close();
try {
server.join();
} catch (InterruptedException e) {
DavGatewayTray.warn(new BundleMessage("LOG_EXCEPTION_WAITING_SERVER_THREAD_DIE"), e);
}
}
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) {
server.close();
try {
server.join();
} catch (InterruptedException e) {
DavGatewayTray.warn(new BundleMessage("LOG_EXCEPTION_WAITING_SERVER_THREAD_DIE"), e);
}
}
}
/**
* Get current DavMail version.
*

View File

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