Merge "VLab Issue #6412 - Fixed the problem with ParameterLookup not being registered. As per Nate Jensen recommendation updated the spring configuration to depepnd-on getParameterHandlerRegistered. Also based on his recommendation removed parts from constructor and added them to the decode method that get singleton references for paramlookup and variable dictionary lookup. fixes #6412" into field_14.4.1

Former-commit-id: 6f58cd962cc7995af01b96db1210e24b63429372
This commit is contained in:
Ana Rivera 2015-02-13 19:51:48 +00:00 committed by Gerrit Code Review
commit 76b6b292cb
2 changed files with 8 additions and 17 deletions

View file

@ -8,11 +8,12 @@
<constructor-arg value="Ingest.SportLma.*" />
</bean>
<bean id="lmaDecoder" class="gov.nasa.msfc.sport.edex.plugin.lma.LmaDecoder">
<bean id="lmaDecoder" class="gov.nasa.msfc.sport.edex.plugin.lma.LmaDecoder" depends-on="getParameterHandlerRegistered">
<property name="gridCoverageLookup" ref="gridcoveragelookup"/>
<property name="levelDao" ref="sportlmalevelDao"/>
</bean>
<bean id="sportlmalevelDao" class="com.raytheon.uf.edex.plugin.level.dao.LevelDao"/>
<bean id="lmaDistRegistry" factory-bean="distributionSrv"

View file

@ -23,8 +23,6 @@ import ucar.nc2.NetcdfFile;
import ucar.nc2.Variable;
import ucar.units.SI;
import com.raytheon.edex.exception.DecoderException;
import com.raytheon.edex.plugin.AbstractDecoder;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.grid.GridRecord;
import com.raytheon.uf.common.dataplugin.level.Level;
@ -57,20 +55,6 @@ public class LmaDecoder {
/** The level dao allows looking up of the levels. */
public LevelDao levelDao;
/** The Lma Vars Dict helps to match up variables in the configuration files in the localization. This allows controls of what files to lookup
* allows looking up of the Variables and names. */
private LMAVarsDict lmaVarsDict;
/** The Param lookup allows looking up of the parameters in the database. */
private ParameterLookup paramLookup;
public LmaDecoder() throws DecoderException{
paramLookup = ParameterLookup.getInstance();
lmaVarsDict = LMAVarsDict.getInstance();
}
/**
* Decode the LMA netcdf 3 files. These files contain gridded data at 17 vertical levels. The first level is the sum of all levels.
*
@ -82,6 +66,12 @@ public class LmaDecoder {
//Create an empty records to hold the data once decoded.
GridRecord[] records = null;
/** The variable dictionary used to check which variables are supported by the ingest **/
LMAVarsDict lmaVarsDict = LMAVarsDict.getInstance();
/** The Param lookup allows looking up of the parameters in the database. */
ParameterLookup paramLookup = ParameterLookup.getInstance();
//Open the netcdf file for reading.
NetcdfFile file = NetcdfFile.open(fileInput.getAbsolutePath());
try {