Fixed service failed/restored msg sequence

This commit is contained in:
Richard Cordovano 2015-06-22 17:03:52 -04:00
parent faf551ce60
commit 9a8562bf65
2 changed files with 13 additions and 10 deletions

View File

@ -242,11 +242,11 @@ LocalFilesPanel.errorLabel.text=Error Label
NewCaseVisualPanel1.errorLabel.text=Error Label NewCaseVisualPanel1.errorLabel.text=Error Label
CollaborationMonitor.addingDataSourceStatus.msg={0} adding data source CollaborationMonitor.addingDataSourceStatus.msg={0} adding data source
CollaborationMonitor.analyzingDataSourceStatus.msg={0} analyzing {1} CollaborationMonitor.analyzingDataSourceStatus.msg={0} analyzing {1}
CollaborationMonitor.failedService.notify.title=Collaboration Service Failed CollaborationMonitor.failedService.notify.title={0} Collaboration Service Failed
CollaborationMonitor.failedDbService.notify.msg=Lost connection to database server CollaborationMonitor.failedDbService.notify.msg=Lost connection to database server
CollaborationMonitor.failedSolrService.notify.msg=Lost connection to keyword search server CollaborationMonitor.failedSolrService.notify.msg=Lost connection to keyword search server
CollaborationMonitor.failedMessageService.notify.msg=Lost connection to messaging server CollaborationMonitor.failedMessageService.notify.msg=Lost connection to messaging server
CollaborationMonitor.restoredService.notify.title=Collaboration Service Restored CollaborationMonitor.restoredService.notify.title={0} Collaboration Service Restored
CollaborationMonitor.restoredDbService.notify.msg=Connection to database server restored CollaborationMonitor.restoredDbService.notify.msg=Connection to database server restored
CollaborationMonitor.restoredSolrService.notify.msg=Connection to keyword search server restored CollaborationMonitor.restoredSolrService.notify.msg=Connection to keyword search server restored
CollaborationMonitor.restoredMessageService.notify.msg=Connection to messaging server restored CollaborationMonitor.restoredMessageService.notify.msg=Connection to messaging server restored

View File

@ -24,9 +24,11 @@ import java.beans.PropertyChangeListener;
import java.io.Serializable; import java.io.Serializable;
import java.net.URISyntaxException; import java.net.URISyntaxException;
import java.net.UnknownHostException; import java.net.UnknownHostException;
import java.text.SimpleDateFormat;
import java.time.Duration; import java.time.Duration;
import java.time.Instant; import java.time.Instant;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
@ -75,6 +77,7 @@ final class CollaborationMonitor {
private static final long STALE_TASKS_DETECTION_INTERVAL_MINUTES = 2; private static final long STALE_TASKS_DETECTION_INTERVAL_MINUTES = 2;
private static final long CRASH_DETECTION_INTERVAL_MINUTES = 2; private static final long CRASH_DETECTION_INTERVAL_MINUTES = 2;
private static final long EXECUTOR_TERMINATION_WAIT_SECS = 30; private static final long EXECUTOR_TERMINATION_WAIT_SECS = 30;
private static final SimpleDateFormat SERVICE_MSG_DATE_FORMAT = new SimpleDateFormat("MM/dd HH:mm:ss z");
private static final Logger logger = Logger.getLogger(CollaborationMonitor.class.getName()); private static final Logger logger = Logger.getLogger(CollaborationMonitor.class.getName());
private final String hostName; private final String hostName;
private final LocalTasksManager localTasksManager; private final LocalTasksManager localTasksManager;
@ -176,7 +179,7 @@ final class CollaborationMonitor {
eventPublisher.removeSubscriber(COLLABORATION_MONITOR_EVENT, remoteTasksManager); eventPublisher.removeSubscriber(COLLABORATION_MONITOR_EVENT, remoteTasksManager);
eventPublisher.closeRemoteEventChannel(); eventPublisher.closeRemoteEventChannel();
} }
remoteTasksManager.shutdown(); remoteTasksManager.shutdown();
} }
@ -333,7 +336,7 @@ final class CollaborationMonitor {
void shutdown() { void shutdown() {
finishAllTasks(); finishAllTasks();
} }
/** /**
* Updates the remote tasks to reflect a collaboration event received * Updates the remote tasks to reflect a collaboration event received
* from another node. * from another node.
@ -537,13 +540,13 @@ final class CollaborationMonitor {
if (!dbServerIsRunning) { if (!dbServerIsRunning) {
dbServerIsRunning = true; dbServerIsRunning = true;
logger.log(Level.INFO, "Connection to PostgreSQL server restored"); //NON-NLS logger.log(Level.INFO, "Connection to PostgreSQL server restored"); //NON-NLS
MessageNotifyUtil.Notify.info(NbBundle.getMessage(CollaborationMonitor.class, "CollaborationMonitor.restoredService.notify.title"), NbBundle.getMessage(CollaborationMonitor.class, "CollaborationMonitor.restoredDbService.notify.msg")); MessageNotifyUtil.Notify.info(NbBundle.getMessage(CollaborationMonitor.class, "CollaborationMonitor.restoredService.notify.title", SERVICE_MSG_DATE_FORMAT.format(new Date())), NbBundle.getMessage(CollaborationMonitor.class, "CollaborationMonitor.restoredDbService.notify.msg"));
} }
} else { } else {
if (dbServerIsRunning) { if (dbServerIsRunning) {
dbServerIsRunning = false; dbServerIsRunning = false;
logger.log(Level.SEVERE, "Failed to connect to PostgreSQL server"); //NON-NLS logger.log(Level.SEVERE, "Failed to connect to PostgreSQL server"); //NON-NLS
MessageNotifyUtil.Notify.error(NbBundle.getMessage(CollaborationMonitor.class, "CollaborationMonitor.failedService.notify.title"), NbBundle.getMessage(CollaborationMonitor.class, "CollaborationMonitor.failedDbService.notify.msg")); MessageNotifyUtil.Notify.error(NbBundle.getMessage(CollaborationMonitor.class, "CollaborationMonitor.failedService.notify.title", SERVICE_MSG_DATE_FORMAT.format(new Date())), NbBundle.getMessage(CollaborationMonitor.class, "CollaborationMonitor.failedDbService.notify.msg"));
} }
} }
@ -562,13 +565,13 @@ final class CollaborationMonitor {
// if (!solrServerIsRunning) { // if (!solrServerIsRunning) {
// solrServerIsRunning = true; // solrServerIsRunning = true;
// logger.log(Level.INFO, "Connection to Solr server restored"); //NON-NLS // logger.log(Level.INFO, "Connection to Solr server restored"); //NON-NLS
// MessageNotifyUtil.Notify.info(NbBundle.getMessage(CollaborationMonitor.class, "CollaborationMonitor.restoredService.notify.title"), NbBundle.getMessage(CollaborationMonitor.class, "CollaborationMonitor.restoredSolrService.notify.msg")); // MessageNotifyUtil.Notify.info(NbBundle.getMessage(CollaborationMonitor.class, "CollaborationMonitor.restoredService.notify.title", SERVICE_MSG_DATE_FORMAT.format(new Date())), NbBundle.getMessage(CollaborationMonitor.class, "CollaborationMonitor.restoredSolrService.notify.msg"));
// } // }
// } catch (SolrServerException | IOException ex) { // } catch (SolrServerException | IOException ex) {
// if (solrServerIsRunning) { // if (solrServerIsRunning) {
// solrServerIsRunning = false; // solrServerIsRunning = false;
// logger.log(Level.SEVERE, "Failed to connect to Solr server", ex); //NON-NLS // logger.log(Level.SEVERE, "Failed to connect to Solr server", ex); //NON-NLS
// MessageNotifyUtil.Notify.error(NbBundle.getMessage(CollaborationMonitor.class, "CollaborationMonitor.failedService.notify.title"), NbBundle.getMessage(CollaborationMonitor.class, "CollaborationMonitor.failedSolrService.notify.msg")); // MessageNotifyUtil.Notify.error(NbBundle.getMessage(CollaborationMonitor.class, "CollaborationMonitor.failedService.notify.title", SERVICE_MSG_DATE_FORMAT.format(new Date())), NbBundle.getMessage(CollaborationMonitor.class, "CollaborationMonitor.failedSolrService.notify.msg"));
// } // }
// } // }
// //
@ -581,13 +584,13 @@ final class CollaborationMonitor {
if (!messageServerIsRunning) { if (!messageServerIsRunning) {
messageServerIsRunning = true; messageServerIsRunning = true;
logger.log(Level.INFO, "Connection to ActiveMQ server restored"); //NON-NLS logger.log(Level.INFO, "Connection to ActiveMQ server restored"); //NON-NLS
MessageNotifyUtil.Notify.info(NbBundle.getMessage(CollaborationMonitor.class, "CollaborationMonitor.restoredService.notify.title"), NbBundle.getMessage(CollaborationMonitor.class, "CollaborationMonitor.restoredMessageService.notify.msg")); MessageNotifyUtil.Notify.info(NbBundle.getMessage(CollaborationMonitor.class, "CollaborationMonitor.restoredService.notify.title", SERVICE_MSG_DATE_FORMAT.format(new Date())), NbBundle.getMessage(CollaborationMonitor.class, "CollaborationMonitor.restoredMessageService.notify.msg"));
} }
} catch (URISyntaxException | JMSException ex) { } catch (URISyntaxException | JMSException ex) {
if (messageServerIsRunning) { if (messageServerIsRunning) {
messageServerIsRunning = false; messageServerIsRunning = false;
logger.log(Level.SEVERE, "Failed to connect to ActiveMQ server", ex); //NON-NLS logger.log(Level.SEVERE, "Failed to connect to ActiveMQ server", ex); //NON-NLS
MessageNotifyUtil.Notify.error(NbBundle.getMessage(CollaborationMonitor.class, "CollaborationMonitor.failedService.notify.title"), NbBundle.getMessage(CollaborationMonitor.class, "CollaborationMonitor.failedMessageService.notify.msg")); MessageNotifyUtil.Notify.error(NbBundle.getMessage(CollaborationMonitor.class, "CollaborationMonitor.failedService.notify.title", SERVICE_MSG_DATE_FORMAT.format(new Date())), NbBundle.getMessage(CollaborationMonitor.class, "CollaborationMonitor.failedMessageService.notify.msg"));
} }
} }
} }