Omaha #3110 Permanent fix for mutable database creation.

Former-commit-id: aabc6e4fa4 [formerly 17da90e8db] [formerly 4633de4ea3] [formerly aabc6e4fa4 [formerly 17da90e8db] [formerly 4633de4ea3] [formerly b7271025f9 [formerly 4633de4ea3 [formerly a0001c9ed3d414237069f43a29dd907111c16832]]]]
Former-commit-id: b7271025f9
Former-commit-id: 22a49335df [formerly 3e5acbf168] [formerly dff7778150c988782c4a53e9f37ff7197bd54d3d [formerly f2733999de]]
Former-commit-id: 5d7d6fc51a102e81f0fa290cf5c214633a85a5aa [formerly b6b463682f]
Former-commit-id: 1f4bde25d9
This commit is contained in:
Ron Anderson 2014-05-28 10:09:12 -05:00
parent ff527b2bf4
commit fb8e1e58ce
3 changed files with 27 additions and 13 deletions

View file

@ -100,6 +100,7 @@ import com.raytheon.viz.gfe.textformatter.TextProductManager;
* 09/05/2013 2307 dgilling Use better PythonScript constructor.
* 09/16/2013 2033 dgilling Remove unused IToolController.
* 12/09/2013 2367 dgilling Instantiate ProcedureJobPool here.
* 05/22/2014 3110 randerso Attach router to edex.alerts.gfe earlier
*
* </pre>
*
@ -218,6 +219,7 @@ public class DataManager {
discriminator);
this.client = new IFPClient(VizApp.getWsId(), this);
this.router = new NotificationRouter(this.getSiteID());
NotificationManagerJob.addObserver("edex.alerts.gfe", this.router);
this.parmManager = new ParmManager(this);
GFEParmCacheInitJob cacheJob = new GFEParmCacheInitJob(this.parmManager);
@ -267,7 +269,6 @@ public class DataManager {
enableISCsend(true);
}
// this.queryString = "siteID='" + this.getSiteID() + "'";
NotificationManagerJob.addObserver("edex.alerts.gfe", this.router);
this.router.start();
this.parmOp = new ParmOp(this);

View file

@ -21,6 +21,7 @@ package com.raytheon.viz.gfe.core.internal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@ -48,6 +49,9 @@ import com.raytheon.viz.gfe.Activator;
* Jun 11, 2008 chammack Initial creation
* Sep 03, 2008 1448 chammack Implement refactored interface
* Mar 01, 2012 #346 dgilling Use identity-based ListenerLists.
* May 22, 2014 #3110 randerso Queue messages received prior to start rather
* than dropping them on the foor
*
* </pre>
*
* @author chammack
@ -64,11 +68,14 @@ public class NotificationRouter implements INotificationObserver {
private String siteID;
private List<NotificationMessage[]> messageList;
/**
* Constructor
*/
public NotificationRouter(String siteID) {
this.siteID = siteID;
this.messageList = new LinkedList<NotificationMessage[]>();
this.observers = new ListenerList(ListenerList.IDENTITY);
this.observers
.add(new AbstractGFENotificationObserver<UserMessageNotification>(
@ -173,7 +180,13 @@ public class NotificationRouter implements INotificationObserver {
* Start routing
*/
public void start() {
this.isReady = true;
synchronized (this) {
this.isReady = true;
}
for (NotificationMessage[] messages : messageList) {
notificationArrived(messages);
}
}
/**
@ -185,10 +198,16 @@ public class NotificationRouter implements INotificationObserver {
// If DataManager is not initialized yet, do not start listening
if (!isReady) {
statusHandler
.handle(Priority.VERBOSE,
"Notification messages skipped because router is not started");
return;
synchronized (this) {
if (!isReady) {
this.messageList.add(messages);
statusHandler
.handle(Priority.VERBOSE,
messages.length
+ "notification messages queued because router is not started");
return;
}
}
}
for (NotificationMessage message : messages) {

View file

@ -141,8 +141,7 @@ import com.raytheon.viz.gfe.types.MutableInteger;
* to simplify maintenance of this class.
* Changed handling of enabling/disabling Topo parm
* 04/02/2014 #2969 randerso Fix error when Toop parm is unloaded.
* 05/01/2014 #3105 dgilling Ensure mutable db gets into availableServerDatabases
* if it has to be created during ParmManager construction.
* 05/28/2014 #3110 randerso Remove #3105 changes
* </pre>
*
* @author chammack
@ -1316,11 +1315,6 @@ public class ParmManager implements IParmManager, IMessageClient {
ServerResponse<?> sr = this.dataManager.getClient()
.createNewDb(mutableDbId);
containsMutable = sr.isOkay();
if (containsMutable) {
this.availableServerDatabases.add(mutableDbId);
Collections.sort(this.availableServerDatabases);
}
}
if (containsMutable) {