Merge "Issue #1926 faster first time startup" into omaha_13.4.1
Former-commit-id:0fa51cdd62
[formerlycc04b3a123
] [formerlyb6b1582855
] [formerly00bf79cdf7
[formerlyb6b1582855
[formerly 4046ca1e317bba0fb0a7ae84d5a34149ab19aa4c]]] Former-commit-id:00bf79cdf7
Former-commit-id: 30a4908abbaa5adf9297da9cbb38a8eafffec2eb [formerly6a86ddc5a2
] Former-commit-id:fa09c7a9d7
This commit is contained in:
commit
902e120823
3 changed files with 34 additions and 16 deletions
|
@ -26,6 +26,7 @@ import org.eclipse.core.runtime.jobs.Job;
|
|||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
|
||||
import com.raytheon.uf.common.monitor.scan.config.SCANConfig;
|
||||
import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums.ScanTables;
|
||||
import com.raytheon.uf.viz.core.VizApp;
|
||||
|
||||
|
@ -76,6 +77,8 @@ public class ScanStarterJob extends Job {
|
|||
scan.setup(icao);
|
||||
}
|
||||
|
||||
SCANConfig.getInstance();
|
||||
|
||||
VizApp.runAsync(new Runnable() {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -23,8 +23,12 @@ import java.awt.Point;
|
|||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.raytheon.uf.common.localization.IPathManager;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
|
||||
import com.raytheon.uf.common.localization.LocalizationFile;
|
||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.common.monitor.data.CommonTableConfig.SortDirection;
|
||||
import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums.ScanThresholdColor;
|
||||
|
@ -42,6 +46,7 @@ import com.raytheon.uf.common.serialization.SerializationUtil;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Oct 21, 2009 3039 lvenable Initial creation
|
||||
* Apr 25, 2013 1926 njensen Improved initialization speed
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -52,12 +57,12 @@ public abstract class AbsConfigMgr {
|
|||
/**
|
||||
* Map of attribute names and SCANAttributesXML.
|
||||
*/
|
||||
HashMap<String, SCANAttributesXML> attrMap;
|
||||
protected Map<String, SCANAttributesXML> attrMap;
|
||||
|
||||
/**
|
||||
* Map of attribute names and column index.
|
||||
*/
|
||||
HashMap<String, Integer> indexMap;
|
||||
protected Map<String, Integer> indexMap;
|
||||
|
||||
/**
|
||||
* Default XML name.
|
||||
|
@ -76,7 +81,6 @@ public abstract class AbsConfigMgr {
|
|||
indexMap = new HashMap<String, Integer>();
|
||||
|
||||
init();
|
||||
createAttributeMap(getAttributes());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -109,12 +113,16 @@ public abstract class AbsConfigMgr {
|
|||
SCANAbstractXML cfgXML = null;
|
||||
|
||||
IPathManager pm = PathManagerFactory.getPathManager();
|
||||
String path = pm.getStaticFile(getFullDefaultConfigName())
|
||||
.getAbsolutePath();
|
||||
|
||||
cfgXML = (SCANAbstractXML) SerializationUtil
|
||||
.jaxbUnmarshalFromXmlFile(path.toString());
|
||||
|
||||
LocalizationFile lfile = pm.getLocalizationFile(pm.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.SITE),
|
||||
getFullDefaultConfigName());
|
||||
if (lfile == null || !lfile.exists()) {
|
||||
lfile = pm.getLocalizationFile(pm.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.BASE),
|
||||
getFullDefaultConfigName());
|
||||
}
|
||||
cfgXML = SerializationUtil.jaxbUnmarshalFromXmlFile(
|
||||
SCANAbstractXML.class, lfile.getFile());
|
||||
return cfgXML;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
@ -142,8 +150,8 @@ public abstract class AbsConfigMgr {
|
|||
IPathManager pm = PathManagerFactory.getPathManager();
|
||||
String path = pm.getStaticFile(newConfigFile).getAbsolutePath();
|
||||
|
||||
cfgXML = (SCANAbstractXML) SerializationUtil
|
||||
.jaxbUnmarshalFromXmlFile(path.toString());
|
||||
cfgXML = SerializationUtil.jaxbUnmarshalFromXmlFile(
|
||||
SCANAbstractXML.class, path.toString());
|
||||
|
||||
return cfgXML;
|
||||
} catch (Exception e) {
|
||||
|
|
|
@ -50,6 +50,7 @@ import com.raytheon.uf.common.monitor.scan.xml.SCANAttributesXML;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Oct 25, 2009 3039 lvenable Initial creation
|
||||
* Apr 25, 2013 1926 njensen synchronized instance creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -60,7 +61,7 @@ public class SCANConfig {
|
|||
/**
|
||||
* Class instance
|
||||
*/
|
||||
private static SCANConfig classInstance;
|
||||
private static volatile SCANConfig classInstance;
|
||||
|
||||
/**
|
||||
* Unwarned configuration data class.
|
||||
|
@ -242,11 +243,18 @@ public class SCANConfig {
|
|||
* @return Class instance.
|
||||
*/
|
||||
public static SCANConfig getInstance() {
|
||||
if (classInstance == null) {
|
||||
classInstance = new SCANConfig();
|
||||
SCANConfig retVal = classInstance;
|
||||
if (retVal == null) {
|
||||
synchronized (SCANConfig.class) {
|
||||
retVal = classInstance;
|
||||
if (retVal == null) {
|
||||
classInstance = new SCANConfig();
|
||||
retVal = classInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return classInstance;
|
||||
return retVal;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -261,7 +269,6 @@ public class SCANConfig {
|
|||
|
||||
cellTrendConfigMgr = new TrendSetConfigMgr("CellTrendSets.xml");
|
||||
dmdTrendConfigMgr = new TrendSetConfigMgr("DmdTrendSets.xml");
|
||||
;
|
||||
|
||||
setupTableIntFormatMap();
|
||||
setupTrendIntFormatMaps();
|
||||
|
|
Loading…
Add table
Reference in a new issue