OB_14.1.1-19 baseline
Former-commit-id:779553142c
[formerlycfa4997978
] [formerly779553142c
[formerlycfa4997978
] [formerly10b723647b
[formerly db2a591456383d8f980d33757e8c161bdcc01d3a]]] Former-commit-id:10b723647b
Former-commit-id:c41dd22ff2
[formerly64044e7ce5
] Former-commit-id:1b359c2564
This commit is contained in:
parent
f47dd3ef59
commit
f86f9f8918
145 changed files with 1766 additions and 1687 deletions
|
@ -11,6 +11,7 @@
|
||||||
# Apr 03,2012 436 randerso Converted to Python procedure to allow some
|
# Apr 03,2012 436 randerso Converted to Python procedure to allow some
|
||||||
# level of site customization
|
# level of site customization
|
||||||
# Apr 09,2012 436 randerso Merged RNK's MakeHazards_Elevation procedure
|
# Apr 09,2012 436 randerso Merged RNK's MakeHazards_Elevation procedure
|
||||||
|
# Feb 12,2014 17058 ryu Extend converter for Collections$EmptyList objects.
|
||||||
#
|
#
|
||||||
# Author: randerso
|
# Author: randerso
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
|
@ -307,6 +308,8 @@ def converter(obj):
|
||||||
objtype = obj.jclassname
|
objtype = obj.jclassname
|
||||||
if objtype == "java.util.Date":
|
if objtype == "java.util.Date":
|
||||||
retVal = AbsTime.AbsTime(obj)
|
retVal = AbsTime.AbsTime(obj)
|
||||||
|
elif objtype == "java.util.Collections$EmptyList":
|
||||||
|
retVal = []
|
||||||
elif objtype == "com.raytheon.uf.common.time.TimeRange":
|
elif objtype == "com.raytheon.uf.common.time.TimeRange":
|
||||||
retVal = TimeRange.TimeRange(obj)
|
retVal = TimeRange.TimeRange(obj)
|
||||||
return retVal
|
return retVal
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
##
|
##
|
||||||
# This software was developed and / or modified by Raytheon Company,
|
# This software was developed and / or modified by Raytheon Company,
|
||||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||||
#
|
#
|
||||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||||
# This software product contains export-restricted data whose
|
# This software product contains export-restricted data whose
|
||||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||||
# to non-U.S. persons whether in the United States or abroad requires
|
# to non-U.S. persons whether in the United States or abroad requires
|
||||||
# an export license or other authorization.
|
# an export license or other authorization.
|
||||||
#
|
#
|
||||||
# Contractor Name: Raytheon Company
|
# Contractor Name: Raytheon Company
|
||||||
# Contractor Address: 6825 Pine Street, Suite 340
|
# Contractor Address: 6825 Pine Street, Suite 340
|
||||||
# Mail Stop B8
|
# Mail Stop B8
|
||||||
# Omaha, NE 68106
|
# Omaha, NE 68106
|
||||||
# 402.291.0100
|
# 402.291.0100
|
||||||
#
|
#
|
||||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||||
# further licensing information.
|
# further licensing information.
|
||||||
##
|
##
|
||||||
|
@ -27,16 +27,25 @@
|
||||||
#
|
#
|
||||||
# Author: hansen
|
# Author: hansen
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# SOFTWARE HISTORY
|
||||||
|
#
|
||||||
|
# Date Ticket# Engineer Description
|
||||||
|
# ------------ ---------- ----------- --------------------------
|
||||||
|
# 02/12/2014 #2591 randerso Added retry when loading combinations fails
|
||||||
|
|
||||||
import string, getopt, sys, time, os, types, math
|
import string, getopt, sys, time, os, types, math
|
||||||
import ModuleAccessor
|
import ModuleAccessor
|
||||||
import Utility, logging, traceback
|
import Utility, logging, traceback
|
||||||
|
import AbsTime
|
||||||
from java.lang import ThreadDeath
|
from java.lang import ThreadDeath
|
||||||
from com.raytheon.uf.common.dataplugin.gfe.reference import ReferenceID, ReferenceData
|
from com.raytheon.uf.common.dataplugin.gfe.reference import ReferenceID, ReferenceData
|
||||||
|
|
||||||
GridLoc = None
|
GridLoc = None
|
||||||
LatLonIds = []
|
LatLonIds = []
|
||||||
|
|
||||||
|
MAX_TRIES = 2
|
||||||
|
|
||||||
# If someone imports TextFormatter and needs this instance
|
# If someone imports TextFormatter and needs this instance
|
||||||
# they should either be fixed to use the IFPImporter module
|
# they should either be fixed to use the IFPImporter module
|
||||||
# or turn this line on (which is a kludge but should make
|
# or turn this line on (which is a kludge but should make
|
||||||
|
@ -44,19 +53,19 @@ LatLonIds = []
|
||||||
#IFPImporter = IFPImporter.IFPImporter
|
#IFPImporter = IFPImporter.IFPImporter
|
||||||
|
|
||||||
class TextFormatter:
|
class TextFormatter:
|
||||||
def __init__(self, dataManager):
|
def __init__(self, dataManager):
|
||||||
# Variable for unique combinations
|
# Variable for unique combinations
|
||||||
self.__comboNumber = -1
|
self.__comboNumber = -1
|
||||||
self.dataMgr = dataManager
|
self.dataMgr = dataManager
|
||||||
self.log = logging.getLogger("FormatterRunner.TextFormatter.TextFormatter")
|
self.log = logging.getLogger("FormatterRunner.TextFormatter.TextFormatter")
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# def __del__(self):
|
# def __del__(self):
|
||||||
# for i in LatLonIds:
|
# for i in LatLonIds:
|
||||||
# self.dataMgr.getRefManager().deleteRefSet(i, False)
|
# self.dataMgr.getRefManager().deleteRefSet(i, False)
|
||||||
|
|
||||||
def getForecast(self, fcstName, argDict):
|
def getForecast(self, fcstName, argDict):
|
||||||
" Create the forecast "
|
" Create the forecast "
|
||||||
|
|
||||||
ForecastNarrative = argDict["ForecastNarrative"]
|
ForecastNarrative = argDict["ForecastNarrative"]
|
||||||
ForecastTable = argDict["ForecastTable"]
|
ForecastTable = argDict["ForecastTable"]
|
||||||
|
@ -71,7 +80,7 @@ class TextFormatter:
|
||||||
argDict["getForecast"] = self.getForecast
|
argDict["getForecast"] = self.getForecast
|
||||||
argDict["getFcstDef"] = self.getFcstDef
|
argDict["getFcstDef"] = self.getFcstDef
|
||||||
argDict["dataMgr"] = self.dataMgr
|
argDict["dataMgr"] = self.dataMgr
|
||||||
self.__ut = argDict["utility"]
|
self.__ut = argDict["utility"]
|
||||||
|
|
||||||
# Get the Forecast Definition and type from the server
|
# Get the Forecast Definition and type from the server
|
||||||
#print "finding", fcstName
|
#print "finding", fcstName
|
||||||
|
@ -79,11 +88,11 @@ class TextFormatter:
|
||||||
#print "found ", found
|
#print "found ", found
|
||||||
if found == 0:
|
if found == 0:
|
||||||
text = "Text Product Definition Not Found: " + fcstName + " " + \
|
text = "Text Product Definition Not Found: " + fcstName + " " + \
|
||||||
traceback.format_exc()
|
traceback.format_exc()
|
||||||
self.log.error("Text Product Definition Not Found: Caught Exception: " + fcstName, exc_info=True)
|
self.log.error("Text Product Definition Not Found: Caught Exception: " + fcstName, exc_info=True)
|
||||||
raise Exception, text
|
raise Exception, text
|
||||||
forecastDef = argDict["forecastDef"]
|
forecastDef = argDict["forecastDef"]
|
||||||
fcstType = self.__ut.set(forecastDef,"type",None)
|
fcstType = self.__ut.set(forecastDef, "type", None)
|
||||||
argDict["fcstType"] = fcstType
|
argDict["fcstType"] = fcstType
|
||||||
if fcstType is None:
|
if fcstType is None:
|
||||||
text = "Text Product Type Not Found: " + fcstName + " " + \
|
text = "Text Product Type Not Found: " + fcstName + " " + \
|
||||||
|
@ -101,16 +110,16 @@ class TextFormatter:
|
||||||
# Must have at least one edit area and time range specified
|
# Must have at least one edit area and time range specified
|
||||||
if fcstType != "smart" and fcstType != "component":
|
if fcstType != "smart" and fcstType != "component":
|
||||||
if argDict["editAreas"] == []:
|
if argDict["editAreas"] == []:
|
||||||
text= "No Edit Areas Specified over which to generate product."
|
text = "No Edit Areas Specified over which to generate product."
|
||||||
text=text+'\nTry setting "defaultEditAreas" in the product Definition'
|
text = text + '\nTry setting "defaultEditAreas" in the product Definition'
|
||||||
text=text+'\nOr, if running from the command line, add a -r flag.'
|
text = text + '\nOr, if running from the command line, add a -r flag.'
|
||||||
text = text + '\n' + string.join(traceback.format_exc())
|
text = text + '\n' + string.join(traceback.format_exc())
|
||||||
self.log.error("Caught Exception: " + text)
|
self.log.error("Caught Exception: " + text)
|
||||||
raise Exception, text
|
raise Exception, text
|
||||||
if argDict["rawRanges"] == []:
|
if argDict["rawRanges"] == []:
|
||||||
text= "No Time Ranges Specified over which to generate product."
|
text = "No Time Ranges Specified over which to generate product."
|
||||||
text=text+'\nTry setting "defaultRanges" in the product Definition'
|
text = text + '\nTry setting "defaultRanges" in the product Definition'
|
||||||
text=text+'\nOr, if running from the command line, add a -w flag.'
|
text = text + '\nOr, if running from the command line, add a -w flag.'
|
||||||
text = text + '\n' + string.join(traceback.format_exc())
|
text = text + '\n' + string.join(traceback.format_exc())
|
||||||
self.log.error("Caught Exception: " + text)
|
self.log.error("Caught Exception: " + text)
|
||||||
raise Exception, text
|
raise Exception, text
|
||||||
|
@ -153,7 +162,7 @@ class TextFormatter:
|
||||||
argDict["module"] = module
|
argDict["module"] = module
|
||||||
product.setUp("T", argDict)
|
product.setUp("T", argDict)
|
||||||
product._argDict = argDict
|
product._argDict = argDict
|
||||||
|
|
||||||
try:
|
try:
|
||||||
text = product.generateForecast(argDict)
|
text = product.generateForecast(argDict)
|
||||||
except RuntimeError, e:
|
except RuntimeError, e:
|
||||||
|
@ -166,11 +175,11 @@ class TextFormatter:
|
||||||
|
|
||||||
# requirement for TEST phrasing for TEST products
|
# requirement for TEST phrasing for TEST products
|
||||||
if argDict.get('testMode', 0):
|
if argDict.get('testMode', 0):
|
||||||
testMsg = "\nTHIS IS A TEST MESSAGE. DO NOT TAKE ACTION" +\
|
testMsg = "\nTHIS IS A TEST MESSAGE. DO NOT TAKE ACTION" + \
|
||||||
" BASED ON THIS TEST\nMESSAGE.\n"
|
" BASED ON THIS TEST\nMESSAGE.\n"
|
||||||
#split by "$$"
|
#split by "$$"
|
||||||
segs = text.split('\n$$')
|
segs = text.split('\n$$')
|
||||||
for i in xrange(len(segs)-1): #never the last one
|
for i in xrange(len(segs) - 1): #never the last one
|
||||||
if text.find(testMsg) == -1: #not found, add it in
|
if text.find(testMsg) == -1: #not found, add it in
|
||||||
segs[i] = segs[i] + testMsg
|
segs[i] = segs[i] + testMsg
|
||||||
text = '\n$$'.join(segs) #put text back together again
|
text = '\n$$'.join(segs) #put text back together again
|
||||||
|
@ -185,7 +194,7 @@ class TextFormatter:
|
||||||
if not forecastDef.get('lowerCase', 0):
|
if not forecastDef.get('lowerCase', 0):
|
||||||
text = text.upper()
|
text = text.upper()
|
||||||
else:
|
else:
|
||||||
text="Text Product Type Invalid "+\
|
text = "Text Product Type Invalid " + \
|
||||||
"(must be 'table', 'component' or 'narrative'): ", fcstName, type
|
"(must be 'table', 'component' or 'narrative'): ", fcstName, type
|
||||||
text = text + '\n' + string.join(traceback.format_exc())
|
text = text + '\n' + string.join(traceback.format_exc())
|
||||||
self.log.error("Caught Exception: " + text)
|
self.log.error("Caught Exception: " + text)
|
||||||
|
@ -196,18 +205,18 @@ class TextFormatter:
|
||||||
def __createNarrativeDef(self, fcstName, timeRange):
|
def __createNarrativeDef(self, fcstName, timeRange):
|
||||||
return {
|
return {
|
||||||
"methodList": [self.assembleChildWords],
|
"methodList": [self.assembleChildWords],
|
||||||
"narrativeDef": [(fcstName, timeRange.duration()/3600)],
|
"narrativeDef": [(fcstName, timeRange.duration() / 3600)],
|
||||||
}
|
}
|
||||||
|
|
||||||
def __loop(self, argDict, forecast, forecastDef):
|
def __loop(self, argDict, forecast, forecastDef):
|
||||||
# Loop through product by edit areas and time ranges
|
# Loop through product by edit areas and time ranges
|
||||||
|
|
||||||
begText = self.__ut.set(forecastDef,"beginningText","")
|
begText = self.__ut.set(forecastDef, "beginningText", "")
|
||||||
endText = self.__ut.set(forecastDef,"endingText","")
|
endText = self.__ut.set(forecastDef, "endingText", "")
|
||||||
editAreaLoopBegText = self.__ut.set(forecastDef,"editAreaLoopBegText","")
|
editAreaLoopBegText = self.__ut.set(forecastDef, "editAreaLoopBegText", "")
|
||||||
timeRangeLoopBegText = self.__ut.set(forecastDef,"timeRangeLoopBegText","")
|
timeRangeLoopBegText = self.__ut.set(forecastDef, "timeRangeLoopBegText", "")
|
||||||
editAreaLoopEndText = self.__ut.set(forecastDef,"editAreaLoopEndText","")
|
editAreaLoopEndText = self.__ut.set(forecastDef, "editAreaLoopEndText", "")
|
||||||
timeRangeLoopEndText = self.__ut.set(forecastDef,"timeRangeLoopEndText","")
|
timeRangeLoopEndText = self.__ut.set(forecastDef, "timeRangeLoopEndText", "")
|
||||||
outerLoop = self.__ut.set(forecastDef, "outerLoop", "EditArea")
|
outerLoop = self.__ut.set(forecastDef, "outerLoop", "EditArea")
|
||||||
|
|
||||||
editAreas = argDict["editAreas"]
|
editAreas = argDict["editAreas"]
|
||||||
|
@ -274,10 +283,10 @@ class TextFormatter:
|
||||||
#print "varDict", varDict
|
#print "varDict", varDict
|
||||||
|
|
||||||
for item, default in [
|
for item, default in [
|
||||||
("language","english"),
|
("language", "english"),
|
||||||
("appendFile",None),
|
("appendFile", None),
|
||||||
("lineLength",69), # no command line option
|
("lineLength", 69), # no command line option
|
||||||
("timePeriod",3),
|
("timePeriod", 3),
|
||||||
]:
|
]:
|
||||||
try: # Try the varDict
|
try: # Try the varDict
|
||||||
#print "trying varDict", item
|
#print "trying varDict", item
|
||||||
|
@ -362,19 +371,28 @@ class TextFormatter:
|
||||||
# (["Zones37","Zones38"], "/37/38"),"/37/38"),
|
# (["Zones37","Zones38"], "/37/38"),"/37/38"),
|
||||||
# (["Zones57","Zones58","Zones59"],"57/58/59")
|
# (["Zones57","Zones58","Zones59"],"57/58/59")
|
||||||
# ]
|
# ]
|
||||||
|
|
||||||
# RWA-05/19/11: added this check here to force Combinations files
|
comboName = dfEditAreas
|
||||||
# to be reloaded since we removed a similar check from ModuleAccessor
|
for retryCount in xrange(MAX_TRIES):
|
||||||
# to preserve the magicCodeChanges. Perhaps we should be doing something
|
accessor = ModuleAccessor.ModuleAccessor()
|
||||||
# similar to magicCodeChanges for Combinations files as well.
|
dfEditAreas = accessor.variable(comboName, "Combinations")
|
||||||
if sys.modules.has_key(dfEditAreas):
|
if dfEditAreas is None:
|
||||||
del sys.modules[dfEditAreas]
|
if sys.modules.has_key(comboName):
|
||||||
|
comboMod = sys.modules[comboName]
|
||||||
accessor = ModuleAccessor.ModuleAccessor()
|
if comboMod.__file__.endswith(".pyo"):
|
||||||
dfEditAreas = accessor.variable(dfEditAreas, "Combinations")
|
os.remove(comboMod.__file__)
|
||||||
if dfEditAreas is None:
|
comboMod = None
|
||||||
return "COMBINATION FILE NOT FOUND: " + \
|
del sys.modules[comboName]
|
||||||
self.__ut.set(forecastDef, "defaultEditAreas", [])
|
|
||||||
|
# if not last try, log and try again
|
||||||
|
if retryCount < MAX_TRIES - 1:
|
||||||
|
# log but don't pop up
|
||||||
|
self.log.error("Error loading combinations file: %s, retrying", comboName)
|
||||||
|
else:
|
||||||
|
return "COMBINATION FILE NOT FOUND: " + \
|
||||||
|
self.__ut.set(forecastDef, "defaultEditAreas", [])
|
||||||
|
else:
|
||||||
|
break
|
||||||
|
|
||||||
elif len(dfEditAreas) > 0:
|
elif len(dfEditAreas) > 0:
|
||||||
refDataList = []
|
refDataList = []
|
||||||
|
@ -411,7 +429,7 @@ class TextFormatter:
|
||||||
filterMethod = product.filterMethod
|
filterMethod = product.filterMethod
|
||||||
except:
|
except:
|
||||||
allowedHazards = None
|
allowedHazards = None
|
||||||
|
|
||||||
if allowedHazards is not None and allowedHazards != []:
|
if allowedHazards is not None and allowedHazards != []:
|
||||||
# Set up editAreas as a list of combinations
|
# Set up editAreas as a list of combinations
|
||||||
# Cases:
|
# Cases:
|
||||||
|
@ -440,7 +458,7 @@ class TextFormatter:
|
||||||
"AreaDictionary")
|
"AreaDictionary")
|
||||||
editAreas = self._separateByTimeZone(editAreas,
|
editAreas = self._separateByTimeZone(editAreas,
|
||||||
areaDictName, argDict['creationTime'],
|
areaDictName, argDict['creationTime'],
|
||||||
effectiveTZ = separateByTZ)
|
effectiveTZ=separateByTZ)
|
||||||
|
|
||||||
accurateCities = product.Definition.get('accurateCities', 0)
|
accurateCities = product.Definition.get('accurateCities', 0)
|
||||||
cityRefData = []
|
cityRefData = []
|
||||||
|
@ -464,7 +482,7 @@ class TextFormatter:
|
||||||
"contain entry for edit area: "
|
"contain entry for edit area: "
|
||||||
self.log.error(msg + `ean`)
|
self.log.error(msg + `ean`)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
for city, llrec in citydict[ean].iteritems():
|
for city, llrec in citydict[ean].iteritems():
|
||||||
# Create a referenceData given lat, lon, dim
|
# Create a referenceData given lat, lon, dim
|
||||||
area = (llrec[0], llrec[1], 0)
|
area = (llrec[0], llrec[1], 0)
|
||||||
|
@ -490,8 +508,8 @@ class TextFormatter:
|
||||||
filterMethod, argDict["databaseID"], stationID4,
|
filterMethod, argDict["databaseID"], stationID4,
|
||||||
argDict["vtecActiveTable"], argDict["vtecMode"],
|
argDict["vtecActiveTable"], argDict["vtecMode"],
|
||||||
sampleThreshold, creationTime=argDict["creationTime"], dataMgr=self.dataMgr,
|
sampleThreshold, creationTime=argDict["creationTime"], dataMgr=self.dataMgr,
|
||||||
accurateCities=accurateCities,
|
accurateCities=accurateCities,
|
||||||
cityEditAreas=cityRefData)
|
cityEditAreas=cityRefData)
|
||||||
|
|
||||||
# Store hazards object for later use
|
# Store hazards object for later use
|
||||||
argDict["hazards"] = hazards
|
argDict["hazards"] = hazards
|
||||||
|
@ -540,7 +558,7 @@ class TextFormatter:
|
||||||
except:
|
except:
|
||||||
trName = ""
|
trName = ""
|
||||||
if tr is not None:
|
if tr is not None:
|
||||||
rawRanges.append((tr,trName))
|
rawRanges.append((tr, trName))
|
||||||
elif len(dfRanges) == 0:
|
elif len(dfRanges) == 0:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
@ -548,13 +566,13 @@ class TextFormatter:
|
||||||
forecast = TimeRangeUtils.TimeRangeUtils()
|
forecast = TimeRangeUtils.TimeRangeUtils()
|
||||||
for rangeName in dfRanges:
|
for rangeName in dfRanges:
|
||||||
rawRange = forecast.getTimeRange(rangeName, argDict)
|
rawRange = forecast.getTimeRange(rangeName, argDict)
|
||||||
rawRanges.append((rawRange,rangeName))
|
rawRanges.append((rawRange, rangeName))
|
||||||
argDict["rawRanges"] = rawRanges
|
argDict["rawRanges"] = rawRanges
|
||||||
#print "rawRanges", rawRanges
|
#print "rawRanges", rawRanges
|
||||||
|
|
||||||
# Row Label
|
# Row Label
|
||||||
areaType = self.__ut.set(forecastDef,"areaType","")
|
areaType = self.__ut.set(forecastDef, "areaType", "")
|
||||||
rowVariable = self.__ut.set(forecastDef,"rowVariable","EditArea")
|
rowVariable = self.__ut.set(forecastDef, "rowVariable", "EditArea")
|
||||||
if rowVariable == "EditArea":
|
if rowVariable == "EditArea":
|
||||||
rowLabel = areaType
|
rowLabel = areaType
|
||||||
elif rowVariable == "WeatherElement":
|
elif rowVariable == "WeatherElement":
|
||||||
|
@ -566,7 +584,7 @@ class TextFormatter:
|
||||||
def __pairAreaWithLabel(self, chosenAreas, defaultEditAreas):
|
def __pairAreaWithLabel(self, chosenAreas, defaultEditAreas):
|
||||||
# Pair the chosen edit areas with associated labels from
|
# Pair the chosen edit areas with associated labels from
|
||||||
# default list and return new list
|
# default list and return new list
|
||||||
dfEditAreas= []
|
dfEditAreas = []
|
||||||
for area in chosenAreas:
|
for area in chosenAreas:
|
||||||
for name, label in defaultEditAreas:
|
for name, label in defaultEditAreas:
|
||||||
if area == name:
|
if area == name:
|
||||||
|
@ -620,8 +638,8 @@ class TextFormatter:
|
||||||
def __getLatLonAreaName(self, latLonTuple):
|
def __getLatLonAreaName(self, latLonTuple):
|
||||||
lat, lon, dim = latLonTuple
|
lat, lon, dim = latLonTuple
|
||||||
name = "Ref" + '%s%s%s' % (lat, lon, dim)
|
name = "Ref" + '%s%s%s' % (lat, lon, dim)
|
||||||
name = name.replace(".","")
|
name = name.replace(".", "")
|
||||||
name = name.replace("-","")
|
name = name.replace("-", "")
|
||||||
return name
|
return name
|
||||||
|
|
||||||
def getCombinations(self, combinations, argDict):
|
def getCombinations(self, combinations, argDict):
|
||||||
|
@ -635,7 +653,7 @@ class TextFormatter:
|
||||||
newArea = self.getEditArea(editArea, argDict)
|
newArea = self.getEditArea(editArea, argDict)
|
||||||
if comboList.index(editArea) == 0:
|
if comboList.index(editArea) == 0:
|
||||||
comboNumber = self.getComboNumber()
|
comboNumber = self.getComboNumber()
|
||||||
label = "Combo"+`comboNumber`
|
label = "Combo" + `comboNumber`
|
||||||
refId = ReferenceID(label)
|
refId = ReferenceID(label)
|
||||||
#global GridLoc
|
#global GridLoc
|
||||||
#GridLoc = newArea.getGloc()
|
#GridLoc = newArea.getGloc()
|
||||||
|
@ -680,7 +698,7 @@ class TextFormatter:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
product = argDict["self"]
|
product = argDict["self"]
|
||||||
exec "fcstDef = product."+fcstName+"()"
|
exec "fcstDef = product." + fcstName + "()"
|
||||||
module = argDict["module"]
|
module = argDict["module"]
|
||||||
except:
|
except:
|
||||||
# See if fcstName is variable in imported modules e.g. MyTable = {}
|
# See if fcstName is variable in imported modules e.g. MyTable = {}
|
||||||
|
@ -699,7 +717,7 @@ class TextFormatter:
|
||||||
try:
|
try:
|
||||||
# Look for fcstName = {}
|
# Look for fcstName = {}
|
||||||
# This can be removed eventually
|
# This can be removed eventually
|
||||||
exec "fcstDef = module."+fcstName
|
exec "fcstDef = module." + fcstName
|
||||||
except:
|
except:
|
||||||
try:
|
try:
|
||||||
# Try to instantiate smart text product class
|
# Try to instantiate smart text product class
|
||||||
|
@ -750,7 +768,7 @@ class TextFormatter:
|
||||||
|
|
||||||
def getEditArea(self, editAreaName, argDict):
|
def getEditArea(self, editAreaName, argDict):
|
||||||
# Returns an AFPS.ReferenceData object given an edit area name
|
# Returns an AFPS.ReferenceData object given an edit area name
|
||||||
# as defined in the GFE
|
# as defined in the GFE
|
||||||
# Apply suffix if appropriate
|
# Apply suffix if appropriate
|
||||||
refID = ReferenceID(editAreaName)
|
refID = ReferenceID(editAreaName)
|
||||||
#print "Getting edit area"
|
#print "Getting edit area"
|
||||||
|
@ -779,7 +797,7 @@ class TextFormatter:
|
||||||
return tmp
|
return tmp
|
||||||
|
|
||||||
def _separateByTimeZone(self, editAreaGroups, areaDictName, creationTime,
|
def _separateByTimeZone(self, editAreaGroups, areaDictName, creationTime,
|
||||||
effectiveTZ = "effectiveTZ"):
|
effectiveTZ="effectiveTZ"):
|
||||||
#takes the list of areas, and based on the time zones breaks
|
#takes the list of areas, and based on the time zones breaks
|
||||||
#them up to ensure that each grouping using the same time zone.
|
#them up to ensure that each grouping using the same time zone.
|
||||||
#areaDictName is name of the area dictionary. creationTime is the
|
#areaDictName is name of the area dictionary. creationTime is the
|
||||||
|
@ -817,7 +835,7 @@ class TextFormatter:
|
||||||
zoneTZ = localTZ
|
zoneTZ = localTZ
|
||||||
tzid = localTZid
|
tzid = localTZid
|
||||||
#print "falling back to WFOtz: ", zoneTZ
|
#print "falling back to WFOtz: ", zoneTZ
|
||||||
self.log.warning("WARNING: Entry " + area +
|
self.log.warning("WARNING: Entry " + area +
|
||||||
" missing from AreaDictionary. Using default time zone.")
|
" missing from AreaDictionary. Using default time zone.")
|
||||||
|
|
||||||
zones = tzDir.get(zoneTZ, [])
|
zones = tzDir.get(zoneTZ, [])
|
||||||
|
@ -835,7 +853,7 @@ class TextFormatter:
|
||||||
elif effectiveTZ == "actualTZ":
|
elif effectiveTZ == "actualTZ":
|
||||||
dict = tzDir
|
dict = tzDir
|
||||||
else:
|
else:
|
||||||
self.log.error("Invalid effectiveTZ for separateByTZ() " +
|
self.log.error("Invalid effectiveTZ for separateByTZ() " +
|
||||||
effectiveTZ)
|
effectiveTZ)
|
||||||
return editAreaGroups
|
return editAreaGroups
|
||||||
keys = dict.keys()
|
keys = dict.keys()
|
||||||
|
@ -850,39 +868,39 @@ class TextFormatter:
|
||||||
#################################################################
|
#################################################################
|
||||||
def makeSquare(lat, lon, km):
|
def makeSquare(lat, lon, km):
|
||||||
" Make a list of square of given km around lat,lon"
|
" Make a list of square of given km around lat,lon"
|
||||||
latinc = km/222.0
|
latinc = km / 222.0
|
||||||
loninc = math.cos(lat/57.17) * km / 222.0
|
loninc = math.cos(lat / 57.17) * km / 222.0
|
||||||
|
|
||||||
latTop = lat + latinc
|
latTop = lat + latinc
|
||||||
latBottom =lat - latinc
|
latBottom = lat - latinc
|
||||||
lonLeft = lon - loninc
|
lonLeft = lon - loninc
|
||||||
lonRight = lon + loninc
|
lonRight = lon + loninc
|
||||||
|
|
||||||
points = []
|
points = []
|
||||||
points.append(`latTop`+","+ `lonRight`)
|
points.append(`latTop` + "," + `lonRight`)
|
||||||
points.append(`latTop`+","+ `lonLeft`)
|
points.append(`latTop` + "," + `lonLeft`)
|
||||||
points.append(`latBottom`+","+ `lonLeft`)
|
points.append(`latBottom` + "," + `lonLeft`)
|
||||||
points.append(`latBottom`+","+`lonRight`)
|
points.append(`latBottom` + "," + `lonRight`)
|
||||||
return points
|
return points
|
||||||
|
|
||||||
def makePoint(point):
|
def makePoint(point):
|
||||||
" Make a CartCoord2D from the point in format: x,y"
|
" Make a CartCoord2D from the point in format: x,y"
|
||||||
from com.vividsolutions.jts.geom import Coordinate
|
from com.vividsolutions.jts.geom import Coordinate
|
||||||
ind = string.find(point,",")
|
ind = string.find(point, ",")
|
||||||
latStr = point[0:ind-1]
|
latStr = point[0:ind - 1]
|
||||||
lonStr = point[ind+1:len(point)]
|
lonStr = point[ind + 1:len(point)]
|
||||||
lat = float(latStr)
|
lat = float(latStr)
|
||||||
lon = float(lonStr)
|
lon = float(lonStr)
|
||||||
return Coordinate(lon,lat)
|
return Coordinate(lon, lat)
|
||||||
|
|
||||||
def makeArea(gridLoc, pointList, refname=None):
|
def makeArea(gridLoc, pointList, refname=None):
|
||||||
" Make a Reference Area with a unique ReferenceID"
|
" Make a Reference Area with a unique ReferenceID"
|
||||||
from com.vividsolutions.jts.geom import GeometryFactory, LinearRing, Coordinate, Polygon
|
from com.vividsolutions.jts.geom import GeometryFactory, LinearRing, Coordinate, Polygon
|
||||||
from com.raytheon.uf.common.dataplugin.gfe.reference import ReferenceData_CoordinateType as CoordinateType
|
from com.raytheon.uf.common.dataplugin.gfe.reference import ReferenceData_CoordinateType as CoordinateType
|
||||||
geomFactory = GeometryFactory()
|
geomFactory = GeometryFactory()
|
||||||
import jep
|
import jep
|
||||||
size = len(pointList)
|
size = len(pointList)
|
||||||
if pointList[0] != pointList[size-1]: # closing the loop
|
if pointList[0] != pointList[size - 1]: # closing the loop
|
||||||
pointList.append(pointList[0])
|
pointList.append(pointList[0])
|
||||||
pointArray = jep.jarray(len(pointList), Coordinate)
|
pointArray = jep.jarray(len(pointList), Coordinate)
|
||||||
for i in range(len(pointList)):
|
for i in range(len(pointList)):
|
||||||
|
@ -893,7 +911,7 @@ def makeArea(gridLoc, pointList, refname=None):
|
||||||
polyArray[0] = poly
|
polyArray[0] = poly
|
||||||
region = geomFactory.createMultiPolygon(polyArray)
|
region = geomFactory.createMultiPolygon(polyArray)
|
||||||
if refname is None:
|
if refname is None:
|
||||||
refname = "Ref" + getTime()
|
refname = "Ref" + getTime()
|
||||||
refId = ReferenceID(refname)
|
refId = ReferenceID(refname)
|
||||||
refData = ReferenceData(gridLoc, refId, region, CoordinateType.LATLON)
|
refData = ReferenceData(gridLoc, refId, region, CoordinateType.LATLON)
|
||||||
# randerso: I don't think this is necessary
|
# randerso: I don't think this is necessary
|
||||||
|
@ -913,8 +931,8 @@ def storeReferenceData(refSetMgr, refData, temp=True):
|
||||||
|
|
||||||
def getTime():
|
def getTime():
|
||||||
"Return an ascii string for the current time without spaces or :'s"
|
"Return an ascii string for the current time without spaces or :'s"
|
||||||
timeStr = `time.time()`
|
timeStr = `time.time()`
|
||||||
timeStr = string.replace(timeStr,".","_")
|
timeStr = string.replace(timeStr, ".", "_")
|
||||||
return timeStr
|
return timeStr
|
||||||
|
|
||||||
def getAbsTime(timeStr):
|
def getAbsTime(timeStr):
|
||||||
|
@ -926,7 +944,7 @@ def getAbsTime(timeStr):
|
||||||
hour = string.atoi(timeStr[9:11])
|
hour = string.atoi(timeStr[9:11])
|
||||||
minute = string.atoi(timeStr[11:13])
|
minute = string.atoi(timeStr[11:13])
|
||||||
|
|
||||||
return AFPSSup.AbsTimeYMD(year,month,day,hour,minute)
|
return AbsTime.absTimeYMD(year, month, day, hour, minute)
|
||||||
|
|
||||||
def usage():
|
def usage():
|
||||||
print """
|
print """
|
||||||
|
|
|
@ -294,7 +294,7 @@ function logExitStatus()
|
||||||
hostPath="$basePath/$hostName/"
|
hostPath="$basePath/$hostName/"
|
||||||
mkdir -p $hostPath
|
mkdir -p $hostPath
|
||||||
if [ -d "$hostPath" ]; then
|
if [ -d "$hostPath" ]; then
|
||||||
cp $coreFile $hostPath
|
mv $coreFile $hostPath
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,8 @@ import com.raytheon.uf.viz.core.notification.NotificationMessage;
|
||||||
* 05/08/08 1127 randerso Initial Creation
|
* 05/08/08 1127 randerso Initial Creation
|
||||||
* 09/03/08 1448 chammack Refactored notification observer interface
|
* 09/03/08 1448 chammack Refactored notification observer interface
|
||||||
* 04/23/13 1939 randerso Add separate connect method to allow application
|
* 04/23/13 1939 randerso Add separate connect method to allow application
|
||||||
* to complete initialization before connecting to JMS
|
* to complete initialization before connecting to JMS.
|
||||||
|
* 10/15/2013 2389 rjpeter Updated synchronization to remove session leaks.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author randerso
|
* @author randerso
|
||||||
|
@ -107,9 +108,10 @@ public class NotificationManagerJob implements ExceptionListener, IDisposable {
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
int result = 1;
|
int result = 1;
|
||||||
result = prime * result
|
result = (prime * result)
|
||||||
+ ((queryString == null) ? 0 : queryString.hashCode());
|
+ ((queryString == null) ? 0 : queryString.hashCode());
|
||||||
result = prime * result + ((topic == null) ? 0 : topic.hashCode());
|
result = (prime * result)
|
||||||
|
+ ((topic == null) ? 0 : topic.hashCode());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,11 +158,11 @@ public class NotificationManagerJob implements ExceptionListener, IDisposable {
|
||||||
private static NotificationManagerJob instance;
|
private static NotificationManagerJob instance;
|
||||||
|
|
||||||
/** The observer map of topic to listeners */
|
/** The observer map of topic to listeners */
|
||||||
protected Map<ListenerKey, NotificationListener> listeners;
|
protected final Map<ListenerKey, NotificationListener> listeners;
|
||||||
|
|
||||||
private Connection connection;
|
private Connection connection;
|
||||||
|
|
||||||
private boolean connected = false;
|
private volatile boolean connected = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the active subscription manager job. If one does not exist, start an
|
* Get the active subscription manager job. If one does not exist, start an
|
||||||
|
@ -191,18 +193,29 @@ public class NotificationManagerJob implements ExceptionListener, IDisposable {
|
||||||
|
|
||||||
protected void connect(boolean notifyError) {
|
protected void connect(boolean notifyError) {
|
||||||
boolean successful = true;
|
boolean successful = true;
|
||||||
try {
|
synchronized (this) {
|
||||||
ConnectionFactory connectionFactory = JMSConnection.getInstance()
|
try {
|
||||||
.getFactory();
|
ConnectionFactory connectionFactory = JMSConnection
|
||||||
disconnect(notifyError);
|
.getInstance().getFactory();
|
||||||
|
disconnect(notifyError);
|
||||||
|
|
||||||
// Create a Connection
|
// Create a Connection
|
||||||
connection = connectionFactory.createConnection();
|
connection = connectionFactory.createConnection();
|
||||||
connection.setExceptionListener(this);
|
connection.setExceptionListener(this);
|
||||||
// connection.setClientID(VizApp.getWsId().toString());
|
// connection.setClientID(VizApp.getWsId().toString());
|
||||||
|
|
||||||
connection.start();
|
connection.start();
|
||||||
connected = true;
|
connected = true;
|
||||||
|
} catch (JMSException e) {
|
||||||
|
if (notifyError) {
|
||||||
|
statusHandler.handle(Priority.SIGNIFICANT,
|
||||||
|
"NotificationManager failed to connect.", e);
|
||||||
|
}
|
||||||
|
successful = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
synchronized (listeners) {
|
||||||
for (NotificationListener listener : listeners.values()) {
|
for (NotificationListener listener : listeners.values()) {
|
||||||
try {
|
try {
|
||||||
listener.setupConnection(this);
|
listener.setupConnection(this);
|
||||||
|
@ -216,12 +229,6 @@ public class NotificationManagerJob implements ExceptionListener, IDisposable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (JMSException e) {
|
|
||||||
if (notifyError) {
|
|
||||||
statusHandler.handle(Priority.SIGNIFICANT,
|
|
||||||
"NotificationManager failed to connect.", e);
|
|
||||||
}
|
|
||||||
successful = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!successful) {
|
if (!successful) {
|
||||||
|
@ -229,7 +236,22 @@ public class NotificationManagerJob implements ExceptionListener, IDisposable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void disconnect(boolean notifyError) {
|
/**
|
||||||
|
* Creates a new AUTO_ACKNOWLEDGE session if connected to JMS, otherwise
|
||||||
|
* returns null.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* @throws JMSException
|
||||||
|
*/
|
||||||
|
protected synchronized Session createSession() throws JMSException {
|
||||||
|
if (connected) {
|
||||||
|
return connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected synchronized void disconnect(boolean notifyError) {
|
||||||
if (connection != null) {
|
if (connection != null) {
|
||||||
try {
|
try {
|
||||||
connection.stop();
|
connection.stop();
|
||||||
|
@ -271,9 +293,11 @@ public class NotificationManagerJob implements ExceptionListener, IDisposable {
|
||||||
new Timer().schedule(task, 5 * 1000);
|
new Timer().schedule(task, 5 * 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset connected bool
|
synchronized (listeners) {
|
||||||
for (NotificationListener listener : listeners.values()) {
|
// disconnect listeners
|
||||||
listener.connected = false;
|
for (NotificationListener listener : listeners.values()) {
|
||||||
|
listener.disconnect();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e != null) {
|
if (e != null) {
|
||||||
|
@ -282,33 +306,38 @@ public class NotificationManagerJob implements ExceptionListener, IDisposable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static synchronized void addQueueObserver(String queue,
|
public static void addQueueObserver(String queue, INotificationObserver obs) {
|
||||||
INotificationObserver obs) {
|
|
||||||
addQueueObserver(queue, obs, null);
|
addQueueObserver(queue, obs, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static synchronized void addQueueObserver(String queue,
|
public static void addQueueObserver(String queue,
|
||||||
INotificationObserver obs, String queryString) {
|
INotificationObserver obs, String queryString) {
|
||||||
NotificationManagerJob notifMgr = getInstance();
|
NotificationManagerJob notifMgr = getInstance();
|
||||||
ListenerKey key = new ListenerKey(queue, queryString);
|
ListenerKey key = new ListenerKey(queue, queryString);
|
||||||
NotificationListener listener = notifMgr.listeners.get(key);
|
|
||||||
if (listener == null || listener.consumer == null) {
|
synchronized (notifMgr.listeners) {
|
||||||
try {
|
NotificationListener listener = notifMgr.listeners.get(key);
|
||||||
listener = new NotificationListener(queue, queryString,
|
if (listener == null) {
|
||||||
Type.QUEUE);
|
try {
|
||||||
notifMgr.listeners.put(key, listener);
|
listener = new NotificationListener(queue, queryString,
|
||||||
listener.addObserver(obs);
|
Type.QUEUE);
|
||||||
if (notifMgr.connected) {
|
notifMgr.listeners.put(key, listener);
|
||||||
listener.setupConnection(notifMgr);
|
listener.addObserver(obs);
|
||||||
|
if (notifMgr.connected) {
|
||||||
|
listener.setupConnection(notifMgr);
|
||||||
|
}
|
||||||
|
} catch (JMSException e) {
|
||||||
|
Status s = new Status(
|
||||||
|
IStatus.ERROR,
|
||||||
|
Activator.PLUGIN_ID,
|
||||||
|
0,
|
||||||
|
"NotificationManager failed to create queue consumer.",
|
||||||
|
e);
|
||||||
|
StatusManager.getManager().handle(s);
|
||||||
}
|
}
|
||||||
} catch (JMSException e) {
|
} else {
|
||||||
Status s = new Status(IStatus.ERROR, Activator.PLUGIN_ID, 0,
|
listener.addObserver(obs);
|
||||||
"NotificationManager failed to create queue consumer.",
|
|
||||||
e);
|
|
||||||
StatusManager.getManager().handle(s);
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
listener.addObserver(obs);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -320,32 +349,35 @@ public class NotificationManagerJob implements ExceptionListener, IDisposable {
|
||||||
* @param obs
|
* @param obs
|
||||||
* the alert observer callback
|
* the alert observer callback
|
||||||
*/
|
*/
|
||||||
public static synchronized void addObserver(String topic,
|
public static void addObserver(String topic, INotificationObserver obs) {
|
||||||
INotificationObserver obs) {
|
|
||||||
addObserver(topic, obs, null);
|
addObserver(topic, obs, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static synchronized void addObserver(String topic,
|
public static void addObserver(String topic, INotificationObserver obs,
|
||||||
INotificationObserver obs, String queryString) {
|
String queryString) {
|
||||||
NotificationManagerJob notifMgr = getInstance();
|
NotificationManagerJob notifMgr = getInstance();
|
||||||
ListenerKey key = new ListenerKey(topic, queryString);
|
ListenerKey key = new ListenerKey(topic, queryString);
|
||||||
NotificationListener listener = notifMgr.listeners.get(key);
|
|
||||||
if (listener == null) {
|
synchronized (notifMgr.listeners) {
|
||||||
try {
|
NotificationListener listener = notifMgr.listeners.get(key);
|
||||||
listener = new NotificationListener(topic, queryString,
|
if (listener == null) {
|
||||||
Type.TOPIC);
|
try {
|
||||||
notifMgr.listeners.put(key, listener);
|
listener = new NotificationListener(topic, queryString,
|
||||||
listener.addObserver(obs);
|
Type.TOPIC);
|
||||||
if (notifMgr.connected) {
|
notifMgr.listeners.put(key, listener);
|
||||||
listener.setupConnection(notifMgr);
|
listener.addObserver(obs);
|
||||||
|
if (notifMgr.connected) {
|
||||||
|
listener.setupConnection(notifMgr);
|
||||||
|
}
|
||||||
|
} catch (JMSException e) {
|
||||||
|
Status s = new Status(IStatus.ERROR, Activator.PLUGIN_ID,
|
||||||
|
0,
|
||||||
|
"NotificationManager failed to create consumer.", e);
|
||||||
|
StatusManager.getManager().handle(s);
|
||||||
}
|
}
|
||||||
} catch (JMSException e) {
|
} else {
|
||||||
Status s = new Status(IStatus.ERROR, Activator.PLUGIN_ID, 0,
|
listener.addObserver(obs);
|
||||||
"NotificationManager failed to create consumer.", e);
|
|
||||||
StatusManager.getManager().handle(s);
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
listener.addObserver(obs);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -358,8 +390,7 @@ public class NotificationManagerJob implements ExceptionListener, IDisposable {
|
||||||
* @param obs
|
* @param obs
|
||||||
* the observer to remove
|
* the observer to remove
|
||||||
*/
|
*/
|
||||||
public static synchronized void removeObserver(String topic,
|
public static void removeObserver(String topic, INotificationObserver obs) {
|
||||||
INotificationObserver obs) {
|
|
||||||
removeObserver(topic, obs, null);
|
removeObserver(topic, obs, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -373,18 +404,20 @@ public class NotificationManagerJob implements ExceptionListener, IDisposable {
|
||||||
* the observer to remove
|
* the observer to remove
|
||||||
* @param queryString
|
* @param queryString
|
||||||
*/
|
*/
|
||||||
public static synchronized void removeObserver(String topic,
|
public static void removeObserver(String topic, INotificationObserver obs,
|
||||||
INotificationObserver obs, String queryString) {
|
String queryString) {
|
||||||
NotificationManagerJob notifMgr = getInstance();
|
NotificationManagerJob notifMgr = getInstance();
|
||||||
ListenerKey key = new ListenerKey(topic, queryString);
|
ListenerKey key = new ListenerKey(topic, queryString);
|
||||||
NotificationListener listener = notifMgr.listeners.get(key);
|
synchronized (notifMgr.listeners) {
|
||||||
if (listener == null) {
|
NotificationListener listener = notifMgr.listeners.get(key);
|
||||||
return;
|
if (listener == null) {
|
||||||
}
|
return;
|
||||||
listener.removeObserver(obs);
|
}
|
||||||
if (listener.size() <= 0) {
|
listener.removeObserver(obs);
|
||||||
listener.disconnect();
|
if (listener.size() <= 0) {
|
||||||
notifMgr.listeners.remove(key);
|
listener.disconnect();
|
||||||
|
notifMgr.listeners.remove(key);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -397,18 +430,20 @@ public class NotificationManagerJob implements ExceptionListener, IDisposable {
|
||||||
* @param obs
|
* @param obs
|
||||||
* the observer to remove
|
* the observer to remove
|
||||||
*/
|
*/
|
||||||
public static synchronized void removeQueueObserver(String queue,
|
public static void removeQueueObserver(String queue, String queryString,
|
||||||
String queryString, INotificationObserver obs) {
|
INotificationObserver obs) {
|
||||||
NotificationManagerJob notifMgr = getInstance();
|
NotificationManagerJob notifMgr = getInstance();
|
||||||
ListenerKey key = new ListenerKey(queue, queryString);
|
ListenerKey key = new ListenerKey(queue, queryString);
|
||||||
NotificationListener listener = notifMgr.listeners.get(key);
|
synchronized (notifMgr.listeners) {
|
||||||
if (listener == null) {
|
NotificationListener listener = notifMgr.listeners.get(key);
|
||||||
return;
|
if (listener == null) {
|
||||||
}
|
return;
|
||||||
listener.removeObserver(obs);
|
}
|
||||||
if (listener.size() <= 0) {
|
listener.removeObserver(obs);
|
||||||
listener.disconnect();
|
if (listener.size() <= 0) {
|
||||||
notifMgr.listeners.remove(key);
|
listener.disconnect();
|
||||||
|
notifMgr.listeners.remove(key);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -428,24 +463,22 @@ public class NotificationManagerJob implements ExceptionListener, IDisposable {
|
||||||
|
|
||||||
private static class NotificationListener implements MessageListener {
|
private static class NotificationListener implements MessageListener {
|
||||||
|
|
||||||
private Type type;
|
private final Type type;
|
||||||
|
|
||||||
private String id;
|
private final String id;
|
||||||
|
|
||||||
private String queryString;
|
private final String queryString;
|
||||||
|
|
||||||
/** The list of interested parties */
|
/** The list of interested parties */
|
||||||
protected List<INotificationObserver> observers;
|
protected final List<INotificationObserver> observers;
|
||||||
|
|
||||||
/** The map of job threads from observers */
|
/** The map of job threads from observers */
|
||||||
protected Map<INotificationObserver, JobWrapper> jobWrappers;
|
protected final Map<INotificationObserver, JobWrapper> jobWrappers;
|
||||||
|
|
||||||
protected MessageConsumer consumer;
|
protected MessageConsumer consumer;
|
||||||
|
|
||||||
protected Session session;
|
protected Session session;
|
||||||
|
|
||||||
protected boolean connected = false;
|
|
||||||
|
|
||||||
public NotificationListener(String id, String queryString, Type type) {
|
public NotificationListener(String id, String queryString, Type type) {
|
||||||
this.observers = new ArrayList<INotificationObserver>();
|
this.observers = new ArrayList<INotificationObserver>();
|
||||||
this.jobWrappers = new HashMap<INotificationObserver, JobWrapper>();
|
this.jobWrappers = new HashMap<INotificationObserver, JobWrapper>();
|
||||||
|
@ -466,40 +499,34 @@ public class NotificationManagerJob implements ExceptionListener, IDisposable {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// If we made it here we are good
|
|
||||||
connected = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void disconnect() {
|
public synchronized void disconnect() {
|
||||||
if (connected) {
|
if (consumer != null) {
|
||||||
if (consumer != null) {
|
try {
|
||||||
try {
|
consumer.close();
|
||||||
consumer.close();
|
} catch (JMSException e) {
|
||||||
} catch (JMSException e) {
|
statusHandler.handle(Priority.PROBLEM,
|
||||||
statusHandler.handle(Priority.PROBLEM,
|
"Error closing consumer connection", e);
|
||||||
"Error closing consumer connection", e);
|
|
||||||
}
|
|
||||||
consumer = null;
|
|
||||||
}
|
}
|
||||||
|
consumer = null;
|
||||||
|
}
|
||||||
|
|
||||||
if (session != null) {
|
if (session != null) {
|
||||||
try {
|
try {
|
||||||
session.close();
|
session.close();
|
||||||
} catch (JMSException e) {
|
} catch (JMSException e) {
|
||||||
statusHandler.handle(Priority.PROBLEM,
|
statusHandler.handle(Priority.PROBLEM,
|
||||||
"Error closing session", e);
|
"Error closing session", e);
|
||||||
}
|
|
||||||
session = null;
|
|
||||||
}
|
}
|
||||||
connected = false;
|
session = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupQueue(NotificationManagerJob manager)
|
private synchronized void setupQueue(NotificationManagerJob manager)
|
||||||
throws JMSException {
|
throws JMSException {
|
||||||
disconnect();
|
disconnect();
|
||||||
session = manager.connection.createSession(false,
|
session = manager.createSession();
|
||||||
Session.AUTO_ACKNOWLEDGE);
|
|
||||||
if (session != null) {
|
if (session != null) {
|
||||||
String queueName = id;
|
String queueName = id;
|
||||||
Queue t = session.createQueue(queueName);
|
Queue t = session.createQueue(queueName);
|
||||||
|
@ -510,16 +537,14 @@ public class NotificationManagerJob implements ExceptionListener, IDisposable {
|
||||||
consumer = session.createConsumer(t);
|
consumer = session.createConsumer(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
setConsumer(consumer);
|
|
||||||
consumer.setMessageListener(this);
|
consumer.setMessageListener(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupTopic(NotificationManagerJob manager)
|
private synchronized void setupTopic(NotificationManagerJob manager)
|
||||||
throws JMSException {
|
throws JMSException {
|
||||||
disconnect();
|
disconnect();
|
||||||
session = manager.connection.createSession(false,
|
session = manager.createSession();
|
||||||
Session.AUTO_ACKNOWLEDGE);
|
|
||||||
if (session != null) {
|
if (session != null) {
|
||||||
String topicName = id;
|
String topicName = id;
|
||||||
Topic t = session.createTopic(topicName);
|
Topic t = session.createTopic(topicName);
|
||||||
|
@ -534,10 +559,6 @@ public class NotificationManagerJob implements ExceptionListener, IDisposable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setConsumer(MessageConsumer consumer) {
|
|
||||||
this.consumer = consumer;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
|
@ -545,48 +566,37 @@ public class NotificationManagerJob implements ExceptionListener, IDisposable {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onMessage(Message msg) {
|
public void onMessage(Message msg) {
|
||||||
if (observers == null) {
|
synchronized (observers) {
|
||||||
return;
|
for (INotificationObserver obs : observers) {
|
||||||
}
|
// Get the corresponding job, creating the
|
||||||
|
// wrapper if necessary, really on observers lock for sync
|
||||||
for (INotificationObserver obs : observers) {
|
// purposes
|
||||||
sendToObserver(obs, msg);
|
JobWrapper wrapper = jobWrappers.get(obs);
|
||||||
}
|
if (wrapper == null) {
|
||||||
|
wrapper = new JobWrapper(obs);
|
||||||
// Iterator<JobWrapper> iterator = jobWrappers.values().iterator();
|
jobWrappers.put(obs, wrapper);
|
||||||
// while (iterator.hasNext()) {
|
}
|
||||||
// JobWrapper wrapper = iterator.next();
|
wrapper.put(msg);
|
||||||
// if (!wrapper.isEmpty() && wrapper.getState() != Job.RUNNING) {
|
|
||||||
// wrapper.schedule();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
public synchronized void addObserver(INotificationObserver obs) {
|
|
||||||
observers.add(obs);
|
|
||||||
}
|
|
||||||
|
|
||||||
public synchronized void removeObserver(INotificationObserver obs) {
|
|
||||||
observers.remove(obs);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void sendToObserver(INotificationObserver observer,
|
|
||||||
Message msg) {
|
|
||||||
// Get the corresponding job, creating the
|
|
||||||
// wrapper if necessary
|
|
||||||
JobWrapper wrapper = null;
|
|
||||||
synchronized (this) {
|
|
||||||
wrapper = jobWrappers.get(observer);
|
|
||||||
if (wrapper == null) {
|
|
||||||
wrapper = new JobWrapper(observer);
|
|
||||||
jobWrappers.put(observer, wrapper);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
wrapper.put(msg);
|
}
|
||||||
|
|
||||||
|
public void addObserver(INotificationObserver obs) {
|
||||||
|
synchronized (observers) {
|
||||||
|
observers.add(obs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeObserver(INotificationObserver obs) {
|
||||||
|
synchronized (observers) {
|
||||||
|
observers.remove(obs);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int size() {
|
public int size() {
|
||||||
return observers.size();
|
synchronized (observers) {
|
||||||
|
return observers.size();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -669,7 +679,7 @@ public class NotificationManagerJob implements ExceptionListener, IDisposable {
|
||||||
if (messageCount.incrementAndGet() > IN_MEM_MESSAGE_LIMIT) {
|
if (messageCount.incrementAndGet() > IN_MEM_MESSAGE_LIMIT) {
|
||||||
messageCount.decrementAndGet();
|
messageCount.decrementAndGet();
|
||||||
messages.remove();
|
messages.remove();
|
||||||
if (System.currentTimeMillis() - lastErrorPrintTime > 600000) {
|
if ((System.currentTimeMillis() - lastErrorPrintTime) > 600000) {
|
||||||
final Status s = new Status(
|
final Status s = new Status(
|
||||||
Status.ERROR,
|
Status.ERROR,
|
||||||
Activator.PLUGIN_ID,
|
Activator.PLUGIN_ID,
|
||||||
|
@ -683,15 +693,6 @@ public class NotificationManagerJob implements ExceptionListener, IDisposable {
|
||||||
this.schedule();
|
this.schedule();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if is empty.
|
|
||||||
*
|
|
||||||
* @return true, if is empty
|
|
||||||
*/
|
|
||||||
public boolean isEmpty() {
|
|
||||||
return this.messages.isEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -701,9 +702,12 @@ public class NotificationManagerJob implements ExceptionListener, IDisposable {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void dispose() {
|
public void dispose() {
|
||||||
for (NotificationListener listener : listeners.values()) {
|
synchronized (listeners) {
|
||||||
listener.disconnect();
|
for (NotificationListener listener : listeners.values()) {
|
||||||
|
listener.disconnect();
|
||||||
|
}
|
||||||
|
listeners.clear();
|
||||||
}
|
}
|
||||||
listeners.clear();
|
disconnect(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -225,6 +225,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||||
* 11/05/2012 15477 zhao Trim blank lines in text in Editor when check Syntax
|
* 11/05/2012 15477 zhao Trim blank lines in text in Editor when check Syntax
|
||||||
* 01/09/2013 15528 zhao Modified saveFile() and restoreFile()
|
* 01/09/2013 15528 zhao Modified saveFile() and restoreFile()
|
||||||
* 10/24/2013 16478 zhao add syntax check for extra '=' sign
|
* 10/24/2013 16478 zhao add syntax check for extra '=' sign
|
||||||
|
* 02/12/2014 17076 lvenable Mark guidance tabs as not current so they get refreshed
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -672,6 +673,10 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable,
|
||||||
populateTafViewer();
|
populateTafViewer();
|
||||||
// Update the metar and mos guidance in the viewer tab.
|
// Update the metar and mos guidance in the viewer tab.
|
||||||
updateViewerTab(stationName);
|
updateViewerTab(stationName);
|
||||||
|
|
||||||
|
// Mark the tabs as not current so they get updated.
|
||||||
|
markTabsAsNotCurrent();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OPEN_RTN:
|
case OPEN_RTN:
|
||||||
|
@ -767,7 +772,19 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
|
/**
|
||||||
|
* Mark the tabs as not current so they get refreshed.
|
||||||
|
*/
|
||||||
|
private void markTabsAsNotCurrent() {
|
||||||
|
for (TabItem tbi : guidanceViewerFolder.getItems()) {
|
||||||
|
if (tbi.getControl() instanceof ViewerTab) {
|
||||||
|
((ViewerTab) tbi.getControl()).setDisplayCurrent(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void clearAll() {
|
public void clearAll() {
|
||||||
if (shell == null) {
|
if (shell == null) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -28,6 +28,7 @@ import java.util.Set;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
|
|
||||||
import org.eclipse.jface.dialogs.IDialogConstants;
|
import org.eclipse.jface.dialogs.IDialogConstants;
|
||||||
|
import org.eclipse.jface.dialogs.MessageDialog;
|
||||||
import org.eclipse.jface.resource.ImageRegistry;
|
import org.eclipse.jface.resource.ImageRegistry;
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.events.MenuAdapter;
|
import org.eclipse.swt.events.MenuAdapter;
|
||||||
|
@ -97,6 +98,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||||
* up warnings.
|
* up warnings.
|
||||||
* May 15, 2013 1842 dgilling Pass DataManager instance down to sub-
|
* May 15, 2013 1842 dgilling Pass DataManager instance down to sub-
|
||||||
* components.
|
* components.
|
||||||
|
* Feb 12, 2014 2801 randerso Added prompting if formatter is run against non-normal database
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -106,6 +108,12 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||||
|
|
||||||
public class FormatterLauncherDialog extends CaveJFACEDialog implements
|
public class FormatterLauncherDialog extends CaveJFACEDialog implements
|
||||||
IProductTab {
|
IProductTab {
|
||||||
|
|
||||||
|
// formatter data sources. Fcst must be first
|
||||||
|
private static enum FormatterDataSource {
|
||||||
|
Fcst, ISC, Official, Default,
|
||||||
|
}
|
||||||
|
|
||||||
private final transient IUFStatusHandler statusHandler = UFStatus
|
private final transient IUFStatusHandler statusHandler = UFStatus
|
||||||
.getHandler(FormatterLauncherDialog.class);
|
.getHandler(FormatterLauncherDialog.class);
|
||||||
|
|
||||||
|
@ -161,24 +169,9 @@ public class FormatterLauncherDialog extends CaveJFACEDialog implements
|
||||||
private Image failedImg;
|
private Image failedImg;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fcst data source menu item.
|
* data source menu items
|
||||||
*/
|
*/
|
||||||
private MenuItem fcstMI = null;
|
private java.util.List<MenuItem> dataSourceMI;
|
||||||
|
|
||||||
/**
|
|
||||||
* Official data source menu item.
|
|
||||||
*/
|
|
||||||
private MenuItem officialMI = null;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ISC data source menu item.
|
|
||||||
*/
|
|
||||||
private MenuItem iscMI = null;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Default data source menu item.
|
|
||||||
*/
|
|
||||||
private MenuItem defaultMI = null;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Products menu.
|
* Products menu.
|
||||||
|
@ -212,8 +205,6 @@ public class FormatterLauncherDialog extends CaveJFACEDialog implements
|
||||||
|
|
||||||
private DataManager dataMgr;
|
private DataManager dataMgr;
|
||||||
|
|
||||||
private String selectedDataSource = null;
|
|
||||||
|
|
||||||
private boolean doClose = false;
|
private boolean doClose = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -338,59 +329,47 @@ public class FormatterLauncherDialog extends CaveJFACEDialog implements
|
||||||
// Get the CAVE operating mode
|
// Get the CAVE operating mode
|
||||||
CAVEMode mode = dataMgr.getOpMode();
|
CAVEMode mode = dataMgr.getOpMode();
|
||||||
|
|
||||||
// Forecast menu item, set text based on operating mode
|
this.dataSourceMI = new ArrayList<MenuItem>();
|
||||||
fcstMI = new MenuItem(dataSourceMenu, SWT.RADIO);
|
// create menu items
|
||||||
if (mode.equals(CAVEMode.OPERATIONAL)) {
|
for (FormatterDataSource source : FormatterDataSource.values()) {
|
||||||
fcstMI.setText("Fcst");
|
MenuItem item = new MenuItem(dataSourceMenu, SWT.RADIO);
|
||||||
} else if (mode.equals(CAVEMode.PRACTICE)) {
|
item.setData(source);
|
||||||
fcstMI.setText("Fcst_Prac");
|
this.dataSourceMI.add(item);
|
||||||
fcstMI.setSelection(true);
|
String text = source.toString();
|
||||||
} else {
|
if (source.equals(FormatterDataSource.Fcst)) {
|
||||||
fcstMI.setText("Fcst_Test");
|
if (mode.equals(CAVEMode.PRACTICE)) {
|
||||||
fcstMI.setSelection(true);
|
text += "_Prac";
|
||||||
}
|
} else if (mode.equals(CAVEMode.TEST)) {
|
||||||
fcstMI.addSelectionListener(new SelectionAdapter() {
|
text += "_Test";
|
||||||
@Override
|
}
|
||||||
public void widgetSelected(SelectionEvent event) {
|
|
||||||
selectedDataSource = dataMgr.getParmManager()
|
|
||||||
.getMutableDatabase().toString();
|
|
||||||
}
|
}
|
||||||
});
|
item.setText(text);
|
||||||
|
item.addSelectionListener(new SelectionAdapter() {
|
||||||
|
|
||||||
// Only show these menu items when in operational mode
|
|
||||||
if (mode.equals(CAVEMode.OPERATIONAL)) {
|
|
||||||
// ISC menu item
|
|
||||||
iscMI = new MenuItem(dataSourceMenu, SWT.RADIO);
|
|
||||||
iscMI.setText("ISC");
|
|
||||||
iscMI.addSelectionListener(new SelectionAdapter() {
|
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
getIscDataSource();
|
MenuItem item = (MenuItem) e.getSource();
|
||||||
|
if (item.getSelection()) {
|
||||||
|
statusHandler.handle(
|
||||||
|
Priority.EVENTB,
|
||||||
|
"User selected formatter data source: "
|
||||||
|
+ item.getText());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Official menu item
|
if (!mode.equals(CAVEMode.OPERATIONAL)) {
|
||||||
officialMI = new MenuItem(dataSourceMenu, SWT.RADIO);
|
item.setSelection(true);
|
||||||
officialMI.setText("Official");
|
statusHandler.handle(Priority.EVENTB,
|
||||||
officialMI.addSelectionListener(new SelectionAdapter() {
|
"Formatter default data source: " + item.getText());
|
||||||
@Override
|
break;
|
||||||
public void widgetSelected(SelectionEvent event) {
|
}
|
||||||
selectedDataSource = getOfficialDataSource();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Default menu item
|
if (source.equals(FormatterDataSource.Default)) {
|
||||||
defaultMI = new MenuItem(dataSourceMenu, SWT.RADIO);
|
item.setSelection(true);
|
||||||
defaultMI.setText("Default");
|
statusHandler.handle(Priority.EVENTB,
|
||||||
defaultMI.setSelection(true);
|
"Formatter default data source: " + item.getText());
|
||||||
defaultMI.addSelectionListener(new SelectionAdapter() {
|
}
|
||||||
@Override
|
|
||||||
public void widgetSelected(SelectionEvent event) {
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
selectedDataSource = dataMgr.getParmManager().getMutableDatabase()
|
|
||||||
.toString();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -731,32 +710,108 @@ public class FormatterLauncherDialog extends CaveJFACEDialog implements
|
||||||
* The name of the product
|
* The name of the product
|
||||||
* @return The data source
|
* @return The data source
|
||||||
*/
|
*/
|
||||||
public String getSelectedDataSource(String productName) {
|
public DatabaseID getSelectedDataSource(String productName) {
|
||||||
if (fcstMI.getSelection()) {
|
FormatterDataSource menuDataSource = FormatterDataSource.Default;
|
||||||
selectedDataSource = getFcstDataSource();
|
for (MenuItem item : dataSourceMI) {
|
||||||
} else if (iscMI.getSelection()) {
|
if (item.getSelection()) {
|
||||||
selectedDataSource = getIscDataSource();
|
menuDataSource = (FormatterDataSource) item.getData();
|
||||||
} else if (officialMI.getSelection()) {
|
break;
|
||||||
selectedDataSource = getOfficialDataSource();
|
|
||||||
} else {
|
|
||||||
// Default value
|
|
||||||
ProductDefinition prodDef = textProductMgr
|
|
||||||
.getProductDefinition(productName);
|
|
||||||
String dataSource = (String) prodDef.get("database");
|
|
||||||
if (dataSource == null) {
|
|
||||||
dataSource = "Official";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dataSource.equals("ISC")) {
|
|
||||||
selectedDataSource = getIscDataSource();
|
|
||||||
} else if (dataSource.equals("Official")) {
|
|
||||||
selectedDataSource = getOfficialDataSource();
|
|
||||||
} else {
|
|
||||||
selectedDataSource = getFcstDataSource();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return selectedDataSource;
|
// Default value
|
||||||
|
ProductDefinition prodDef = textProductMgr
|
||||||
|
.getProductDefinition(productName);
|
||||||
|
String dbString = (String) prodDef.get("database");
|
||||||
|
FormatterDataSource productDataSource;
|
||||||
|
if (dbString == null) {
|
||||||
|
productDataSource = FormatterDataSource.Default;
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
productDataSource = FormatterDataSource.valueOf(dbString);
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
StringBuilder msg = new StringBuilder();
|
||||||
|
msg.append("The ");
|
||||||
|
msg.append(productName);
|
||||||
|
msg.append(" product definition contains an invalid database selection: \"");
|
||||||
|
msg.append(dbString);
|
||||||
|
msg.append("\". Valid values are: [");
|
||||||
|
for (FormatterDataSource src : FormatterDataSource.values()) {
|
||||||
|
if (!src.equals(FormatterDataSource.Default)) {
|
||||||
|
msg.append(src).append(", ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
msg.delete(msg.length() - 2, msg.length());
|
||||||
|
msg.append("]");
|
||||||
|
statusHandler.error(msg.toString());
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FormatterDataSource dataSource;
|
||||||
|
if (menuDataSource.equals(FormatterDataSource.Default)) {
|
||||||
|
if (productDataSource.equals(FormatterDataSource.Default)) {
|
||||||
|
dataSource = FormatterDataSource.Official;
|
||||||
|
} else {
|
||||||
|
dataSource = productDataSource;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
dataSource = menuDataSource;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!productDataSource.equals(FormatterDataSource.Default)) {
|
||||||
|
if (!dataSource.equals(productDataSource)) {
|
||||||
|
// A check should be made that a hazard formatter is actually
|
||||||
|
// being run on the database specified in the Local or
|
||||||
|
// Definition file (Definition["database"] entry). If the
|
||||||
|
// database being run is different, provide a warning to the
|
||||||
|
// forecaster that requires acknowledgment before running.
|
||||||
|
MessageDialog dlg = new MessageDialog(getShell(),
|
||||||
|
"Confirm Data Source", null,
|
||||||
|
"The product definition indicates the " + productName
|
||||||
|
+ " formatter should be run against the "
|
||||||
|
+ productDataSource
|
||||||
|
+ " database, but you have selected the "
|
||||||
|
+ dataSource
|
||||||
|
+ " database.\n\nDo you wish to continue?",
|
||||||
|
MessageDialog.WARNING, new String[] { "Yes", "No" }, 1);
|
||||||
|
int retVal = dlg.open();
|
||||||
|
if (retVal != 0) {
|
||||||
|
dataSource = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (dataSource.equals(FormatterDataSource.ISC)) {
|
||||||
|
// If the database is not explicitly defined (default), provide
|
||||||
|
// a a warning to the forecaster that requires acknowledgment
|
||||||
|
// before running if the database being used is ISC
|
||||||
|
MessageDialog dlg = new MessageDialog(
|
||||||
|
getShell(),
|
||||||
|
"Confirm Data Source",
|
||||||
|
null,
|
||||||
|
"You are about to run the "
|
||||||
|
+ productName
|
||||||
|
+ " formatter against the ISC database.\n\nDo you wish to continue?",
|
||||||
|
MessageDialog.WARNING, new String[] { "Yes", "No" }, 1);
|
||||||
|
int retVal = dlg.open();
|
||||||
|
if (retVal != 0) {
|
||||||
|
dataSource = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DatabaseID selectedDbId;
|
||||||
|
if (dataSource == null) {
|
||||||
|
selectedDbId = null;
|
||||||
|
} else if (dataSource.equals(FormatterDataSource.ISC)) {
|
||||||
|
selectedDbId = getIscDataSource();
|
||||||
|
} else if (dataSource.equals(FormatterDataSource.Official)) {
|
||||||
|
selectedDbId = getOfficialDataSource();
|
||||||
|
} else {
|
||||||
|
selectedDbId = getFcstDataSource();
|
||||||
|
}
|
||||||
|
|
||||||
|
return selectedDbId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1009,8 +1064,8 @@ public class FormatterLauncherDialog extends CaveJFACEDialog implements
|
||||||
*
|
*
|
||||||
* @return The FcstDataSource
|
* @return The FcstDataSource
|
||||||
*/
|
*/
|
||||||
private String getFcstDataSource() {
|
private DatabaseID getFcstDataSource() {
|
||||||
return dataMgr.getParmManager().getMutableDatabase().toString();
|
return dataMgr.getParmManager().getMutableDatabase();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1021,13 +1076,13 @@ public class FormatterLauncherDialog extends CaveJFACEDialog implements
|
||||||
*
|
*
|
||||||
* @return The ISC Data Source
|
* @return The ISC Data Source
|
||||||
*/
|
*/
|
||||||
private String getIscDataSource() {
|
private DatabaseID getIscDataSource() {
|
||||||
java.util.List<DatabaseID> dbs = dataMgr.getParmManager()
|
java.util.List<DatabaseID> dbs = dataMgr.getParmManager()
|
||||||
.getIscDatabases();
|
.getIscDatabases();
|
||||||
|
|
||||||
if (dbs.size() > 0) {
|
if (dbs.size() > 0) {
|
||||||
// Always return the last one in the list
|
// Always return the last one in the list
|
||||||
return dbs.get(dbs.size() - 1).toString();
|
return dbs.get(dbs.size() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
@ -1038,12 +1093,12 @@ public class FormatterLauncherDialog extends CaveJFACEDialog implements
|
||||||
*
|
*
|
||||||
* @return The Official Data source
|
* @return The Official Data source
|
||||||
*/
|
*/
|
||||||
private String getOfficialDataSource() {
|
private DatabaseID getOfficialDataSource() {
|
||||||
String source = null;
|
DatabaseID source = null;
|
||||||
try {
|
try {
|
||||||
ServerResponse<java.util.List<DatabaseID>> sr = dataMgr.getClient()
|
ServerResponse<java.util.List<DatabaseID>> sr = dataMgr.getClient()
|
||||||
.getOfficialDBName();
|
.getOfficialDBName();
|
||||||
source = sr.getPayload().get(0).toString();
|
source = sr.getPayload().get(0);
|
||||||
} catch (GFEServerException e) {
|
} catch (GFEServerException e) {
|
||||||
statusHandler.handle(Priority.PROBLEM,
|
statusHandler.handle(Priority.PROBLEM,
|
||||||
"Unable to determine official db", e);
|
"Unable to determine official db", e);
|
||||||
|
|
|
@ -34,6 +34,7 @@ import org.eclipse.swt.widgets.Label;
|
||||||
import org.eclipse.swt.widgets.ProgressBar;
|
import org.eclipse.swt.widgets.ProgressBar;
|
||||||
import org.eclipse.swt.widgets.TabFolder;
|
import org.eclipse.swt.widgets.TabFolder;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID;
|
||||||
import com.raytheon.viz.gfe.Activator;
|
import com.raytheon.viz.gfe.Activator;
|
||||||
import com.raytheon.viz.gfe.core.DataManager;
|
import com.raytheon.viz.gfe.core.DataManager;
|
||||||
import com.raytheon.viz.gfe.dialogs.FormatterLauncherDialog;
|
import com.raytheon.viz.gfe.dialogs.FormatterLauncherDialog;
|
||||||
|
@ -64,6 +65,8 @@ import com.raytheon.viz.gfe.textformatter.TextProductManager;
|
||||||
* 05 SEP 2013 2329 randerso Added call to ZoneCombinerComp.applyZoneCombo when
|
* 05 SEP 2013 2329 randerso Added call to ZoneCombinerComp.applyZoneCombo when
|
||||||
* when run formatter button is clicked.
|
* when run formatter button is clicked.
|
||||||
* 05 FEB 2014 2591 randerso Added dataManager to ZoneCombinerComp constructor
|
* 05 FEB 2014 2591 randerso Added dataManager to ZoneCombinerComp constructor
|
||||||
|
* Passed dataMgr instance to FormatterUtil.runFormatterScript
|
||||||
|
* 12 FEB 2014 2801 randerso Added prompting if formatter is run against non-normal database
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -365,36 +368,37 @@ public class ProductAreaComp extends Composite implements
|
||||||
productEditorBtnSelected();
|
productEditorBtnSelected();
|
||||||
|
|
||||||
if (okToLoseText()) {
|
if (okToLoseText()) {
|
||||||
productEditorComp.clearProductText();
|
DatabaseID dbId = ((FormatterLauncherDialog) productTabCB)
|
||||||
abortFormatterBtn.setEnabled(true);
|
.getSelectedDataSource(productName);
|
||||||
// closeTabBtn.setEnabled(false);
|
|
||||||
runFormatterBtn.setEnabled(false);
|
if (dbId != null) {
|
||||||
String vtecMode = "";
|
productEditorComp.clearProductText();
|
||||||
if (formattingCbo.isVisible()) {
|
abortFormatterBtn.setEnabled(true);
|
||||||
vtecMode = formattingCbo.getText();
|
// closeTabBtn.setEnabled(false);
|
||||||
} else {
|
runFormatterBtn.setEnabled(false);
|
||||||
int hazIndex = productName.indexOf("Hazard_");
|
String vtecMode = "";
|
||||||
if (hazIndex > -1) {
|
if (formattingCbo.isVisible()) {
|
||||||
String category = productName.substring(
|
vtecMode = formattingCbo.getText();
|
||||||
hazIndex + 7, hazIndex + 10);
|
} else {
|
||||||
vtecMode = textProductMgr
|
int hazIndex = productName.indexOf("Hazard_");
|
||||||
.getVtecMessageType(category);
|
if (hazIndex > -1) {
|
||||||
if (vtecMode == null) {
|
String category = productName.substring(
|
||||||
vtecMode = "";
|
hazIndex + 7, hazIndex + 10);
|
||||||
|
vtecMode = textProductMgr
|
||||||
|
.getVtecMessageType(category);
|
||||||
|
if (vtecMode == null) {
|
||||||
|
vtecMode = "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Check the data source menus, if one is selected then
|
// Get the source database
|
||||||
// use
|
zoneCombiner.applyZoneCombo();
|
||||||
// it, else use the default
|
FormatterUtil.runFormatterScript(dataMgr,
|
||||||
String dbId = null;
|
textProductMgr, productName,
|
||||||
zoneCombiner.applyZoneCombo();
|
dbId.toString(), vtecMode,
|
||||||
dbId = ((FormatterLauncherDialog) productTabCB)
|
ProductAreaComp.this);
|
||||||
.getSelectedDataSource(productName);
|
}
|
||||||
FormatterUtil.runFormatterScript(textProductMgr,
|
|
||||||
productName, dbId, vtecMode,
|
|
||||||
ProductAreaComp.this);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -22,6 +22,7 @@ package com.raytheon.viz.gfe.textformatter;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -219,12 +220,18 @@ public class CombinationsFileUtil {
|
||||||
// retrieve combinations file if it's changed
|
// retrieve combinations file if it's changed
|
||||||
LocalizationFile lf = pm.getStaticLocalizationFile(FileUtil.join(
|
LocalizationFile lf = pm.getStaticLocalizationFile(FileUtil.join(
|
||||||
COMBO_DIR_PATH, comboName + ".py"));
|
COMBO_DIR_PATH, comboName + ".py"));
|
||||||
File pyFile;
|
File pyFile = null;
|
||||||
try {
|
if (lf != null) {
|
||||||
pyFile = lf.getFile(true);
|
try {
|
||||||
} catch (LocalizationException e) {
|
pyFile = lf.getFile(true);
|
||||||
throw new GfeException("Error retrieving combinations file: "
|
} catch (LocalizationException e) {
|
||||||
+ comboName, e);
|
throw new GfeException("Error retrieving combinations file: "
|
||||||
|
+ comboName, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pyFile == null || !pyFile.exists()) {
|
||||||
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
LocalizationContext baseContext = pm.getContext(
|
LocalizationContext baseContext = pm.getContext(
|
||||||
|
|
|
@ -24,7 +24,6 @@ import java.util.TimeZone;
|
||||||
|
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
|
||||||
import com.raytheon.uf.common.time.SimulatedTime;
|
import com.raytheon.uf.common.time.SimulatedTime;
|
||||||
import com.raytheon.uf.common.time.TimeRange;
|
import com.raytheon.uf.common.time.TimeRange;
|
||||||
import com.raytheon.viz.core.mode.CAVEMode;
|
import com.raytheon.viz.core.mode.CAVEMode;
|
||||||
|
@ -42,6 +41,8 @@ import com.raytheon.viz.gfe.tasks.TaskManager;
|
||||||
* Sep 8, 2008 njensen Initial creation
|
* Sep 8, 2008 njensen Initial creation
|
||||||
* Jan 15, 2010 3395 ryu Fix "issued by" functionality
|
* Jan 15, 2010 3395 ryu Fix "issued by" functionality
|
||||||
* Sep 05, 2013 2329 randerso Removed save of combinations file
|
* Sep 05, 2013 2329 randerso Removed save of combinations file
|
||||||
|
* Feb 12, 2014 2591 randerso Passed dataMgr instance to FormatterUtil.runFormatterScript
|
||||||
|
* Removed call to TextProductManager.reloadModule
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -59,6 +60,9 @@ public class FormatterUtil {
|
||||||
/**
|
/**
|
||||||
* Runs a text formatter script for a given product
|
* Runs a text formatter script for a given product
|
||||||
*
|
*
|
||||||
|
* @param dataMgr
|
||||||
|
* the DataManager instance to use
|
||||||
|
*
|
||||||
* @param productMgr
|
* @param productMgr
|
||||||
* the formatter instance to use
|
* the formatter instance to use
|
||||||
* @param productName
|
* @param productName
|
||||||
|
@ -70,22 +74,12 @@ public class FormatterUtil {
|
||||||
* @param finish
|
* @param finish
|
||||||
* listener to fire when formatter finishes generating product
|
* listener to fire when formatter finishes generating product
|
||||||
*/
|
*/
|
||||||
public static void runFormatterScript(TextProductManager productMgr,
|
public static void runFormatterScript(DataManager dataMgr,
|
||||||
String productName, String dbId, String vtecMode,
|
TextProductManager productMgr, String productName, String dbId,
|
||||||
TextProductFinishListener finish) {
|
String vtecMode, TextProductFinishListener finish) {
|
||||||
try {
|
|
||||||
String filename = productMgr.getCombinationsFileName(productName);
|
|
||||||
boolean mapRequired = productMgr.mapRequired(productName);
|
|
||||||
if (filename != null && mapRequired) {
|
|
||||||
productMgr.reloadModule(filename);
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
statusHandler.handle(Priority.PROBLEM,
|
|
||||||
"Cannot generate combinations file", e);
|
|
||||||
}
|
|
||||||
|
|
||||||
int testMode = 0;
|
int testMode = 0;
|
||||||
if (DataManager.getCurrentInstance().getOpMode().equals(CAVEMode.TEST)) {
|
if (dataMgr.getOpMode().equals(CAVEMode.TEST)) {
|
||||||
testMode = 1;
|
testMode = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,8 +100,7 @@ public class FormatterUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
String name = productMgr.getModuleName(productName);
|
String name = productMgr.getModuleName(productName);
|
||||||
String varDict = productMgr.getVarDict(productName,
|
String varDict = productMgr.getVarDict(productName, dataMgr, dbId);
|
||||||
DataManager.getCurrentInstance(), dbId);
|
|
||||||
|
|
||||||
if (varDict != null) {
|
if (varDict != null) {
|
||||||
// run the formatter with the normal active table
|
// run the formatter with the normal active table
|
||||||
|
|
|
@ -55,9 +55,10 @@ import com.raytheon.viz.gfe.core.DataManager;
|
||||||
* SOFTWARE HISTORY
|
* SOFTWARE HISTORY
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* May 1, 2009 njensen Initial creation
|
* May 1, 2009 njensen Initial creation
|
||||||
* Jan 15, 2010 3395 ryu Fix "issued by" functionality
|
* Jan 15, 2010 3395 ryu Fix "issued by" functionality
|
||||||
* Apr 24, 2013 1936 dgilling Remove unused imports.
|
* Apr 24, 2013 1936 dgilling Remove unused imports.
|
||||||
|
* Feb 12, 2014 2591 randerso Removed reloadModule method
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -269,17 +270,6 @@ public class TextProductManager {
|
||||||
return mapName;
|
return mapName;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void reloadModule(String moduleName) {
|
|
||||||
Map<String, Object> args = new HashMap<String, Object>(1);
|
|
||||||
args.put("moduleName", moduleName);
|
|
||||||
try {
|
|
||||||
script.execute("reloadModule", args);
|
|
||||||
} catch (JepException e) {
|
|
||||||
statusHandler.handle(Priority.PROBLEM,
|
|
||||||
"Exception reloading module " + moduleName, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIssuedBy(String issuedBy) {
|
public void setIssuedBy(String issuedBy) {
|
||||||
if (LocalizationManager.getInstance().getCurrentSite().equals(issuedBy)) {
|
if (LocalizationManager.getInstance().getCurrentSite().equals(issuedBy)) {
|
||||||
this.issuedBy = "";
|
this.issuedBy = "";
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
|
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
|
||||||
<!-- general application log -->
|
<!-- general application log -->
|
||||||
<appender name="console" class="org.apache.log4j.ConsoleAppender">
|
<appender name="console" class="org.apache.log4j.ConsoleAppender">
|
||||||
<param name="Threshold" value="INFO" />
|
<param name="Threshold" value="INFO" />
|
||||||
<layout class="org.apache.log4j.PatternLayout">
|
<layout class="org.apache.log4j.PatternLayout">
|
||||||
<param name="ConversionPattern" value="%-5p %d [%t] %c{1}: %m%n"/>
|
<param name="ConversionPattern" value="%-5p %d [%t] %c{1}: %m%n"/>
|
||||||
</layout>
|
</layout>
|
||||||
|
@ -169,7 +169,7 @@
|
||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
<appender name="ThreadBasedLog" class="com.raytheon.uf.edex.log.ThreadBasedAppender">
|
<appender name="ThreadBasedLog" class="com.raytheon.uf.edex.log.ThreadBasedAppender">
|
||||||
<param name="ThreadPatterns" value="RadarLog:radarThreadPool.*;SatelliteLog:satelliteThreadPool.*;ShefLog:shefThreadPool.*;TextLog:textThreadPool.*;SmartInitLog:smartInit.*;PurgeLog:Purge.*;ArchiveLog:Archive.*"/>
|
<param name="ThreadPatterns" value="RadarLog:Ingest.Radar.*;SatelliteLog:Ingest.Satellite.*;ShefLog:Ingest.Shef.*;TextLog:Ingest.Text.*;SmartInitLog:smartInit.*;PurgeLog:Purge.*;ArchiveLog:Archive.*"/>
|
||||||
<param name="DefaultAppender" value="asyncConsole"/>
|
<param name="DefaultAppender" value="asyncConsole"/>
|
||||||
<appender-ref ref="asyncConsole"/>
|
<appender-ref ref="asyncConsole"/>
|
||||||
<appender-ref ref="RadarLog"/>
|
<appender-ref ref="RadarLog"/>
|
||||||
|
|
|
@ -64,7 +64,7 @@
|
||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
<appender name="ThreadBasedLog" class="com.raytheon.uf.edex.log.ThreadBasedAppender">
|
<appender name="ThreadBasedLog" class="com.raytheon.uf.edex.log.ThreadBasedAppender">
|
||||||
<param name="ThreadPatterns" value="HarvesterLog:harvesterThreadPool.*,crawlerThreadPool.*,Crawler.*"/>
|
<param name="ThreadPatterns" value="HarvesterLog:harvester.*,crawlerThreadPool.*,Crawler.*"/>
|
||||||
<param name="DefaultAppender" value="console"/>
|
<param name="DefaultAppender" value="console"/>
|
||||||
<appender-ref ref="console"/>
|
<appender-ref ref="console"/>
|
||||||
<appender-ref ref="HarvesterLog"/>
|
<appender-ref ref="HarvesterLog"/>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
|
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
|
||||||
<!-- general application log -->
|
<!-- general application log -->
|
||||||
<appender name="console" class="org.apache.log4j.ConsoleAppender">
|
<appender name="console" class="org.apache.log4j.ConsoleAppender">
|
||||||
<param name="Threshold" value="INFO" />
|
<param name="Threshold" value="INFO" />
|
||||||
<layout class="org.apache.log4j.PatternLayout">
|
<layout class="org.apache.log4j.PatternLayout">
|
||||||
<param name="ConversionPattern" value="%-5p %d [%t] %c{1}: %m%n"/>
|
<param name="ConversionPattern" value="%-5p %d [%t] %c{1}: %m%n"/>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
|
@ -120,10 +120,11 @@
|
||||||
<include>shef-ingest.xml</include>
|
<include>shef-ingest.xml</include>
|
||||||
<include>persist-ingest.xml</include>
|
<include>persist-ingest.xml</include>
|
||||||
<include>obs-common.xml</include>
|
<include>obs-common.xml</include>
|
||||||
<include>obs-ingest.xml</include>
|
<include>obs-ingest.xml</include>
|
||||||
<include>metartohmdb-plugin.xml</include>
|
<include>metartohmdb-plugin.xml</include>
|
||||||
<include>pointdata-common.xml</include>
|
<include>pointdata-common.xml</include>
|
||||||
<include>shef-common.xml</include>
|
<include>shef-common.xml</include>
|
||||||
|
<include>ohd-common-database.xml</include>
|
||||||
<include>ohd-common.xml</include>
|
<include>ohd-common.xml</include>
|
||||||
<include>alarmWhfs-spring.xml</include>
|
<include>alarmWhfs-spring.xml</include>
|
||||||
<include>arealffgGenerator-spring.xml</include>
|
<include>arealffgGenerator-spring.xml</include>
|
||||||
|
@ -148,6 +149,7 @@
|
||||||
<exclude>fssobs-common.xml</exclude>
|
<exclude>fssobs-common.xml</exclude>
|
||||||
</mode>
|
</mode>
|
||||||
<mode name="requestHydro">
|
<mode name="requestHydro">
|
||||||
|
<include>ohd-common-database.xml</include>
|
||||||
<include>ohd-common.xml</include>
|
<include>ohd-common.xml</include>
|
||||||
<include>database-common.xml</include>
|
<include>database-common.xml</include>
|
||||||
<include>ohd-request.xml</include>
|
<include>ohd-request.xml</include>
|
||||||
|
@ -232,6 +234,7 @@
|
||||||
<include>shef-common.xml</include>
|
<include>shef-common.xml</include>
|
||||||
<include>satellite-common.xml</include>
|
<include>satellite-common.xml</include>
|
||||||
<include>satellite-dataplugin-common.xml</include>
|
<include>satellite-dataplugin-common.xml</include>
|
||||||
|
<include>ohd-common-database.xml</include>
|
||||||
<include>ohd-common.xml</include>
|
<include>ohd-common.xml</include>
|
||||||
<include>management-common.xml</include>
|
<include>management-common.xml</include>
|
||||||
<include>auth-common.xml</include>
|
<include>auth-common.xml</include>
|
||||||
|
|
|
@ -14,33 +14,30 @@
|
||||||
<!-- specify the connection to the broker (qpid) -->
|
<!-- specify the connection to the broker (qpid) -->
|
||||||
<!-- MaxPrefetch set at 0, due to DataPool routers getting messages backed up behind long running tasks -->
|
<!-- MaxPrefetch set at 0, due to DataPool routers getting messages backed up behind long running tasks -->
|
||||||
<bean id="amqConnectionFactory" class="org.apache.qpid.client.AMQConnectionFactory">
|
<bean id="amqConnectionFactory" class="org.apache.qpid.client.AMQConnectionFactory">
|
||||||
<constructor-arg type="java.lang.String" value="amqp://guest:guest@/${JMS_VIRTUALHOST}?brokerlist='tcp://${BROKER_ADDR}?retries='9999'&connecttimeout='5000'&connectdelay='5000''&maxprefetch='0'&sync_publish='all'&sync_ack='true'"/>
|
<constructor-arg type="java.lang.String" value="amqp://guest:guest@/${JMS_VIRTUALHOST}?brokerlist='tcp://${BROKER_ADDR}?retries='9999'&heartbeat='0'&connecttimeout='5000'&connectdelay='5000''&maxprefetch='0'&sync_publish='all'&sync_ack='true'"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="jmsPooledConnectionFactory" class="com.raytheon.uf.common.jms.JmsPooledConnectionFactory">
|
<bean id="jmsPooledConnectionFactory" class="com.raytheon.uf.common.jms.JmsPooledConnectionFactory">
|
||||||
<constructor-arg ref="amqConnectionFactory"/>
|
<constructor-arg ref="amqConnectionFactory"/>
|
||||||
<property name="provider" value="QPID"/>
|
<property name="provider" value="QPID"/>
|
||||||
<property name="reconnectInterval" value="5000"/>
|
<property name="reconnectInterval" value="5000"/>
|
||||||
<!-- After connection has been closed by thread keep it allocated for another 90 seconds in case thread needs it again -->
|
<!-- After resource has been closed by thread keep it allocated for another 2 minutes in case thread needs it again -->
|
||||||
<property name="connectionHoldTime" value="90000"/>
|
<property name="resourceRetention" value="120000"/>
|
||||||
<!-- Any resource that has been available in the pool for more than 1 minute will be closed -->
|
|
||||||
<property name="resourceRetention" value="60000"/>
|
|
||||||
<property name="maxSpareConnections" value="10"/>
|
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="genericThreadPool"
|
<bean id="genericThreadPool"
|
||||||
class="com.raytheon.uf.edex.esb.camel.spring.JmsThreadPoolTaskExecutor">
|
class="com.raytheon.uf.edex.esb.camel.spring.JmsThreadPoolTaskExecutor">
|
||||||
<property name="corePoolSize" value="${JMS_POOL_MIN}" />
|
<property name="corePoolSize" value="0" />
|
||||||
<property name="maxPoolSize" value="${JMS_POOL_MAX}" />
|
<property name="maxPoolSize" value="1" />
|
||||||
<property name="queueCapacity" value="0" />
|
<property name="queueCapacity" value="0" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="jms-generic" class="org.apache.camel.component.jms.JmsComponent">
|
<bean id="jms-generic" class="com.raytheon.uf.edex.esb.camel.jms.DedicatedThreadJmsComponent">
|
||||||
<constructor-arg ref="jmsGenericConfig" />
|
<constructor-arg ref="jmsGenericConfig" />
|
||||||
<property name="taskExecutor" ref="genericThreadPool" />
|
<property name="taskExecutor" ref="genericThreadPool" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="jms-durable" class="org.apache.camel.component.jms.JmsComponent">
|
<bean id="jms-durable" class="com.raytheon.uf.edex.esb.camel.jms.DedicatedThreadJmsComponent">
|
||||||
<constructor-arg ref="jmsDurableConfig" />
|
<constructor-arg ref="jmsDurableConfig" />
|
||||||
<property name="taskExecutor" ref="genericThreadPool" />
|
<property name="taskExecutor" ref="genericThreadPool" />
|
||||||
</bean>
|
</bean>
|
||||||
|
@ -66,13 +63,13 @@
|
||||||
|
|
||||||
<bean id="jmsConfig" class="org.apache.camel.component.jms.JmsConfiguration">
|
<bean id="jmsConfig" class="org.apache.camel.component.jms.JmsConfiguration">
|
||||||
<property name="cacheLevelName" value="CACHE_NONE"/>
|
<property name="cacheLevelName" value="CACHE_NONE"/>
|
||||||
<property name="recoveryInterval" value="1000"/>
|
<property name="recoveryInterval" value="10000"/>
|
||||||
<property name="requestTimeout" value="5000"/>
|
<property name="requestTimeout" value="5000"/>
|
||||||
|
|
||||||
<!-- receiveTimeout is amount of time thread waits to receive a message before recycling -->
|
<!-- receiveTimeout is amount of time thread waits to receive a message before recycling -->
|
||||||
<!-- receiveTimeout also affects how fast a JMSConsumer will shut down, because the
|
<!-- receiveTimeout also affects how fast a JMSConsumer will shut down, because the
|
||||||
thread may be stuck polling for the duration of receiveTimeout before shutting down -->
|
thread may be stuck polling for the duration of receiveTimeout before shutting down -->
|
||||||
<property name="receiveTimeout" value="10000"/>
|
<property name="receiveTimeout" value="10000"/>
|
||||||
<property name="transacted" value="false"/>
|
<property name="transacted" value="false"/>
|
||||||
|
|
||||||
<!-- force maxMessagesPerTask so that the threads don't keep disconnecting and reconnecting.
|
<!-- force maxMessagesPerTask so that the threads don't keep disconnecting and reconnecting.
|
||||||
|
@ -83,6 +80,7 @@
|
||||||
<property name="destinationResolver" ref="qpidNoDurableResolver" />
|
<property name="destinationResolver" ref="qpidNoDurableResolver" />
|
||||||
<property name="disableReplyTo" value="true" />
|
<property name="disableReplyTo" value="true" />
|
||||||
<property name="deliveryPersistent" value="false"/>
|
<property name="deliveryPersistent" value="false"/>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
<property name="transacted" value="true" />
|
<property name="transacted" value="true" />
|
||||||
<property name="acknowledgementModeName" value="TRANSACTED"/>
|
<property name="acknowledgementModeName" value="TRANSACTED"/>
|
||||||
|
@ -253,7 +251,7 @@
|
||||||
**
|
**
|
||||||
** http://camel.apache.org/enterprise-integration-patterns.html
|
** http://camel.apache.org/enterprise-integration-patterns.html
|
||||||
-->
|
-->
|
||||||
<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring" errorHandlerRef="errorHandler">
|
<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring" errorHandlerRef="errorHandler">
|
||||||
|
|
||||||
<!-- Route for edex to listen for utility updates -->
|
<!-- Route for edex to listen for utility updates -->
|
||||||
<route id="edexUtilityNotify">
|
<route id="edexUtilityNotify">
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<bean id="airepDistRegistry" factory-bean="distributionSrv"
|
<bean id="airepDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg value="airep" />
|
<constructor-arg value="airep" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.airep"/>
|
<constructor-arg value="jms-durable:queue:Ingest.airep"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="airepCamelRegistered" factory-bean="contextManager"
|
<bean id="airepCamelRegistered" factory-bean="contextManager"
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<bean id="binlightningDistRegistry" factory-bean="distributionSrv"
|
<bean id="binlightningDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg value="binlightning" />
|
<constructor-arg value="binlightning" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.binlightning" />
|
<constructor-arg value="jms-durable:queue:Ingest.binlightning" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="binlightningCamelRegistered" factory-bean="clusteredCamelContextMgr"
|
<bean id="binlightningCamelRegistered" factory-bean="clusteredCamelContextMgr"
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<bean id="bufrmosDistRegistry" factory-bean="distributionSrv"
|
<bean id="bufrmosDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg value="bufrmos" />
|
<constructor-arg value="bufrmos" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.bufrmos" />
|
<constructor-arg value="jms-durable:queue:Ingest.bufrmos" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="bufrmosCamelRegistered" factory-bean="contextManager"
|
<bean id="bufrmosCamelRegistered" factory-bean="contextManager"
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<bean id="bufruaDistRegistry" factory-bean="distributionSrv"
|
<bean id="bufruaDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg ref="bufruaPluginName" />
|
<constructor-arg ref="bufruaPluginName" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.bufrua" />
|
<constructor-arg value="jms-durable:queue:Ingest.bufrua" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="bufruaCamelRegistered" factory-bean="contextManager"
|
<bean id="bufruaCamelRegistered" factory-bean="contextManager"
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<bean id="ccfpDistRegistry" factory-bean="distributionSrv"
|
<bean id="ccfpDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg value="ccfp" />
|
<constructor-arg value="ccfp" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.ccfp" />
|
<constructor-arg value="jms-durable:queue:Ingest.ccfp" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="ccfpCamelRegistered" factory-bean="contextManager"
|
<bean id="ccfpCamelRegistered" factory-bean="contextManager"
|
||||||
|
|
|
@ -98,7 +98,7 @@
|
||||||
</route>
|
</route>
|
||||||
|
|
||||||
<route id="notifyGridParmManager">
|
<route id="notifyGridParmManager">
|
||||||
<from uri="jms-generic:topic:edex.alerts.gfe" />
|
<from uri="jms-generic:topic:edex.alerts.gfe?threadName=gfeGridParmMgr-edex.alerts.gfe" />
|
||||||
<doTry>
|
<doTry>
|
||||||
<bean ref="serializationUtil" method="transformFromThrift" />
|
<bean ref="serializationUtil" method="transformFromThrift" />
|
||||||
<bean ref="gridParmManager" method="processNotification" />
|
<bean ref="gridParmManager" method="processNotification" />
|
||||||
|
|
|
@ -460,17 +460,11 @@
|
||||||
|
|
||||||
<bean id="iscSendQueue" class="com.raytheon.edex.plugin.gfe.isc.IscSendQueue"
|
<bean id="iscSendQueue" class="com.raytheon.edex.plugin.gfe.isc.IscSendQueue"
|
||||||
factory-method="getInstance" />
|
factory-method="getInstance" />
|
||||||
<bean id="jms-iscsend" class="org.apache.camel.component.jms.JmsComponent">
|
|
||||||
<constructor-arg ref="jmsIscSendConfig" />
|
|
||||||
<property name="taskExecutor" ref="iscSendThreadPool" />
|
|
||||||
</bean>
|
|
||||||
<bean id="jmsIscSendConfig" class="org.apache.camel.component.jms.JmsConfiguration"
|
|
||||||
factory-bean="jmsDurableConfig" factory-method="copy"/>
|
|
||||||
<bean id="iscSendThreadPool"
|
<bean id="iscSendThreadPool"
|
||||||
class="com.raytheon.uf.edex.esb.camel.spring.JmsThreadPoolTaskExecutor">
|
class="com.raytheon.uf.edex.esb.camel.spring.JmsThreadPoolTaskExecutor">
|
||||||
<property name="corePoolSize" value="2" />
|
<property name="corePoolSize" value="1" />
|
||||||
<property name="maxPoolSize" value="2" />
|
<property name="maxPoolSize" value="1" />
|
||||||
</bean>
|
</bean>
|
||||||
<bean id="iscSendSrvCfg" class="com.raytheon.edex.plugin.gfe.isc.SendIscSrvConfig">
|
<bean id="iscSendSrvCfg" class="com.raytheon.edex.plugin.gfe.isc.SendIscSrvConfig">
|
||||||
<property name="executor" ref="iscSendThreadPool"/>
|
<property name="executor" ref="iscSendThreadPool"/>
|
||||||
<!-- Threads should be 1 less than the size of the pool to account for the
|
<!-- Threads should be 1 less than the size of the pool to account for the
|
||||||
|
@ -486,17 +480,6 @@
|
||||||
|
|
||||||
<!-- ISC Receive Beans -->
|
<!-- ISC Receive Beans -->
|
||||||
|
|
||||||
<bean id="jms-iscrec" class="org.apache.camel.component.jms.JmsComponent">
|
|
||||||
<constructor-arg ref="jmsIscRecConfig" />
|
|
||||||
<property name="taskExecutor" ref="iscReceiveThreadPool" />
|
|
||||||
</bean>
|
|
||||||
<bean id="jmsIscRecConfig" class="org.apache.camel.component.jms.JmsConfiguration"
|
|
||||||
factory-bean="jmsDurableConfig" factory-method="copy"/>
|
|
||||||
<bean id="iscReceiveThreadPool"
|
|
||||||
class="com.raytheon.uf.edex.esb.camel.spring.JmsThreadPoolTaskExecutor">
|
|
||||||
<property name="corePoolSize" value="2" />
|
|
||||||
<property name="maxPoolSize" value="2" />
|
|
||||||
</bean>
|
|
||||||
<bean id="IscReceiveSrv" class="com.raytheon.edex.plugin.gfe.isc.IscReceiveSrv">
|
<bean id="IscReceiveSrv" class="com.raytheon.edex.plugin.gfe.isc.IscReceiveSrv">
|
||||||
<constructor-arg ref="iscDataRecPythonThreadPool" />
|
<constructor-arg ref="iscDataRecPythonThreadPool" />
|
||||||
</bean>
|
</bean>
|
||||||
|
@ -584,7 +567,7 @@
|
||||||
</route>
|
</route>
|
||||||
|
|
||||||
<route id="gfeSiteActivationNotification">
|
<route id="gfeSiteActivationNotification">
|
||||||
<from uri="jms-generic:topic:edex.alerts.siteActivate" />
|
<from uri="jms-generic:topic:edex.alerts.siteActivate?threadName=gfe-edex.alerts.siteActivate" />
|
||||||
<bean ref="serializationUtil" method="transformFromThrift" />
|
<bean ref="serializationUtil" method="transformFromThrift" />
|
||||||
<bean ref="sbLockMgr" method="handleSiteActivationNotification" />
|
<bean ref="sbLockMgr" method="handleSiteActivationNotification" />
|
||||||
</route>
|
</route>
|
||||||
|
@ -623,7 +606,7 @@
|
||||||
|
|
||||||
<!-- ISC Data Receive route -->
|
<!-- ISC Data Receive route -->
|
||||||
<route id="iscReceiveRoute">
|
<route id="iscReceiveRoute">
|
||||||
<from uri="jms-iscrec:queue:gfeIscDataReceive?concurrentConsumers=2"/>
|
<from uri="jms-durable:queue:gfeIscDataReceive?concurrentConsumers=2"/>
|
||||||
<doTry>
|
<doTry>
|
||||||
<pipeline>
|
<pipeline>
|
||||||
<bean ref="serializationUtil" method="transformFromThrift" />
|
<bean ref="serializationUtil" method="transformFromThrift" />
|
||||||
|
@ -643,7 +626,7 @@
|
||||||
errorHandlerRef="errorHandler" autoStartup="false">
|
errorHandlerRef="errorHandler" autoStartup="false">
|
||||||
|
|
||||||
<route id="iscSendJobQueueAggr">
|
<route id="iscSendJobQueueAggr">
|
||||||
<from uri="jms-iscsend:queue:iscSendNotification" />
|
<from uri="jms-durable:queue:iscSendNotification" />
|
||||||
<doTry>
|
<doTry>
|
||||||
<bean ref="serializationUtil" method="transformFromThrift" />
|
<bean ref="serializationUtil" method="transformFromThrift" />
|
||||||
<bean ref="iscSendQueue" method="addSendJobs" />
|
<bean ref="iscSendQueue" method="addSendJobs" />
|
||||||
|
|
|
@ -4,16 +4,10 @@
|
||||||
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
||||||
|
|
||||||
<bean id="smartInitQueue" class="com.raytheon.edex.plugin.gfe.smartinit.SmartInitQueue"/>
|
<bean id="smartInitQueue" class="com.raytheon.edex.plugin.gfe.smartinit.SmartInitQueue"/>
|
||||||
<bean id="jms-smartinit" class="org.apache.camel.component.jms.JmsComponent">
|
|
||||||
<constructor-arg ref="jmsSmartInitConfig" />
|
|
||||||
<property name="taskExecutor" ref="smartInitThreadPool" />
|
|
||||||
</bean>
|
|
||||||
<bean id="jmsSmartInitConfig" class="org.apache.camel.component.jms.JmsConfiguration" factory-bean="jmsDurableConfig"
|
|
||||||
factory-method="copy"/>
|
|
||||||
<bean id="smartInitThreadPool"
|
<bean id="smartInitThreadPool"
|
||||||
class="com.raytheon.uf.edex.esb.camel.spring.JmsThreadPoolTaskExecutor">
|
class="com.raytheon.uf.edex.esb.camel.spring.JmsThreadPoolTaskExecutor">
|
||||||
<property name="corePoolSize" value="${smartinit.threadpoolsize}" />
|
<property name="corePoolSize" value="${smartinit.threads}" />
|
||||||
<property name="maxPoolSize" value="${smartinit.threadpoolsize}" />
|
<property name="maxPoolSize" value="${smartinit.threads}" />
|
||||||
</bean>
|
</bean>
|
||||||
<bean id="smartInitSrvCfg" class="com.raytheon.edex.plugin.gfe.smartinit.SmartInitSrvConfig">
|
<bean id="smartInitSrvCfg" class="com.raytheon.edex.plugin.gfe.smartinit.SmartInitSrvConfig">
|
||||||
<property name="executor" ref="smartInitThreadPool"/>
|
<property name="executor" ref="smartInitThreadPool"/>
|
||||||
|
@ -93,7 +87,7 @@
|
||||||
<!-- Smart Init Routes -->
|
<!-- Smart Init Routes -->
|
||||||
<!-- main route now handled through the gfeIngestNotification -->
|
<!-- main route now handled through the gfeIngestNotification -->
|
||||||
<route id="manualSmartInit">
|
<route id="manualSmartInit">
|
||||||
<from uri="jms-smartinit:queue:manualSmartInit" />
|
<from uri="jms-durable:queue:manualSmartInit?threadName=smartInitManual" />
|
||||||
<doTry>
|
<doTry>
|
||||||
<bean ref="smartInitQueue" method="addManualInit" />
|
<bean ref="smartInitQueue" method="addManualInit" />
|
||||||
<doCatch>
|
<doCatch>
|
||||||
|
@ -104,7 +98,7 @@
|
||||||
</route>
|
</route>
|
||||||
|
|
||||||
<route id="gfeVtecChangeNotification">
|
<route id="gfeVtecChangeNotification">
|
||||||
<from uri="jms-generic:topic:edex.alerts.vtec"/>
|
<from uri="jms-generic:topic:edex.alerts.vtec?threadName=gfe-edex.alerts.vtec"/>
|
||||||
<doTry>
|
<doTry>
|
||||||
<bean ref="serializationUtil" method="transformFromThrift" />
|
<bean ref="serializationUtil" method="transformFromThrift" />
|
||||||
<bean ref="vtecChangeListener" method="handleNotification" />
|
<bean ref="vtecChangeListener" method="handleNotification" />
|
||||||
|
@ -117,7 +111,7 @@
|
||||||
|
|
||||||
<!-- Convert the topic into a queue so only one consumer gets each message and we still have competing consumers. -->
|
<!-- Convert the topic into a queue so only one consumer gets each message and we still have competing consumers. -->
|
||||||
<route id="gfeDataURINotificationQueueRoute">
|
<route id="gfeDataURINotificationQueueRoute">
|
||||||
<from uri="jms-generic:topic:edex.alerts" />
|
<from uri="jms-generic:topic:edex.alerts?threadName=gfe-edex.alerts" />
|
||||||
<doTry>
|
<doTry>
|
||||||
<to uri="jms-durable:queue:gfeDataURINotification"/>
|
<to uri="jms-durable:queue:gfeDataURINotification"/>
|
||||||
<doCatch>
|
<doCatch>
|
||||||
|
|
|
@ -59,9 +59,10 @@ import com.raytheon.uf.edex.database.dao.DaoConfig;
|
||||||
*
|
*
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Oct 20, 2011 dgilling Initial creation
|
* Oct 20, 2011 dgilling Initial creation
|
||||||
* May 08, 2012 #600 dgilling Re-work logic for handling PENDING
|
* May 08, 2012 600 dgilling Re-work logic for handling PENDING
|
||||||
* records.
|
* records.
|
||||||
|
* Feb 07, 2014 2357 rjpeter iscSendNotification uri.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -74,9 +75,9 @@ public class IscSendQueue {
|
||||||
// how we'll organize the temporary queue
|
// how we'll organize the temporary queue
|
||||||
private class JobSetQueueKey {
|
private class JobSetQueueKey {
|
||||||
|
|
||||||
private ParmID pid;
|
private final ParmID pid;
|
||||||
|
|
||||||
private IscSendState state;
|
private final IscSendState state;
|
||||||
|
|
||||||
public JobSetQueueKey(ParmID pid, IscSendState state) {
|
public JobSetQueueKey(ParmID pid, IscSendState state) {
|
||||||
this.pid = pid;
|
this.pid = pid;
|
||||||
|
@ -92,8 +93,9 @@ public class IscSendQueue {
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
int result = 1;
|
int result = 1;
|
||||||
result = prime * result + ((pid == null) ? 0 : pid.hashCode());
|
result = (prime * result) + ((pid == null) ? 0 : pid.hashCode());
|
||||||
result = prime * result + ((state == null) ? 0 : state.hashCode());
|
result = (prime * result)
|
||||||
|
+ ((state == null) ? 0 : state.hashCode());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,7 +150,7 @@ public class IscSendQueue {
|
||||||
|
|
||||||
private int timeoutMillis = 60000;
|
private int timeoutMillis = 60000;
|
||||||
|
|
||||||
private Map<JobSetQueueKey, List<IscSendRecord>> jobSet = new HashMap<JobSetQueueKey, List<IscSendRecord>>();
|
private final Map<JobSetQueueKey, List<IscSendRecord>> jobSet = new HashMap<JobSetQueueKey, List<IscSendRecord>>();
|
||||||
|
|
||||||
private static final IscSendQueue instance = new IscSendQueue();
|
private static final IscSendQueue instance = new IscSendQueue();
|
||||||
|
|
||||||
|
@ -168,7 +170,7 @@ public class IscSendQueue {
|
||||||
try {
|
try {
|
||||||
byte[] messages = SerializationUtil.transformToThrift(sendJobs);
|
byte[] messages = SerializationUtil.transformToThrift(sendJobs);
|
||||||
EDEXUtil.getMessageProducer().sendAsyncUri(
|
EDEXUtil.getMessageProducer().sendAsyncUri(
|
||||||
"jms-iscsend:queue:iscSendNotification", messages);
|
"jms-durable:queue:iscSendNotification", messages);
|
||||||
} catch (SerializationException e) {
|
} catch (SerializationException e) {
|
||||||
handler.error("Unable to serialize IscSendRecords.", e);
|
handler.error("Unable to serialize IscSendRecords.", e);
|
||||||
} catch (EdexException e) {
|
} catch (EdexException e) {
|
||||||
|
@ -238,7 +240,7 @@ public class IscSendQueue {
|
||||||
|
|
||||||
// Now combine time ranges if we can
|
// Now combine time ranges if we can
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (i <= pending.size() - 2) {
|
while (i <= (pending.size() - 2)) {
|
||||||
TimeRange time = pending.get(i).getTimeRange();
|
TimeRange time = pending.get(i).getTimeRange();
|
||||||
TimeRange time1 = pending.get(i + 1).getTimeRange();
|
TimeRange time1 = pending.get(i + 1).getTimeRange();
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<bean id="goessoundingDistRegistry" factory-bean="distributionSrv"
|
<bean id="goessoundingDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg ref="goessoundingPluginName" />
|
<constructor-arg ref="goessoundingPluginName" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.goessounding"/>
|
<constructor-arg value="jms-durable:queue:Ingest.goessounding"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="goessoundingCamelRegistered" factory-bean="contextManager"
|
<bean id="goessoundingCamelRegistered" factory-bean="contextManager"
|
||||||
|
|
|
@ -5,18 +5,6 @@
|
||||||
|
|
||||||
<bean id="gribDecoder" class="com.raytheon.edex.plugin.grib.GribDecoder" />
|
<bean id="gribDecoder" class="com.raytheon.edex.plugin.grib.GribDecoder" />
|
||||||
|
|
||||||
<bean id="ingest-grib" class="org.apache.camel.component.jms.JmsComponent">
|
|
||||||
<constructor-arg ref="jmsGribConfig" />
|
|
||||||
<property name="taskExecutor" ref="gribThreadPool" />
|
|
||||||
</bean>
|
|
||||||
<bean id="jmsGribConfig" class="org.apache.camel.component.jms.JmsConfiguration"
|
|
||||||
factory-bean="jmsDurableConfig" factory-method="copy"/>
|
|
||||||
<bean id="gribThreadPool"
|
|
||||||
class="com.raytheon.uf.edex.esb.camel.spring.JmsThreadPoolTaskExecutor">
|
|
||||||
<property name="corePoolSize" value="${grib-decode.count.threads}" />
|
|
||||||
<property name="maxPoolSize" value="${grib-decode.count.threads}" />
|
|
||||||
</bean>
|
|
||||||
|
|
||||||
<bean id="largeFileChecker" class="com.raytheon.edex.plugin.grib.GribLargeFileChecker" />
|
<bean id="largeFileChecker" class="com.raytheon.edex.plugin.grib.GribLargeFileChecker" />
|
||||||
|
|
||||||
<bean id="gribSplitter" class="com.raytheon.edex.plugin.grib.GribSplitter">
|
<bean id="gribSplitter" class="com.raytheon.edex.plugin.grib.GribSplitter">
|
||||||
|
@ -58,7 +46,7 @@
|
||||||
autoStartup="false">
|
autoStartup="false">
|
||||||
|
|
||||||
<endpoint id="gribFileEndpoint" uri="file:${edex.home}/data/sbn/grib?noop=true&idempotent=false" />
|
<endpoint id="gribFileEndpoint" uri="file:${edex.home}/data/sbn/grib?noop=true&idempotent=false" />
|
||||||
<endpoint id="gribJmsEndpoint" uri="ingest-grib:queue:Ingest.Grib?concurrentConsumers=${grib-decode.count.threads}"/>
|
<endpoint id="gribJmsEndpoint" uri="jms-durable:queue:Ingest.Grib?concurrentConsumers=${grib-decode.count.threads}"/>
|
||||||
|
|
||||||
<route id="gribFileConsumerRoute">
|
<route id="gribFileConsumerRoute">
|
||||||
<from ref="gribFileEndpoint" />
|
<from ref="gribFileEndpoint" />
|
||||||
|
@ -67,7 +55,7 @@
|
||||||
<setHeader headerName="pluginName">
|
<setHeader headerName="pluginName">
|
||||||
<constant>grid</constant>
|
<constant>grid</constant>
|
||||||
</setHeader>
|
</setHeader>
|
||||||
<to uri="ingest-grib:queue:Ingest.Grib" />
|
<to uri="jms-durable:queue:Ingest.Grib" />
|
||||||
</route>
|
</route>
|
||||||
|
|
||||||
<!-- Begin Grib Decode Route -->
|
<!-- Begin Grib Decode Route -->
|
||||||
|
@ -108,7 +96,7 @@
|
||||||
</doTry>
|
</doTry>
|
||||||
</when>
|
</when>
|
||||||
<otherwise>
|
<otherwise>
|
||||||
<to uri="ingest-grib:queue:Ingest.Grib" />
|
<to uri="jms-durable:queue:Ingest.Grib" />
|
||||||
</otherwise>
|
</otherwise>
|
||||||
</choice>
|
</choice>
|
||||||
</split>
|
</split>
|
||||||
|
|
|
@ -5,18 +5,6 @@
|
||||||
|
|
||||||
<bean id="gribDecoder" class="com.raytheon.edex.plugin.grib.GribDecoder" />
|
<bean id="gribDecoder" class="com.raytheon.edex.plugin.grib.GribDecoder" />
|
||||||
|
|
||||||
<bean id="ingest-grib" class="org.apache.camel.component.jms.JmsComponent">
|
|
||||||
<constructor-arg ref="jmsGribConfig" />
|
|
||||||
<property name="taskExecutor" ref="gribThreadPool" />
|
|
||||||
</bean>
|
|
||||||
<bean id="jmsGribConfig" class="org.apache.camel.component.jms.JmsConfiguration"
|
|
||||||
factory-bean="jmsDurableConfig" factory-method="copy"/>
|
|
||||||
<bean id="gribThreadPool"
|
|
||||||
class="com.raytheon.uf.edex.esb.camel.spring.JmsThreadPoolTaskExecutor">
|
|
||||||
<property name="corePoolSize" value="${grib-decode.count.threads}" />
|
|
||||||
<property name="maxPoolSize" value="${grib-decode.count.threads}" />
|
|
||||||
</bean>
|
|
||||||
|
|
||||||
<bean id="largeFileChecker" class="com.raytheon.edex.plugin.grib.GribLargeFileChecker" />
|
<bean id="largeFileChecker" class="com.raytheon.edex.plugin.grib.GribLargeFileChecker" />
|
||||||
|
|
||||||
<bean id="gribSplitter" class="com.raytheon.edex.plugin.grib.GribSplitter">
|
<bean id="gribSplitter" class="com.raytheon.edex.plugin.grib.GribSplitter">
|
||||||
|
@ -54,7 +42,7 @@
|
||||||
autoStartup="false">
|
autoStartup="false">
|
||||||
|
|
||||||
<endpoint id="gribFileEndpoint" uri="file:${edex.home}/data/sbn/grib?noop=true&idempotent=false" />
|
<endpoint id="gribFileEndpoint" uri="file:${edex.home}/data/sbn/grib?noop=true&idempotent=false" />
|
||||||
<endpoint id="gribJmsEndpoint" uri="ingest-grib:queue:Ingest.Grib?concurrentConsumers=${grib-decode.count.threads}"/>
|
<endpoint id="gribJmsEndpoint" uri="jms-durable:queue:Ingest.Grib?concurrentConsumers=${grib-decode.count.threads}"/>
|
||||||
|
|
||||||
<route id="gribFileConsumerRoute">
|
<route id="gribFileConsumerRoute">
|
||||||
<from ref="gribFileEndpoint" />
|
<from ref="gribFileEndpoint" />
|
||||||
|
@ -63,7 +51,7 @@
|
||||||
<setHeader headerName="pluginName">
|
<setHeader headerName="pluginName">
|
||||||
<constant>grid</constant>
|
<constant>grid</constant>
|
||||||
</setHeader>
|
</setHeader>
|
||||||
<to uri="ingest-grib:queue:Ingest.Grib" />
|
<to uri="jms-durable:queue:Ingest.Grib" />
|
||||||
</route>
|
</route>
|
||||||
|
|
||||||
<!-- Begin Grib Decode Route -->
|
<!-- Begin Grib Decode Route -->
|
||||||
|
@ -99,7 +87,7 @@
|
||||||
</doTry>
|
</doTry>
|
||||||
</when>
|
</when>
|
||||||
<otherwise>
|
<otherwise>
|
||||||
<to uri="ingest-grib:queue:Ingest.Grib" />
|
<to uri="jms-durable:queue:Ingest.Grib" />
|
||||||
</otherwise>
|
</otherwise>
|
||||||
</choice>
|
</choice>
|
||||||
</split>
|
</split>
|
||||||
|
|
|
@ -4,6 +4,6 @@
|
||||||
<bean id="gribDistRegistry" factory-bean="distributionSrv"
|
<bean id="gribDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg value="grib" />
|
<constructor-arg value="grib" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.Grib" />
|
<constructor-arg value="jms-durable:queue:Ingest.Grib" />
|
||||||
</bean>
|
</bean>
|
||||||
</beans>
|
</beans>
|
|
@ -8,7 +8,7 @@
|
||||||
<bean id="ldadDistRegistry" factory-bean="distributionSrv"
|
<bean id="ldadDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg value="ldad" />
|
<constructor-arg value="ldad" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.ldad" />
|
<constructor-arg value="jms-durable:queue:Ingest.ldad" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<camelContext id="ldad-camel"
|
<camelContext id="ldad-camel"
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
<bean id="ldadhydroDistRegistry" factory-bean="distributionSrv"
|
<bean id="ldadhydroDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg value="ldadhydro" />
|
<constructor-arg value="ldadhydro" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.ldadhydro" />
|
<constructor-arg value="jms-durable:queue:Ingest.ldadhydro" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="ldadhydroPointData" class="com.raytheon.edex.plugin.ldadhydro.dao.LdadhydroPointDataTransform"/>
|
<bean id="ldadhydroPointData" class="com.raytheon.edex.plugin.ldadhydro.dao.LdadhydroPointDataTransform"/>
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<bean id="ldadmanualDistRegistry" factory-bean="distributionSrv"
|
<bean id="ldadmanualDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg value="ldadmanual" />
|
<constructor-arg value="ldadmanual" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.ldadmanual"/>
|
<constructor-arg value="jms-durable:queue:Ingest.ldadmanual"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="ldadmanualCamelRegistered" factory-bean="contextManager"
|
<bean id="ldadmanualCamelRegistered" factory-bean="contextManager"
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
<bean id="ldadprofilerDistRegistry" factory-bean="distributionSrv"
|
<bean id="ldadprofilerDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg value="ldadprofiler" />
|
<constructor-arg value="ldadprofiler" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.ldadprofiler"/>
|
<constructor-arg value="jms-durable:queue:Ingest.ldadprofiler"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="ldadprofilerCamelRegistered" factory-bean="contextManager"
|
<bean id="ldadprofilerCamelRegistered" factory-bean="contextManager"
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
<bean id="mdlsndgDistRegistry" factory-bean="distributionSrv"
|
<bean id="mdlsndgDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg ref="modelsoundingPluginName" />
|
<constructor-arg ref="modelsoundingPluginName" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.modelsounding"/>
|
<constructor-arg value="jms-durable:queue:Ingest.modelsounding"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="modelsoundingCamelRegistered" factory-bean="contextManager"
|
<bean id="modelsoundingCamelRegistered" factory-bean="contextManager"
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
<bean id="obsDistRegistry" factory-bean="distributionSrv" factory-method="register">
|
<bean id="obsDistRegistry" factory-bean="distributionSrv" factory-method="register">
|
||||||
<constructor-arg value="obs" />
|
<constructor-arg value="obs" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.obs" />
|
<constructor-arg value="jms-durable:queue:Ingest.obs" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="obsCamelRegistered" factory-bean="contextManager" factory-method="register"
|
<bean id="obsCamelRegistered" factory-bean="contextManager" factory-method="register"
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
<bean id="pirepDistRegistry" factory-bean="distributionSrv"
|
<bean id="pirepDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg value="pirep" />
|
<constructor-arg value="pirep" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.pirep" />
|
<constructor-arg value="jms-durable:queue:Ingest.pirep" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="pirepCamelRegistered" factory-bean="contextManager"
|
<bean id="pirepCamelRegistered" factory-bean="contextManager"
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<bean id="poessoundingDistRegistry" factory-bean="distributionSrv"
|
<bean id="poessoundingDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg ref="poessoundingPluginName" />
|
<constructor-arg ref="poessoundingPluginName" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.poessounding"/>
|
<constructor-arg value="jms-durable:queue:Ingest.poessounding"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="poessoundingCamelRegistered" factory-bean="contextManager"
|
<bean id="poessoundingCamelRegistered" factory-bean="contextManager"
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<bean id="profilerDistRegistry" factory-bean="distributionSrv"
|
<bean id="profilerDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg ref="profilerPluginName" />
|
<constructor-arg ref="profilerPluginName" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.profiler"/>
|
<constructor-arg value="jms-durable:queue:Ingest.profiler"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="profilerCamelRegistered" factory-bean="contextManager"
|
<bean id="profilerCamelRegistered" factory-bean="contextManager"
|
||||||
|
|
|
@ -5,28 +5,17 @@
|
||||||
|
|
||||||
<bean id="radarDecompressor" class="com.raytheon.edex.plugin.radar.RadarDecompressor"/>
|
<bean id="radarDecompressor" class="com.raytheon.edex.plugin.radar.RadarDecompressor"/>
|
||||||
<bean id="radarDecoder" class="com.raytheon.edex.plugin.radar.RadarDecoder"/>
|
<bean id="radarDecoder" class="com.raytheon.edex.plugin.radar.RadarDecoder"/>
|
||||||
<bean id="jms-radar" class="org.apache.camel.component.jms.JmsComponent">
|
|
||||||
<constructor-arg ref="jmsRadarConfig" />
|
|
||||||
<property name="taskExecutor" ref="radarThreadPool" />
|
|
||||||
</bean>
|
|
||||||
<bean id="jmsRadarConfig" class="org.apache.camel.component.jms.JmsConfiguration"
|
|
||||||
factory-bean="jmsDurableConfig" factory-method="copy"/>
|
|
||||||
<bean id="radarThreadPool"
|
|
||||||
class="com.raytheon.uf.edex.esb.camel.spring.JmsThreadPoolTaskExecutor">
|
|
||||||
<property name="corePoolSize" value="2" />
|
|
||||||
<property name="maxPoolSize" value="2" />
|
|
||||||
</bean>
|
|
||||||
|
|
||||||
<bean id="radarDistRegistry" factory-bean="distributionSrv"
|
<bean id="radarDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg value="radar" />
|
<constructor-arg value="radar" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.Radar" />
|
<constructor-arg value="jms-durable:queue:Ingest.Radar" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="radarRadarServerDistRegistry" factory-bean="radarserverDistributionSrv"
|
<bean id="radarRadarServerDistRegistry" factory-bean="radarserverDistributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg value="radar" />
|
<constructor-arg value="radar" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.RadarRadarServer" />
|
<constructor-arg value="jms-durable:queue:Ingest.RadarRadarServer" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="radarCamelRegistered" factory-bean="contextManager"
|
<bean id="radarCamelRegistered" factory-bean="contextManager"
|
||||||
|
@ -47,13 +36,13 @@
|
||||||
<setHeader headerName="pluginName">
|
<setHeader headerName="pluginName">
|
||||||
<constant>radar</constant>
|
<constant>radar</constant>
|
||||||
</setHeader>
|
</setHeader>
|
||||||
<to uri="jms-radar:queue:Ingest.Radar" />
|
<to uri="jms-durable:queue:Ingest.Radar" />
|
||||||
</route>
|
</route>
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<!-- Begin Radar routes -->
|
<!-- Begin Radar routes -->
|
||||||
<route id="radarIngestRoute">
|
<route id="radarIngestRoute">
|
||||||
<from uri="jms-radar:queue:Ingest.Radar"/>
|
<from uri="jms-durable:queue:Ingest.Radar"/>
|
||||||
<setHeader headerName="dataType">
|
<setHeader headerName="dataType">
|
||||||
<constant>radar-sbn</constant>
|
<constant>radar-sbn</constant>
|
||||||
</setHeader>
|
</setHeader>
|
||||||
|
@ -61,7 +50,7 @@
|
||||||
</route>
|
</route>
|
||||||
|
|
||||||
<route id="radarRadarServerIngestRoute">
|
<route id="radarRadarServerIngestRoute">
|
||||||
<from uri="jms-radar:queue:Ingest.RadarRadarServer"/>
|
<from uri="jms-durable:queue:Ingest.RadarRadarServer"/>
|
||||||
<setHeader headerName="dataType">
|
<setHeader headerName="dataType">
|
||||||
<constant>radar-local</constant>
|
<constant>radar-local</constant>
|
||||||
</setHeader>
|
</setHeader>
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<bean id="reccoDistRegistry" factory-bean="distributionSrv"
|
<bean id="reccoDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg ref="reccoPluginName" />
|
<constructor-arg ref="reccoPluginName" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.recco" />
|
<constructor-arg value="jms-durable:queue:Ingest.recco" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="reccoCamelRegistered" factory-bean="contextManager"
|
<bean id="reccoCamelRegistered" factory-bean="contextManager"
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<bean id="redbookDistRegistry" factory-bean="distributionSrv"
|
<bean id="redbookDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg value="redbook" />
|
<constructor-arg value="redbook" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.redbook"/>
|
<constructor-arg value="jms-durable:queue:Ingest.redbook"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
|
|
@ -3,18 +3,6 @@
|
||||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
||||||
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
||||||
|
|
||||||
<bean id="jms-satellite" class="org.apache.camel.component.jms.JmsComponent">
|
|
||||||
<constructor-arg ref="jmsSatelliteConfig" />
|
|
||||||
<property name="taskExecutor" ref="satelliteThreadPool" />
|
|
||||||
</bean>
|
|
||||||
<bean id="jmsSatelliteConfig" class="org.apache.camel.component.jms.JmsConfiguration"
|
|
||||||
factory-bean="jmsDurableConfig" factory-method="copy"/>
|
|
||||||
<bean id="satelliteThreadPool"
|
|
||||||
class="com.raytheon.uf.edex.esb.camel.spring.JmsThreadPoolTaskExecutor">
|
|
||||||
<property name="corePoolSize" value="1" />
|
|
||||||
<property name="maxPoolSize" value="1" />
|
|
||||||
</bean>
|
|
||||||
|
|
||||||
<bean id="satelliteDecoder" class="com.raytheon.edex.plugin.satellite.SatelliteDecoder">
|
<bean id="satelliteDecoder" class="com.raytheon.edex.plugin.satellite.SatelliteDecoder">
|
||||||
<property name="dao" ref="satelliteDao" />
|
<property name="dao" ref="satelliteDao" />
|
||||||
</bean>
|
</bean>
|
||||||
|
@ -26,7 +14,7 @@
|
||||||
<bean id="satDistRegistry" factory-bean="distributionSrv"
|
<bean id="satDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg value="satellite" />
|
<constructor-arg value="satellite" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.Satellite" />
|
<constructor-arg value="jms-durable:queue:Ingest.Satellite" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="satCamelRegistered" factory-bean="contextManager"
|
<bean id="satCamelRegistered" factory-bean="contextManager"
|
||||||
|
@ -53,7 +41,7 @@
|
||||||
|
|
||||||
<!-- Begin Sat routes -->
|
<!-- Begin Sat routes -->
|
||||||
<route id="satIngestRoute">
|
<route id="satIngestRoute">
|
||||||
<from uri="jms-satellite:queue:Ingest.Satellite"/>
|
<from uri="jms-durable:queue:Ingest.Satellite"/>
|
||||||
<setHeader headerName="pluginName">
|
<setHeader headerName="pluginName">
|
||||||
<constant>satellite</constant>
|
<constant>satellite</constant>
|
||||||
</setHeader>
|
</setHeader>
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
<bean id="sfcobsDistRegistry" factory-bean="distributionSrv" factory-method="register">
|
<bean id="sfcobsDistRegistry" factory-bean="distributionSrv" factory-method="register">
|
||||||
<constructor-arg value="sfcobs" />
|
<constructor-arg value="sfcobs" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.sfcobs" />
|
<constructor-arg value="jms-durable:queue:Ingest.sfcobs" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="sfcobsCamelRegistered" factory-bean="contextManager" factory-method="register"
|
<bean id="sfcobsCamelRegistered" factory-bean="contextManager" factory-method="register"
|
||||||
|
|
|
@ -3,18 +3,6 @@
|
||||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
||||||
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
||||||
|
|
||||||
<bean id="jms-shef" class="org.apache.camel.component.jms.JmsComponent">
|
|
||||||
<constructor-arg ref="jmsShefConfig" />
|
|
||||||
<property name="taskExecutor" ref="shefThreadPool" />
|
|
||||||
</bean>
|
|
||||||
<bean id="jmsShefConfig" class="org.apache.camel.component.jms.JmsConfiguration"
|
|
||||||
factory-bean="jmsDurableConfig" factory-method="copy"/>
|
|
||||||
<bean id="shefThreadPool"
|
|
||||||
class="com.raytheon.uf.edex.esb.camel.spring.JmsThreadPoolTaskExecutor">
|
|
||||||
<property name="corePoolSize" value="3" />
|
|
||||||
<property name="maxPoolSize" value="3" />
|
|
||||||
</bean>
|
|
||||||
|
|
||||||
<bean id="shefDecoder" class="com.raytheon.edex.plugin.shef.ShefDecoder">
|
<bean id="shefDecoder" class="com.raytheon.edex.plugin.shef.ShefDecoder">
|
||||||
<constructor-arg value="shef" />
|
<constructor-arg value="shef" />
|
||||||
</bean>
|
</bean>
|
||||||
|
@ -47,13 +35,13 @@
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg value="shef" />
|
<constructor-arg value="shef" />
|
||||||
<constructor-arg
|
<constructor-arg
|
||||||
value="jms-dist:queue:Ingest.Shef"/>
|
value="jms-durable:queue:Ingest.Shef"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="shefHandleoupDistRegistry" factory-bean="handleoupDistributionSrv"
|
<bean id="shefHandleoupDistRegistry" factory-bean="handleoupDistributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg value="shef" />
|
<constructor-arg value="shef" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.Shef"/>
|
<constructor-arg value="jms-durable:queue:Ingest.Shef"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="shefCamelRegistered" factory-bean="contextManager"
|
<bean id="shefCamelRegistered" factory-bean="contextManager"
|
||||||
|
@ -92,7 +80,7 @@
|
||||||
<!-- Begin shef routes -->
|
<!-- Begin shef routes -->
|
||||||
<route id="shefIngestRoute">
|
<route id="shefIngestRoute">
|
||||||
<from
|
<from
|
||||||
uri="jms-shef:queue:Ingest.Shef"/>
|
uri="jms-durable:queue:Ingest.Shef"/>
|
||||||
<setHeader headerName="pluginName">
|
<setHeader headerName="pluginName">
|
||||||
<constant>shef</constant>
|
<constant>shef</constant>
|
||||||
</setHeader>
|
</setHeader>
|
||||||
|
@ -103,7 +91,7 @@
|
||||||
</route>
|
</route>
|
||||||
<route id="shefStagedRoute">
|
<route id="shefStagedRoute">
|
||||||
<from
|
<from
|
||||||
uri="jms-shef:queue:Ingest.ShefStaged"/>
|
uri="jms-durable:queue:Ingest.ShefStaged"/>
|
||||||
<setHeader headerName="pluginName">
|
<setHeader headerName="pluginName">
|
||||||
<constant>shef</constant>
|
<constant>shef</constant>
|
||||||
</setHeader>
|
</setHeader>
|
||||||
|
@ -155,7 +143,7 @@
|
||||||
|
|
||||||
<route id="shefManualIngestRoute">
|
<route id="shefManualIngestRoute">
|
||||||
<from
|
<from
|
||||||
uri="jms-shef:queue:Ingest.ShefManual"/>
|
uri="jms-durable:queue:Ingest.ShefManual"/>
|
||||||
<setHeader headerName="pluginName">
|
<setHeader headerName="pluginName">
|
||||||
<constant>shef</constant>
|
<constant>shef</constant>
|
||||||
</setHeader>
|
</setHeader>
|
||||||
|
|
|
@ -33,8 +33,6 @@ import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||||
|
|
||||||
import com.raytheon.edex.textdb.dbapi.impl.TextDB;
|
|
||||||
import com.raytheon.uf.common.dataplugin.text.request.WriteProductRequest;
|
|
||||||
import com.raytheon.uf.common.ohd.AppsDefaults;
|
import com.raytheon.uf.common.ohd.AppsDefaults;
|
||||||
import com.raytheon.uf.edex.core.EDEXUtil;
|
import com.raytheon.uf.edex.core.EDEXUtil;
|
||||||
|
|
||||||
|
@ -45,12 +43,11 @@ import com.raytheon.uf.edex.core.EDEXUtil;
|
||||||
* <pre>
|
* <pre>
|
||||||
*
|
*
|
||||||
* SOFTWARE HISTORY
|
* SOFTWARE HISTORY
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------- ---------- ----------- --------------------------
|
||||||
* June 15, 2011 9377 jnjanga Initial creation
|
* Jun 15, 2011 9377 jnjanga Initial creation.
|
||||||
* July 12, 2013 15711 wkwock Fix verbose, observe mode, etc
|
* Jul 12, 2013 15711 wkwock Fix verbose, observe mode, etc.
|
||||||
*
|
* Feb 10, 2014 2781 rjpeter Removed dead method.
|
||||||
*
|
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author jnjanga
|
* @author jnjanga
|
||||||
|
@ -88,7 +85,7 @@ public class AlertalarmStdTextProductUtil {
|
||||||
setCurrentReportfile();
|
setCurrentReportfile();
|
||||||
|
|
||||||
reportAlarm();
|
reportAlarm();
|
||||||
|
|
||||||
System.exit(reportWriter.getAlarmCount());
|
System.exit(reportWriter.getAlarmCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,7 +101,7 @@ public class AlertalarmStdTextProductUtil {
|
||||||
options.addOption(CmdlineOptionId.FILE_SUFFIX);
|
options.addOption(CmdlineOptionId.FILE_SUFFIX);
|
||||||
options.addOption(CmdlineOptionId.FLAGS);
|
options.addOption(CmdlineOptionId.FLAGS);
|
||||||
options.addOption(CmdlineOptionId.PE);
|
options.addOption(CmdlineOptionId.PE);
|
||||||
options.addOption(CmdlineOptionId.VERBOSE,false);
|
options.addOption(CmdlineOptionId.VERBOSE, false);
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -147,13 +144,14 @@ public class AlertalarmStdTextProductUtil {
|
||||||
String optName = optId.toString();
|
String optName = optId.toString();
|
||||||
System.out.println("optName = " + optName);
|
System.out.println("optName = " + optName);
|
||||||
if (optName.equalsIgnoreCase("v")) {
|
if (optName.equalsIgnoreCase("v")) {
|
||||||
if (line.hasOption(optName)) {
|
if (line.hasOption(optName)) {
|
||||||
System.out.println(" optValue = true");
|
System.out.println(" optValue = true");
|
||||||
} else {
|
} else {
|
||||||
System.out.println(" optValue = false");
|
System.out.println(" optValue = false");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
System.out.println(" optValue = " + line.getOptionValue(optName));
|
System.out.println(" optValue = "
|
||||||
|
+ line.getOptionValue(optName));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (line.hasOption(optName)) {
|
if (line.hasOption(optName)) {
|
||||||
|
@ -177,9 +175,10 @@ public class AlertalarmStdTextProductUtil {
|
||||||
ignoreMin.add(ReportMode.NEAREST);
|
ignoreMin.add(ReportMode.NEAREST);
|
||||||
ignoreMin.add(ReportMode.LATEST_MAXFCST);
|
ignoreMin.add(ReportMode.LATEST_MAXFCST);
|
||||||
if (rptOptions.isMinutesGiven()
|
if (rptOptions.isMinutesGiven()
|
||||||
&& ignoreMin.contains(rptOptions.getMode()))
|
&& ignoreMin.contains(rptOptions.getMode())) {
|
||||||
System.out
|
System.out
|
||||||
.println("Usage : -m<minutes> value ignored for this -r<report_mode>");
|
.println("Usage : -m<minutes> value ignored for this -r<report_mode>");
|
||||||
|
}
|
||||||
|
|
||||||
reportOptions = rptOptions;
|
reportOptions = rptOptions;
|
||||||
|
|
||||||
|
@ -191,9 +190,11 @@ public class AlertalarmStdTextProductUtil {
|
||||||
private static boolean hasDuplicateOptions(CommandLine line) {
|
private static boolean hasDuplicateOptions(CommandLine line) {
|
||||||
Option[] userOptions = line.getOptions();
|
Option[] userOptions = line.getOptions();
|
||||||
Set<String> unique = new HashSet<String>();
|
Set<String> unique = new HashSet<String>();
|
||||||
for (Option option : userOptions)
|
for (Option option : userOptions) {
|
||||||
if (!unique.add(option.getOpt()))
|
if (!unique.add(option.getOpt())) {
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -221,9 +222,9 @@ public class AlertalarmStdTextProductUtil {
|
||||||
reportWriter.writeHeader();
|
reportWriter.writeHeader();
|
||||||
reportWriter.writeBody(aaRecord);
|
reportWriter.writeBody(aaRecord);
|
||||||
if (reportOptions.getVerbose()) {
|
if (reportOptions.getVerbose()) {
|
||||||
reportWriter.writeVerboseTrailer();
|
reportWriter.writeVerboseTrailer();
|
||||||
} else {
|
} else {
|
||||||
reportWriter.writeReportTrailer();
|
reportWriter.writeReportTrailer();
|
||||||
}
|
}
|
||||||
|
|
||||||
// save it to the text database if indeed
|
// save it to the text database if indeed
|
||||||
|
@ -232,7 +233,7 @@ public class AlertalarmStdTextProductUtil {
|
||||||
if (alarmCount > 0) {
|
if (alarmCount > 0) {
|
||||||
log.info(alarmCount + " alarms reported, report written to "
|
log.info(alarmCount + " alarms reported, report written to "
|
||||||
+ reportWriter.getFilename());
|
+ reportWriter.getFilename());
|
||||||
//saveReportTotextDb();
|
// saveReportTotextDb();
|
||||||
} else {
|
} else {
|
||||||
log.info("No alarms reported, info sent to "
|
log.info("No alarms reported, info sent to "
|
||||||
+ reportWriter.getFilename());
|
+ reportWriter.getFilename());
|
||||||
|
@ -241,37 +242,6 @@ public class AlertalarmStdTextProductUtil {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* saves the report contents to the text database.
|
|
||||||
*/
|
|
||||||
private static void saveReportTotextDb() {
|
|
||||||
|
|
||||||
setApplicationSpringContext(Constants.FXA_CONFIG);
|
|
||||||
|
|
||||||
WriteProductRequest request = new WriteProductRequest();
|
|
||||||
request.setProductId(reportOptions.getProductId());
|
|
||||||
request.setOperationalMode(true);
|
|
||||||
request.setNotifyAlarmAlert(true);
|
|
||||||
String rptData = reportWriter.getReportData();
|
|
||||||
request.setReportData(rptData);
|
|
||||||
|
|
||||||
log.info("Sending " + reportWriter.getFilename() + " to textdb as id "
|
|
||||||
+ request.getProductId());
|
|
||||||
|
|
||||||
TextDB textdb = new TextDB();
|
|
||||||
long result = textdb.writeProduct(request.getProductId(),
|
|
||||||
request.getReportData(), request.getOperationalMode(), null);
|
|
||||||
|
|
||||||
if (result != Long.MIN_VALUE) {
|
|
||||||
log.info("Product " + request.getProductId()
|
|
||||||
+ " successfully sent to textdb");
|
|
||||||
} else {
|
|
||||||
log.error("Error sending product " + request.getProductId()
|
|
||||||
+ " to textdb. status=" + result);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* verify whether necessary application tokens have been defined.
|
* verify whether necessary application tokens have been defined.
|
||||||
*/
|
*/
|
||||||
|
@ -308,18 +278,20 @@ public class AlertalarmStdTextProductUtil {
|
||||||
String pid = reportOptions.getProductId();
|
String pid = reportOptions.getProductId();
|
||||||
String suffix = reportOptions.getFileSuffix();
|
String suffix = reportOptions.getFileSuffix();
|
||||||
|
|
||||||
if (suffix.length() > 0)
|
if (suffix.length() > 0) {
|
||||||
currReport = new File(reportDir + File.separator + pid + "." + suffix);
|
currReport = new File(reportDir + File.separator + pid + "."
|
||||||
else
|
+ suffix);
|
||||||
|
} else {
|
||||||
currReport = new File(reportDir + File.separator + pid);
|
currReport = new File(reportDir + File.separator + pid);
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
currReport.createNewFile();
|
currReport.createNewFile();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.fatal("Could not create report file "
|
log.fatal("Could not create report file "
|
||||||
+ String.valueOf(currReport));
|
+ String.valueOf(currReport));
|
||||||
log.info("Exiting.");
|
log.info("Exiting.");
|
||||||
System.exit(0);
|
System.exit(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,30 +23,41 @@ import java.text.SimpleDateFormat;
|
||||||
|
|
||||||
import com.raytheon.uf.common.dataplugin.shef.util.ShefConstants;
|
import com.raytheon.uf.common.dataplugin.shef.util.ShefConstants;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constants for alert alarm.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
*
|
||||||
|
* SOFTWARE HISTORY
|
||||||
|
*
|
||||||
|
* Date Ticket# Engineer Description
|
||||||
|
* ------------ ---------- ----------- --------------------------
|
||||||
|
* Feb 10, 2014 2781 rjpeter Initial history, update IHFS_CONFIG path.
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @author jnjanga
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
class Constants {
|
class Constants {
|
||||||
|
|
||||||
public static final SimpleDateFormat REPORT_TIME_PATTERN = new SimpleDateFormat(
|
public static final SimpleDateFormat REPORT_TIME_PATTERN = new SimpleDateFormat(
|
||||||
"HH:mm:ss z, yyyy.MM.dd ");
|
"HH:mm:ss z, yyyy.MM.dd ");
|
||||||
|
|
||||||
public static final int MISSING_VALUE_INT = ShefConstants.SHEF_MISSING_INT;
|
public static final int MISSING_VALUE_INT = ShefConstants.SHEF_MISSING_INT;
|
||||||
|
|
||||||
public static final double MISSING_VALUE_DOUBLE = -9999999.87654321;
|
public static final double MISSING_VALUE_DOUBLE = -9999999.87654321;
|
||||||
|
|
||||||
public static final String NEWLINE = System.getProperty("line.separator");
|
public static final String NEWLINE = System.getProperty("line.separator");
|
||||||
|
|
||||||
public final static String EOL = NEWLINE;
|
public final static String EOL = NEWLINE;
|
||||||
|
|
||||||
public static final String SPACE = " ";
|
public static final String SPACE = " ";
|
||||||
|
|
||||||
public static final String REPORT_ALARM_LOG = "report_alarm.log";
|
public static final String REPORT_ALARM_LOG = "report_alarm.log";
|
||||||
|
|
||||||
public static final String WHFS_PRODUCT_DIR = "whfs_product_dir";
|
public static final String WHFS_PRODUCT_DIR = "whfs_product_dir";
|
||||||
|
|
||||||
public static final String WHFS_UTIL_LOG_DIR = "whfs_util_log_dir";
|
public static final String WHFS_UTIL_LOG_DIR = "whfs_util_log_dir";
|
||||||
|
|
||||||
public static final String IHFS_CONFIG = "/res/spring/ohd-common.xml";
|
public static final String IHFS_CONFIG = "/res/spring/ohd-common-database.xml";
|
||||||
|
|
||||||
public static final String FXA_CONFIG = "/res/spring/alertalarm.xml";
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -9,13 +9,13 @@
|
||||||
<bean id="tafDistRegistry" factory-bean="distributionSrv"
|
<bean id="tafDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg value="taf" />
|
<constructor-arg value="taf" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.taf"/>
|
<constructor-arg value="jms-durable:queue:Ingest.taf"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="tafHandleoupDistRegistry" factory-bean="handleoupDistributionSrv"
|
<bean id="tafHandleoupDistRegistry" factory-bean="handleoupDistributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg value="taf" />
|
<constructor-arg value="taf" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.taf"/>
|
<constructor-arg value="jms-durable:queue:Ingest.taf"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="tafCamelRegistered" factory-bean="contextManager"
|
<bean id="tafCamelRegistered" factory-bean="contextManager"
|
||||||
|
|
|
@ -86,6 +86,7 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools;
|
||||||
* Oct 21, 2008 1515 jkorman Added 30 Hour capability changes.
|
* Oct 21, 2008 1515 jkorman Added 30 Hour capability changes.
|
||||||
* Jun 28, 2012 #827 dgilling Annotate id field for
|
* Jun 28, 2012 #827 dgilling Annotate id field for
|
||||||
* serialization.
|
* serialization.
|
||||||
|
* Feb 10, 2014 2777 rferrel set the parentId when assinging sets.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -108,7 +109,6 @@ public class ChangeGroup extends PersistableDataObject implements
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue
|
@GeneratedValue
|
||||||
@DynamicSerializeElement
|
|
||||||
private int id;
|
private int id;
|
||||||
|
|
||||||
/** A String containing the change group */
|
/** A String containing the change group */
|
||||||
|
@ -912,6 +912,11 @@ public class ChangeGroup extends PersistableDataObject implements
|
||||||
|
|
||||||
public void setTurbulence_layers(Set<TurbulenceLayer> turbulence_layers) {
|
public void setTurbulence_layers(Set<TurbulenceLayer> turbulence_layers) {
|
||||||
this.turbulence_layers = turbulence_layers;
|
this.turbulence_layers = turbulence_layers;
|
||||||
|
if ((turbulence_layers != null) && (turbulence_layers.size() > 0)) {
|
||||||
|
for (TurbulenceLayer turbulence_layer : turbulence_layers) {
|
||||||
|
turbulence_layer.setParentID(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<IcingLayer> getIcing_layers() {
|
public Set<IcingLayer> getIcing_layers() {
|
||||||
|
@ -920,6 +925,11 @@ public class ChangeGroup extends PersistableDataObject implements
|
||||||
|
|
||||||
public void setIcing_layers(Set<IcingLayer> icing_layers) {
|
public void setIcing_layers(Set<IcingLayer> icing_layers) {
|
||||||
this.icing_layers = icing_layers;
|
this.icing_layers = icing_layers;
|
||||||
|
if ((icing_layers != null) && (icing_layers.size() > 0)) {
|
||||||
|
for (IcingLayer icing_layer : icing_layers) {
|
||||||
|
icing_layer.setParentID(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<TemperatureForecast> getTemp_forecasts() {
|
public Set<TemperatureForecast> getTemp_forecasts() {
|
||||||
|
@ -928,6 +938,11 @@ public class ChangeGroup extends PersistableDataObject implements
|
||||||
|
|
||||||
public void setTemp_forecasts(Set<TemperatureForecast> temp_forecasts) {
|
public void setTemp_forecasts(Set<TemperatureForecast> temp_forecasts) {
|
||||||
this.temp_forecasts = temp_forecasts;
|
this.temp_forecasts = temp_forecasts;
|
||||||
|
if ((temp_forecasts != null) && (temp_forecasts.size() > 0)) {
|
||||||
|
for (TemperatureForecast temForecast : temp_forecasts) {
|
||||||
|
temForecast.setParentID(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<TafWeatherCondition> getWeather() {
|
public Set<TafWeatherCondition> getWeather() {
|
||||||
|
@ -936,6 +951,11 @@ public class ChangeGroup extends PersistableDataObject implements
|
||||||
|
|
||||||
public void setWeather(Set<TafWeatherCondition> weather) {
|
public void setWeather(Set<TafWeatherCondition> weather) {
|
||||||
this.weather = weather;
|
this.weather = weather;
|
||||||
|
if ((weather != null) && (weather.size() > 0)) {
|
||||||
|
for (TafWeatherCondition twc : weather) {
|
||||||
|
twc.setParentID(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<TafSkyCover> getSky_cover() {
|
public Set<TafSkyCover> getSky_cover() {
|
||||||
|
@ -944,6 +964,11 @@ public class ChangeGroup extends PersistableDataObject implements
|
||||||
|
|
||||||
public void setSky_cover(Set<TafSkyCover> sky_cover) {
|
public void setSky_cover(Set<TafSkyCover> sky_cover) {
|
||||||
this.sky_cover = sky_cover;
|
this.sky_cover = sky_cover;
|
||||||
|
if ((sky_cover != null) && (sky_cover.size() > 0)) {
|
||||||
|
for (TafSkyCover tsc : sky_cover) {
|
||||||
|
tsc.setParentID(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkGroupDataEnd(StringBuilder group) {
|
private void checkGroupDataEnd(StringBuilder group) {
|
||||||
|
|
|
@ -69,6 +69,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||||
* May 07, 2013 1869 bsteffen Remove dataURI column from
|
* May 07, 2013 1869 bsteffen Remove dataURI column from
|
||||||
* PluginDataObject.
|
* PluginDataObject.
|
||||||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||||
|
* Feb 10, 2014 2777 rferrel Assign parent id when setting ChangeGroup.
|
||||||
|
* Feb 11, 2014 2784 rferrel Remove override of setIdentifier.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -292,6 +294,11 @@ public class TafRecord extends PluginDataObject implements ISpatialEnabled {
|
||||||
*/
|
*/
|
||||||
public void setChangeGroups(Set<ChangeGroup> changeGroups) {
|
public void setChangeGroups(Set<ChangeGroup> changeGroups) {
|
||||||
this.changeGroups = changeGroups;
|
this.changeGroups = changeGroups;
|
||||||
|
if ((changeGroups != null) && (changeGroups.size() > 0)) {
|
||||||
|
for (ChangeGroup changeGroup : changeGroups) {
|
||||||
|
changeGroup.setParentID(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -339,19 +346,6 @@ public class TafRecord extends PluginDataObject implements ISpatialEnabled {
|
||||||
this.remarks = remarks;
|
this.remarks = remarks;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setIdentifier(Object dataURI) {
|
|
||||||
|
|
||||||
this.identifier = dataURI;
|
|
||||||
|
|
||||||
if ((this.changeGroups != null) && (this.changeGroups.size() > 0)) {
|
|
||||||
for (ChangeGroup group : this.changeGroups) {
|
|
||||||
group.setParentID(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the IDecoderGettable reference for this record.
|
* Get the IDecoderGettable reference for this record.
|
||||||
*
|
*
|
||||||
|
|
|
@ -11,13 +11,13 @@
|
||||||
<bean id="textDistRegistry" factory-bean="distributionSrv"
|
<bean id="textDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg value="text" />
|
<constructor-arg value="text" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.Text"/>
|
<constructor-arg value="jms-durable:queue:Ingest.Text"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="textHandleoupDistRegistry" factory-bean="handleoupDistributionSrv"
|
<bean id="textHandleoupDistRegistry" factory-bean="handleoupDistributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg value="text" />
|
<constructor-arg value="text" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.Text"/>
|
<constructor-arg value="jms-durable:queue:Ingest.Text"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<!-- define the bean that handles automatic faxing of products. -->
|
<!-- define the bean that handles automatic faxing of products. -->
|
||||||
|
@ -27,18 +27,6 @@
|
||||||
<!-- verify text product info for site, spawns in separate thread to not delay start up -->
|
<!-- verify text product info for site, spawns in separate thread to not delay start up -->
|
||||||
<bean id="textVersionPurge" class="com.raytheon.edex.plugin.text.TextVersionPurge" depends-on="textRegistered"/>
|
<bean id="textVersionPurge" class="com.raytheon.edex.plugin.text.TextVersionPurge" depends-on="textRegistered"/>
|
||||||
|
|
||||||
<bean id="jms-text" class="org.apache.camel.component.jms.JmsComponent">
|
|
||||||
<constructor-arg ref="jmsTextConfig" />
|
|
||||||
<property name="taskExecutor" ref="textThreadPool" />
|
|
||||||
</bean>
|
|
||||||
<bean id="jmsTextConfig" class="org.apache.camel.component.jms.JmsConfiguration"
|
|
||||||
factory-bean="jmsDurableConfig" factory-method="copy"/>
|
|
||||||
<bean id="textThreadPool"
|
|
||||||
class="com.raytheon.uf.edex.esb.camel.spring.JmsThreadPoolTaskExecutor">
|
|
||||||
<property name="corePoolSize" value="2" />
|
|
||||||
<property name="maxPoolSize" value="2" />
|
|
||||||
</bean>
|
|
||||||
|
|
||||||
<!-- Special handler for text plugin archives that bases filenames off
|
<!-- Special handler for text plugin archives that bases filenames off
|
||||||
creation time-->
|
creation time-->
|
||||||
<bean id="textArchiveNamer" class="com.raytheon.edex.plugin.text.maintenance.archiver.TextArchiveFileNameFormatter" />
|
<bean id="textArchiveNamer" class="com.raytheon.edex.plugin.text.maintenance.archiver.TextArchiveFileNameFormatter" />
|
||||||
|
@ -118,7 +106,7 @@
|
||||||
</route>
|
</route>
|
||||||
|
|
||||||
<route id="textUndecodedIngestRoute">
|
<route id="textUndecodedIngestRoute">
|
||||||
<from uri="jms-text:queue:Ingest.Text?concurrentConsumers=2" />
|
<from uri="jms-durable:queue:Ingest.Text?concurrentConsumers=2" />
|
||||||
<setHeader headerName="pluginName">
|
<setHeader headerName="pluginName">
|
||||||
<constant>text</constant>
|
<constant>text</constant>
|
||||||
</setHeader>
|
</setHeader>
|
||||||
|
@ -145,7 +133,7 @@
|
||||||
<route id="textToWatchWarnRoute">
|
<route id="textToWatchWarnRoute">
|
||||||
<from uri="direct:textToWatchWarn" />
|
<from uri="direct:textToWatchWarn" />
|
||||||
<bean ref="textDecoder" method="transformToProductIds" />
|
<bean ref="textDecoder" method="transformToProductIds" />
|
||||||
<to uri="jms-text:queue:watchwarn" />
|
<to uri="jms-durable:queue:watchwarn" />
|
||||||
</route>
|
</route>
|
||||||
|
|
||||||
<route id="textSerializationRoute">
|
<route id="textSerializationRoute">
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<bean id="textlightningDistRegistry" factory-bean="distributionSrv"
|
<bean id="textlightningDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg value="textlightning" />
|
<constructor-arg value="textlightning" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.textlightning"/>
|
<constructor-arg value="jms-durable:queue:Ingest.textlightning"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="textlightningCamelRegistered" factory-bean="contextManager"
|
<bean id="textlightningCamelRegistered" factory-bean="contextManager"
|
||||||
|
|
|
@ -8,13 +8,13 @@
|
||||||
<bean id="warningDistRegistry" factory-bean="distributionSrv"
|
<bean id="warningDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg value="warning" />
|
<constructor-arg value="warning" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.Warning"/>
|
<constructor-arg value="jms-durable:queue:Ingest.Warning"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="warningHandleoupDistRegistry" factory-bean="handleoupDistributionSrv"
|
<bean id="warningHandleoupDistRegistry" factory-bean="handleoupDistributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg value="warning" />
|
<constructor-arg value="warning" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.Warning"/>
|
<constructor-arg value="jms-durable:queue:Ingest.Warning"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="warningCamelRegistered" factory-bean="contextManager"
|
<bean id="warningCamelRegistered" factory-bean="contextManager"
|
||||||
|
@ -22,18 +22,6 @@
|
||||||
<constructor-arg ref="warning-camel"/>
|
<constructor-arg ref="warning-camel"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="jms-warning" class="org.apache.camel.component.jms.JmsComponent">
|
|
||||||
<constructor-arg ref="jmsWarningConfig" />
|
|
||||||
<property name="taskExecutor" ref="warningThreadPool" />
|
|
||||||
</bean>
|
|
||||||
<bean id="jmsWarningConfig" class="org.apache.camel.component.jms.JmsConfiguration"
|
|
||||||
factory-bean="jmsDurableConfig" factory-method="copy"/>
|
|
||||||
<bean id="warningThreadPool"
|
|
||||||
class="com.raytheon.uf.edex.esb.camel.spring.JmsThreadPoolTaskExecutor">
|
|
||||||
<property name="corePoolSize" value="1" />
|
|
||||||
<property name="maxPoolSize" value="1" />
|
|
||||||
</bean>
|
|
||||||
|
|
||||||
<camelContext id="warning-camel"
|
<camelContext id="warning-camel"
|
||||||
xmlns="http://camel.apache.org/schema/spring"
|
xmlns="http://camel.apache.org/schema/spring"
|
||||||
errorHandlerRef="errorHandler"
|
errorHandlerRef="errorHandler"
|
||||||
|
@ -56,7 +44,7 @@
|
||||||
Warning routes
|
Warning routes
|
||||||
-->
|
-->
|
||||||
<route id="warningIngestRoute">
|
<route id="warningIngestRoute">
|
||||||
<from uri="jms-warning:queue:Ingest.Warning"/>
|
<from uri="jms-durable:queue:Ingest.Warning"/>
|
||||||
<setHeader headerName="pluginName">
|
<setHeader headerName="pluginName">
|
||||||
<constant>warning</constant>
|
<constant>warning</constant>
|
||||||
</setHeader>
|
</setHeader>
|
||||||
|
@ -67,11 +55,11 @@
|
||||||
<bean ref="index" method="index" />
|
<bean ref="index" method="index" />
|
||||||
<multicast parallelProcessing="false">
|
<multicast parallelProcessing="false">
|
||||||
<to uri="direct-vm:warningIngestAlert" />
|
<to uri="direct-vm:warningIngestAlert" />
|
||||||
<to uri="jms-warning:queue:edex.spcWatch" />
|
<to uri="jms-durable:queue:edex.spcWatch" />
|
||||||
<to uri="jms-warning:queue:edex.tpcWatch" />
|
<to uri="jms-durable:queue:edex.tpcWatch" />
|
||||||
<filter>
|
<filter>
|
||||||
<method bean="vtecFilter" method="hasVTEC" />
|
<method bean="vtecFilter" method="hasVTEC" />
|
||||||
<to uri="jms-warning:queue:activeTablePending"/>
|
<to uri="jms-durable:queue:activeTablePending"/>
|
||||||
</filter>
|
</filter>
|
||||||
</multicast>
|
</multicast>
|
||||||
</pipeline>
|
</pipeline>
|
||||||
|
|
|
@ -41,12 +41,18 @@
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<!-- JmsPooled* do not work... -->
|
<!-- JmsPooled* do not work... -->
|
||||||
<bean id="jms-alt" class="org.apache.camel.component.jms.JmsComponent">
|
<bean id="jms-mhs" class="org.apache.camel.component.jms.JmsComponent">
|
||||||
<constructor-arg ref="jmsAltConfig" />
|
<constructor-arg ref="jmsMhsConfig" />
|
||||||
<property name="taskExecutor" ref="genericThreadPool" />
|
<property name="taskExecutor" ref="mhsThreadPool" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="jmsAltConfig" class="org.apache.camel.component.jms.JmsConfiguration">
|
<bean id="mhsThreadPool"
|
||||||
|
class="com.raytheon.uf.edex.esb.camel.spring.JmsThreadPoolTaskExecutor">
|
||||||
|
<property name="corePoolSize" value="1" />
|
||||||
|
<property name="maxPoolSize" value="1" />
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
<bean id="jmsMhsConfig" class="org.apache.camel.component.jms.JmsConfiguration">
|
||||||
<property name="recoveryInterval" value="1000"/>
|
<property name="recoveryInterval" value="1000"/>
|
||||||
<property name="connectionFactory" ref="amqConnectionFactory" />
|
<property name="connectionFactory" ref="amqConnectionFactory" />
|
||||||
<property name="destinationResolver" ref="qpidNoDurableResolver"/>
|
<property name="destinationResolver" ref="qpidNoDurableResolver"/>
|
||||||
|
@ -64,7 +70,7 @@
|
||||||
<!-- Convert from BeanInvocation if needed. -->
|
<!-- Convert from BeanInvocation if needed. -->
|
||||||
<convertBodyTo type="com.raytheon.uf.common.dataplugin.text.request.RemoteRetrievalRequest" />
|
<convertBodyTo type="com.raytheon.uf.common.dataplugin.text.request.RemoteRetrievalRequest" />
|
||||||
<bean ref="serializationUtil" method="transformToThrift" />
|
<bean ref="serializationUtil" method="transformToThrift" />
|
||||||
<to uri="jms-alt:queue:fxa.mhs.request?requestTimeout=122000" pattern="InOut" />
|
<to uri="jms-mhs:queue:fxa.mhs.request?requestTimeout=122000" pattern="InOut" />
|
||||||
<bean ref="serializationUtil" method="transformFromThrift" />
|
<bean ref="serializationUtil" method="transformFromThrift" />
|
||||||
</route>
|
</route>
|
||||||
</camelContext>
|
</camelContext>
|
||||||
|
|
|
@ -97,6 +97,7 @@ import com.raytheon.uf.common.time.util.TimeUtil;
|
||||||
* May 07, 2013 1869 bsteffen Remove dataURI column from
|
* May 07, 2013 1869 bsteffen Remove dataURI column from
|
||||||
* PluginDataObject.
|
* PluginDataObject.
|
||||||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||||
|
* Feb 11, 2014 2784 rferrel Remove override of setIdentifier.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author bphillip
|
* @author bphillip
|
||||||
|
@ -984,6 +985,11 @@ public class MetarRecord extends PersistablePluginDataObject implements
|
||||||
*/
|
*/
|
||||||
public void setSkyCoverage(Set<SkyCover> skyCoverage) {
|
public void setSkyCoverage(Set<SkyCover> skyCoverage) {
|
||||||
this.skyCoverage = skyCoverage;
|
this.skyCoverage = skyCoverage;
|
||||||
|
if ((skyCoverage != null) && (skyCoverage.size() > 0)) {
|
||||||
|
for (SkyCover cover : skyCoverage) {
|
||||||
|
cover.setParentMetar(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addSkyCoverage(SkyCover cover) {
|
public void addSkyCoverage(SkyCover cover) {
|
||||||
|
@ -1019,6 +1025,11 @@ public class MetarRecord extends PersistablePluginDataObject implements
|
||||||
*/
|
*/
|
||||||
public void setWeatherCondition(List<WeatherCondition> weatherCondition) {
|
public void setWeatherCondition(List<WeatherCondition> weatherCondition) {
|
||||||
this.weatherCondition = weatherCondition;
|
this.weatherCondition = weatherCondition;
|
||||||
|
if ((weatherCondition != null) && (weatherCondition.size() > 0)) {
|
||||||
|
for (WeatherCondition cond : weatherCondition) {
|
||||||
|
cond.setParentMetar(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addWeatherCondition(WeatherCondition condition) {
|
public void addWeatherCondition(WeatherCondition condition) {
|
||||||
|
@ -1116,30 +1127,6 @@ public class MetarRecord extends PersistablePluginDataObject implements
|
||||||
this.snowWater = snowWater;
|
this.snowWater = snowWater;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Override existing set method to modify any classes that use the dataURI
|
|
||||||
* as a foreign key
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void setIdentifier(Object dataURI) {
|
|
||||||
this.identifier = dataURI;
|
|
||||||
// set the parentID to the dataURI for all values
|
|
||||||
if ((this.getWeatherCondition() != null)
|
|
||||||
&& (this.getWeatherCondition().size() > 0)) {
|
|
||||||
for (WeatherCondition cond : this.getWeatherCondition()) {
|
|
||||||
cond.setParentMetar(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// set the parentID to the dataURI for all values
|
|
||||||
if ((this.getSkyCoverage() != null)
|
|
||||||
&& (this.getSkyCoverage().size() > 0)) {
|
|
||||||
for (SkyCover cover : this.getSkyCoverage()) {
|
|
||||||
cover.setParentMetar(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getReportType() {
|
public String getReportType() {
|
||||||
return reportType;
|
return reportType;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,6 @@ import javax.xml.bind.annotation.XmlElement;
|
||||||
|
|
||||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the root class for any object being persisted in the database using
|
* This is the root class for any object being persisted in the database using
|
||||||
|
@ -50,6 +49,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||||
* 7/24/07 353 bphillip Initial Check in
|
* 7/24/07 353 bphillip Initial Check in
|
||||||
* 20080408 1039 jkorman Added traceId for tracing data.
|
* 20080408 1039 jkorman Added traceId for tracing data.
|
||||||
* Oct 10, 2012 1261 djohnson Add generic for identifier.
|
* Oct 10, 2012 1261 djohnson Add generic for identifier.
|
||||||
|
* Feb 11, 2014 2784 rferrel Identifier no longer a DynamicSerializeElement.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -59,8 +59,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||||
@XmlAccessorType(XmlAccessType.NONE)
|
@XmlAccessorType(XmlAccessType.NONE)
|
||||||
@DynamicSerialize
|
@DynamicSerialize
|
||||||
public abstract class PersistableDataObject<IDENTIFIER_TYPE> implements
|
public abstract class PersistableDataObject<IDENTIFIER_TYPE> implements
|
||||||
IPersistableDataObject<IDENTIFIER_TYPE>,
|
IPersistableDataObject<IDENTIFIER_TYPE>, Serializable,
|
||||||
Serializable, ISerializableObject {
|
ISerializableObject {
|
||||||
|
|
||||||
private static final long serialVersionUID = -6747395152869923909L;
|
private static final long serialVersionUID = -6747395152869923909L;
|
||||||
|
|
||||||
|
@ -69,7 +69,6 @@ public abstract class PersistableDataObject<IDENTIFIER_TYPE> implements
|
||||||
* key for the associated database table.
|
* key for the associated database table.
|
||||||
*/
|
*/
|
||||||
@XmlElement
|
@XmlElement
|
||||||
@DynamicSerializeElement
|
|
||||||
protected IDENTIFIER_TYPE identifier;
|
protected IDENTIFIER_TYPE identifier;
|
||||||
|
|
||||||
private String traceId = "";
|
private String traceId = "";
|
||||||
|
|
|
@ -5,6 +5,7 @@ Bundle-SymbolicName: com.raytheon.uf.common.jms
|
||||||
Bundle-Version: 1.12.1174.qualifier
|
Bundle-Version: 1.12.1174.qualifier
|
||||||
Bundle-Vendor: Raytheon
|
Bundle-Vendor: Raytheon
|
||||||
Require-Bundle: javax.jms,
|
Require-Bundle: javax.jms,
|
||||||
com.raytheon.uf.common.status
|
com.raytheon.uf.common.status,
|
||||||
|
org.apache.qpid
|
||||||
Export-Package: com.raytheon.uf.common.jms
|
Export-Package: com.raytheon.uf.common.jms
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||||
|
|
|
@ -39,7 +39,8 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
* connection can be released to the pool. Any exception will close pooled
|
* connection can be released to the pool. Any exception will close pooled
|
||||||
* session instead of returning to the pool. The sessions are tracked in both
|
* session instead of returning to the pool. The sessions are tracked in both
|
||||||
* active and available states. An available session can be reused by the next
|
* active and available states. An available session can be reused by the next
|
||||||
* client.
|
* client. The connection is pinned to Thread that creates the connection and
|
||||||
|
* cannot be used/reused by any other thread.
|
||||||
*
|
*
|
||||||
* Synchronization Principle To prevent deadlocks: Chained sync blocks can only
|
* Synchronization Principle To prevent deadlocks: Chained sync blocks can only
|
||||||
* happen in a downward direction. A manager has a synchronized lock can make a
|
* happen in a downward direction. A manager has a synchronized lock can make a
|
||||||
|
@ -52,9 +53,11 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
*
|
*
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Apr 15, 2011 rjpeter Initial creation
|
* Apr 15, 2011 rjpeter Initial creation.
|
||||||
* Mar 08, 2012 194 njensen Improved safety of close()
|
* Mar 08, 2012 194 njensen Improved safety of close().
|
||||||
* Feb 21, 2013 1642 rjpeter Fix deadlock scenario
|
* Feb 21, 2013 1642 rjpeter Fix deadlock scenario.
|
||||||
|
* Feb 07, 2014 2357 rjpeter Track by Thread, close session is it has no
|
||||||
|
* producers/consumers.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author rjpeter
|
* @author rjpeter
|
||||||
|
@ -86,7 +89,7 @@ public class JmsPooledConnection implements ExceptionListener {
|
||||||
|
|
||||||
private volatile AvailableJmsPooledObject<JmsPooledSession> availableSession = null;
|
private volatile AvailableJmsPooledObject<JmsPooledSession> availableSession = null;
|
||||||
|
|
||||||
private volatile String key = null;
|
private final Thread thread;
|
||||||
|
|
||||||
private final String clientId;
|
private final String clientId;
|
||||||
|
|
||||||
|
@ -94,8 +97,10 @@ public class JmsPooledConnection implements ExceptionListener {
|
||||||
|
|
||||||
private volatile boolean exceptionOccurred = false;
|
private volatile boolean exceptionOccurred = false;
|
||||||
|
|
||||||
public JmsPooledConnection(JmsPooledConnectionFactory connFactory) {
|
public JmsPooledConnection(JmsPooledConnectionFactory connFactory,
|
||||||
|
Thread thread) {
|
||||||
this.connFactory = connFactory;
|
this.connFactory = connFactory;
|
||||||
|
this.thread = thread;
|
||||||
this.clientId = null;
|
this.clientId = null;
|
||||||
getConnection();
|
getConnection();
|
||||||
}
|
}
|
||||||
|
@ -123,7 +128,8 @@ public class JmsPooledConnection implements ExceptionListener {
|
||||||
if (availableSession != null) {
|
if (availableSession != null) {
|
||||||
JmsPooledSession availSess = availableSession.getPooledObject();
|
JmsPooledSession availSess = availableSession.getPooledObject();
|
||||||
synchronized (availSess.getStateLock()) {
|
synchronized (availSess.getStateLock()) {
|
||||||
if (availSess.isValid()) {
|
if (availSess.isValid()
|
||||||
|
&& availSess.hasProducersOrConsumers()) {
|
||||||
availSess.setState(State.InUse);
|
availSess.setState(State.InUse);
|
||||||
session = availSess;
|
session = availSess;
|
||||||
} else {
|
} else {
|
||||||
|
@ -185,6 +191,7 @@ public class JmsPooledConnection implements ExceptionListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canClose) {
|
if (canClose) {
|
||||||
|
statusHandler.info("Closing connection: " + this.toString());
|
||||||
// njensen: I moved removing the connection from the pool to be
|
// njensen: I moved removing the connection from the pool to be
|
||||||
// the first thing in this block instead of last thing so
|
// the first thing in this block instead of last thing so
|
||||||
// there's no chance it could be closed and then retrieved from
|
// there's no chance it could be closed and then retrieved from
|
||||||
|
@ -283,6 +290,8 @@ public class JmsPooledConnection implements ExceptionListener {
|
||||||
// safe since conn is volatile
|
// safe since conn is volatile
|
||||||
synchronized (stateLock) {
|
synchronized (stateLock) {
|
||||||
if (conn == null) {
|
if (conn == null) {
|
||||||
|
statusHandler.info("Creating connection: "
|
||||||
|
+ this.toString());
|
||||||
long exceptionLastHandled = 0;
|
long exceptionLastHandled = 0;
|
||||||
boolean connected = false;
|
boolean connected = false;
|
||||||
while (!connected) {
|
while (!connected) {
|
||||||
|
@ -298,7 +307,7 @@ public class JmsPooledConnection implements ExceptionListener {
|
||||||
connectionStartTime = System.currentTimeMillis();
|
connectionStartTime = System.currentTimeMillis();
|
||||||
connected = true;
|
connected = true;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
if (exceptionLastHandled + ERROR_BROADCAST_INTERVAL < System
|
if ((exceptionLastHandled + ERROR_BROADCAST_INTERVAL) < System
|
||||||
.currentTimeMillis()) {
|
.currentTimeMillis()) {
|
||||||
exceptionLastHandled = System
|
exceptionLastHandled = System
|
||||||
.currentTimeMillis();
|
.currentTimeMillis();
|
||||||
|
@ -502,12 +511,8 @@ public class JmsPooledConnection implements ExceptionListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setKey(String key) {
|
public Thread getThread() {
|
||||||
this.key = key;
|
return thread;
|
||||||
}
|
|
||||||
|
|
||||||
public String getKey() {
|
|
||||||
return key;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,23 +1,3 @@
|
||||||
package com.raytheon.uf.common.jms;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Deque;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
|
||||||
|
|
||||||
import javax.jms.Connection;
|
|
||||||
import javax.jms.ConnectionFactory;
|
|
||||||
import javax.jms.JMSException;
|
|
||||||
|
|
||||||
import com.raytheon.uf.common.jms.wrapper.JmsConnectionWrapper;
|
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This software was developed and / or modified by Raytheon Company,
|
* This software was developed and / or modified by Raytheon Company,
|
||||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||||
|
@ -37,9 +17,37 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||||
* further licensing information.
|
* further licensing information.
|
||||||
**/
|
**/
|
||||||
|
package com.raytheon.uf.common.jms;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||||
|
|
||||||
|
import javax.jms.Connection;
|
||||||
|
import javax.jms.ConnectionFactory;
|
||||||
|
import javax.jms.JMSException;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.jms.wrapper.JmsConnectionWrapper;
|
||||||
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO Add Description
|
* Connection Factory that keep underlying JMS resources used by a thread open
|
||||||
|
* for re-use by that same thread. This is to get around Spring's opening and
|
||||||
|
* closing the full jms stack for each message. We cannot use Spring caching
|
||||||
|
* mechanism since it requires one connection object to be used for all jms
|
||||||
|
* sessions. In that scenario one error causes every jms resource to disconnect
|
||||||
|
* and has been known to dead lock in the qpid code.
|
||||||
|
*
|
||||||
|
* The close action puts the resource into a pool for reuse. The jms resource
|
||||||
|
* may only be reused by the same thread. This is in part since each thread
|
||||||
|
* always connects to the same set of jms resources. Also on the QPID broker
|
||||||
|
* transient data is only removed when the session itself is closed. So reusing
|
||||||
|
* a resource on a different thread can cause transient topic resources with no
|
||||||
|
* consumers.
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
*
|
*
|
||||||
|
@ -48,7 +56,9 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Apr 15, 2011 rjpeter Initial creation
|
* Apr 15, 2011 rjpeter Initial creation
|
||||||
*
|
* Oct 04, 2013 2357 rjpeter Removed pooling, keeps resources open for the
|
||||||
|
* thread that created them for a configured amount of time.
|
||||||
|
* Feb 07, 2014 2357 rjpeter Track by Thread object, periodly check that tracked Threads are still alive.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author rjpeter
|
* @author rjpeter
|
||||||
|
@ -63,26 +73,18 @@ public class JmsPooledConnectionFactory implements ConnectionFactory {
|
||||||
|
|
||||||
private String provider = "QPID";
|
private String provider = "QPID";
|
||||||
|
|
||||||
// connections in use, key is "threadId-threadName"
|
// connections in use
|
||||||
private final Map<String, JmsPooledConnection> inUseConnections = new HashMap<String, JmsPooledConnection>();
|
private final Map<Thread, JmsPooledConnection> inUseConnections = new HashMap<Thread, JmsPooledConnection>();
|
||||||
|
|
||||||
// connections that were recently returned, key is "threadId-threadName"
|
// connections that were recently returned
|
||||||
private final Map<String, AvailableJmsPooledObject<JmsPooledConnection>> pendingConnections = new HashMap<String, AvailableJmsPooledObject<JmsPooledConnection>>();
|
private final Map<Thread, AvailableJmsPooledObject<JmsPooledConnection>> pendingConnections = new HashMap<Thread, AvailableJmsPooledObject<JmsPooledConnection>>();
|
||||||
|
|
||||||
// connections that have been released from pendingConnections and are
|
|
||||||
// awaiting being closed.
|
|
||||||
private final Deque<AvailableJmsPooledObject<JmsPooledConnection>> availableConnections = new LinkedList<AvailableJmsPooledObject<JmsPooledConnection>>();
|
|
||||||
|
|
||||||
private final ConcurrentLinkedQueue<JmsPooledConnection> deadConnections = new ConcurrentLinkedQueue<JmsPooledConnection>();
|
private final ConcurrentLinkedQueue<JmsPooledConnection> deadConnections = new ConcurrentLinkedQueue<JmsPooledConnection>();
|
||||||
|
|
||||||
private int reconnectInterval = 30000;
|
private int reconnectInterval = 30000;
|
||||||
|
|
||||||
private int connectionHoldTime = 120000;
|
|
||||||
|
|
||||||
private int resourceRetention = 180000;
|
private int resourceRetention = 180000;
|
||||||
|
|
||||||
private int maxSpareConnections = 10;
|
|
||||||
|
|
||||||
public JmsPooledConnectionFactory(ConnectionFactory factory) {
|
public JmsPooledConnectionFactory(ConnectionFactory factory) {
|
||||||
this.connFactory = factory;
|
this.connFactory = factory;
|
||||||
}
|
}
|
||||||
|
@ -94,24 +96,23 @@ public class JmsPooledConnectionFactory implements ConnectionFactory {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Connection createConnection() throws JMSException {
|
public Connection createConnection() throws JMSException {
|
||||||
String threadKey = "" + Thread.currentThread().getId() + "-"
|
Thread thread = Thread.currentThread();
|
||||||
+ Thread.currentThread().getName();
|
|
||||||
JmsPooledConnection conn = null;
|
JmsPooledConnection conn = null;
|
||||||
|
|
||||||
synchronized (inUseConnections) {
|
synchronized (inUseConnections) {
|
||||||
conn = inUseConnections.get(threadKey);
|
conn = inUseConnections.get(thread);
|
||||||
|
|
||||||
if (conn != null) {
|
if (conn != null) {
|
||||||
JmsConnectionWrapper ref = conn.createReference();
|
JmsConnectionWrapper ref = conn.createReference();
|
||||||
if (ref != null) {
|
if (ref != null) {
|
||||||
statusHandler
|
statusHandler
|
||||||
.info(threadKey
|
.info(thread.getName()
|
||||||
+ " already has a connection in use, returning previous connection thread, references="
|
+ " already has a connection in use, returning previous connection thread, references="
|
||||||
+ conn.getReferenceCount());
|
+ conn.getReferenceCount());
|
||||||
return ref;
|
return ref;
|
||||||
} else {
|
} else {
|
||||||
deadConnections.add(conn);
|
deadConnections.add(conn);
|
||||||
inUseConnections.remove(threadKey);
|
inUseConnections.remove(thread);
|
||||||
conn = null;
|
conn = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -121,13 +122,14 @@ public class JmsPooledConnectionFactory implements ConnectionFactory {
|
||||||
|
|
||||||
// check connections by Thread
|
// check connections by Thread
|
||||||
synchronized (pendingConnections) {
|
synchronized (pendingConnections) {
|
||||||
wrapper = pendingConnections.remove(threadKey);
|
wrapper = pendingConnections.remove(thread);
|
||||||
}
|
}
|
||||||
|
|
||||||
// was retrieved connection valid
|
// was retrieved connection valid
|
||||||
if (wrapper != null) {
|
if (wrapper != null) {
|
||||||
conn = wrapper.getPooledObject();
|
conn = wrapper.getPooledObject();
|
||||||
JmsConnectionWrapper ref = getConnectionWrapper(threadKey, conn);
|
|
||||||
|
JmsConnectionWrapper ref = getConnectionWrapper(conn);
|
||||||
|
|
||||||
if (ref != null) {
|
if (ref != null) {
|
||||||
return ref;
|
return ref;
|
||||||
|
@ -137,51 +139,22 @@ public class JmsPooledConnectionFactory implements ConnectionFactory {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// check available connections
|
|
||||||
boolean keepChecking = true;
|
|
||||||
|
|
||||||
while (keepChecking) {
|
|
||||||
synchronized (availableConnections) {
|
|
||||||
wrapper = availableConnections.poll();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (wrapper != null) {
|
|
||||||
conn = wrapper.getPooledObject();
|
|
||||||
} else {
|
|
||||||
keepChecking = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (conn != null) {
|
|
||||||
// was retrieved connection valid
|
|
||||||
JmsConnectionWrapper ref = getConnectionWrapper(threadKey, conn);
|
|
||||||
|
|
||||||
if (ref != null) {
|
|
||||||
return ref;
|
|
||||||
} else {
|
|
||||||
deadConnections.add(conn);
|
|
||||||
conn = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// create new connection?
|
// create new connection?
|
||||||
if (conn == null) {
|
if (conn == null) {
|
||||||
conn = new JmsPooledConnection(this);
|
conn = new JmsPooledConnection(this, thread);
|
||||||
}
|
}
|
||||||
|
|
||||||
return getConnectionWrapper(threadKey, conn);
|
return getConnectionWrapper(conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
private JmsConnectionWrapper getConnectionWrapper(String threadKey,
|
private JmsConnectionWrapper getConnectionWrapper(JmsPooledConnection conn) {
|
||||||
JmsPooledConnection conn) {
|
|
||||||
synchronized (conn.getStateLock()) {
|
synchronized (conn.getStateLock()) {
|
||||||
if (conn.isValid()) {
|
if (conn.isValid()) {
|
||||||
conn.setState(State.InUse);
|
conn.setState(State.InUse);
|
||||||
JmsConnectionWrapper ref = conn.createReference();
|
JmsConnectionWrapper ref = conn.createReference();
|
||||||
if (ref != null) {
|
if (ref != null) {
|
||||||
conn.setKey(threadKey);
|
|
||||||
synchronized (inUseConnections) {
|
synchronized (inUseConnections) {
|
||||||
inUseConnections.put(threadKey, conn);
|
inUseConnections.put(conn.getThread(), conn);
|
||||||
}
|
}
|
||||||
return ref;
|
return ref;
|
||||||
}
|
}
|
||||||
|
@ -233,13 +206,13 @@ public class JmsPooledConnectionFactory implements ConnectionFactory {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeConnectionFromPool(JmsPooledConnection conn) {
|
public void removeConnectionFromPool(JmsPooledConnection conn) {
|
||||||
String threadKey = conn.getKey();
|
Thread thread = conn.getThread();
|
||||||
boolean success = false;
|
boolean success = false;
|
||||||
|
|
||||||
// remove it from inUseConnections if it was in use, theoretically could
|
// remove it from inUseConnections if it was in use, theoretically could
|
||||||
// go by connection state, but may miss something due to threading
|
// go by connection state, but may miss something due to threading
|
||||||
synchronized (inUseConnections) {
|
synchronized (inUseConnections) {
|
||||||
JmsPooledConnection inUse = inUseConnections.remove(threadKey);
|
JmsPooledConnection inUse = inUseConnections.remove(thread);
|
||||||
|
|
||||||
// make sure the one we removed is indeed this connection, 99%
|
// make sure the one we removed is indeed this connection, 99%
|
||||||
// of time this is correct
|
// of time this is correct
|
||||||
|
@ -254,7 +227,7 @@ public class JmsPooledConnectionFactory implements ConnectionFactory {
|
||||||
// really only here for bullet proofing code against bad
|
// really only here for bullet proofing code against bad
|
||||||
// use of pool
|
// use of pool
|
||||||
if (inUse != null) {
|
if (inUse != null) {
|
||||||
inUseConnections.put(threadKey, inUse);
|
inUseConnections.put(thread, inUse);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -262,29 +235,24 @@ public class JmsPooledConnectionFactory implements ConnectionFactory {
|
||||||
// remove it from pendingConnections
|
// remove it from pendingConnections
|
||||||
AvailableJmsPooledObject<JmsPooledConnection> pooledObj = null;
|
AvailableJmsPooledObject<JmsPooledConnection> pooledObj = null;
|
||||||
synchronized (pendingConnections) {
|
synchronized (pendingConnections) {
|
||||||
pooledObj = pendingConnections.remove(threadKey);
|
pooledObj = pendingConnections.remove(thread);
|
||||||
if (pooledObj != null) {
|
if (pooledObj != null) {
|
||||||
if (pooledObj.getPooledObject() == conn) {
|
if (pooledObj.getPooledObject() == conn) {
|
||||||
// found conn, done
|
// found conn, done
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
pendingConnections.put(threadKey, pooledObj);
|
pendingConnections.put(thread, pooledObj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove it from availableConnections
|
|
||||||
synchronized (availableConnections) {
|
|
||||||
availableConnections.remove(conn);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean returnConnectionToPool(JmsPooledConnection conn) {
|
public boolean returnConnectionToPool(JmsPooledConnection conn) {
|
||||||
boolean success = false;
|
boolean success = false;
|
||||||
String threadKey = conn.getKey();
|
Thread thread = conn.getThread();
|
||||||
|
|
||||||
synchronized (inUseConnections) {
|
synchronized (inUseConnections) {
|
||||||
JmsPooledConnection inUse = inUseConnections.remove(threadKey);
|
JmsPooledConnection inUse = inUseConnections.remove(thread);
|
||||||
|
|
||||||
// make sure the one we removed is indeed this connection, 99%
|
// make sure the one we removed is indeed this connection, 99%
|
||||||
// of time this is correct
|
// of time this is correct
|
||||||
|
@ -296,7 +264,7 @@ public class JmsPooledConnectionFactory implements ConnectionFactory {
|
||||||
// really only here for bullet proofing code against bad
|
// really only here for bullet proofing code against bad
|
||||||
// use of pool
|
// use of pool
|
||||||
if (inUse != null) {
|
if (inUse != null) {
|
||||||
inUseConnections.put(threadKey, inUse);
|
inUseConnections.put(thread, inUse);
|
||||||
statusHandler
|
statusHandler
|
||||||
.handle(Priority.INFO,
|
.handle(Priority.INFO,
|
||||||
"Another connection already in use for this thread, not returning this connection to pool");
|
"Another connection already in use for this thread, not returning this connection to pool");
|
||||||
|
@ -310,20 +278,17 @@ public class JmsPooledConnectionFactory implements ConnectionFactory {
|
||||||
AvailableJmsPooledObject<JmsPooledConnection> prev = null;
|
AvailableJmsPooledObject<JmsPooledConnection> prev = null;
|
||||||
synchronized (pendingConnections) {
|
synchronized (pendingConnections) {
|
||||||
prev = pendingConnections
|
prev = pendingConnections
|
||||||
.put(threadKey,
|
.put(thread,
|
||||||
new AvailableJmsPooledObject<JmsPooledConnection>(
|
new AvailableJmsPooledObject<JmsPooledConnection>(
|
||||||
conn));
|
conn));
|
||||||
}
|
}
|
||||||
if (prev != null) {
|
if ((prev != null) && (prev.getPooledObject() != conn)) {
|
||||||
// there was a previous connection registered to
|
// there was a previous connection registered to
|
||||||
// this thread, move it to available
|
// this thread, close it
|
||||||
statusHandler
|
statusHandler
|
||||||
.handle(Priority.WARN,
|
.handle(Priority.WARN,
|
||||||
"Another connection already pooled for this thread, moving previous connection to available");
|
"Another connection already pooled for this thread, closing previous connection");
|
||||||
prev.reset();
|
deadConnections.add(prev.getPooledObject());
|
||||||
synchronized (availableConnections) {
|
|
||||||
availableConnections.add(prev);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
success = false;
|
success = false;
|
||||||
|
@ -333,11 +298,11 @@ public class JmsPooledConnectionFactory implements ConnectionFactory {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void checkPooledResources() {
|
public void checkPooledResources() {
|
||||||
long curTime = System.currentTimeMillis();
|
|
||||||
List<AvailableJmsPooledObject<JmsPooledConnection>> connectionsToProcess = new LinkedList<AvailableJmsPooledObject<JmsPooledConnection>>();
|
|
||||||
int connectionsClosed = 0;
|
int connectionsClosed = 0;
|
||||||
|
|
||||||
// grab connections to move from pending to available
|
long curTime = System.currentTimeMillis();
|
||||||
|
|
||||||
|
// check for connections to close
|
||||||
synchronized (pendingConnections) {
|
synchronized (pendingConnections) {
|
||||||
Iterator<AvailableJmsPooledObject<JmsPooledConnection>> iter = pendingConnections
|
Iterator<AvailableJmsPooledObject<JmsPooledConnection>> iter = pendingConnections
|
||||||
.values().iterator();
|
.values().iterator();
|
||||||
|
@ -346,44 +311,22 @@ public class JmsPooledConnectionFactory implements ConnectionFactory {
|
||||||
.next();
|
.next();
|
||||||
if (wrapper.expired(curTime, resourceRetention)) {
|
if (wrapper.expired(curTime, resourceRetention)) {
|
||||||
iter.remove();
|
iter.remove();
|
||||||
connectionsToProcess.add(wrapper);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
synchronized (availableConnections) {
|
|
||||||
for (AvailableJmsPooledObject<JmsPooledConnection> wrapper : connectionsToProcess) {
|
|
||||||
wrapper.reset();
|
|
||||||
|
|
||||||
// putting to available pool
|
|
||||||
JmsPooledConnection conn = wrapper.getPooledObject();
|
|
||||||
conn.setKey(null);
|
|
||||||
availableConnections.add(wrapper);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
connectionsToProcess.clear();
|
|
||||||
|
|
||||||
synchronized (availableConnections) {
|
|
||||||
Iterator<AvailableJmsPooledObject<JmsPooledConnection>> iter = availableConnections
|
|
||||||
.iterator();
|
|
||||||
while (iter.hasNext()) {
|
|
||||||
AvailableJmsPooledObject<JmsPooledConnection> wrapper = iter
|
|
||||||
.next();
|
|
||||||
// available sessions added based on time, so oldest is front of
|
|
||||||
// queue
|
|
||||||
if (wrapper.expired(curTime, connectionHoldTime)
|
|
||||||
|| (availableConnections.size() > maxSpareConnections)) {
|
|
||||||
// not immediately closing connection so that we minimize
|
|
||||||
// time in sync block
|
|
||||||
deadConnections.add(wrapper.getPooledObject());
|
deadConnections.add(wrapper.getPooledObject());
|
||||||
iter.remove();
|
|
||||||
} else {
|
|
||||||
// connections ordered in reverse order
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// check for dead threads
|
||||||
|
synchronized (inUseConnections) {
|
||||||
|
Iterator<Map.Entry<Thread, JmsPooledConnection>> iter = inUseConnections
|
||||||
|
.entrySet().iterator();
|
||||||
|
while (iter.hasNext()) {
|
||||||
|
Map.Entry<Thread, JmsPooledConnection> entry = iter.next();
|
||||||
|
if (!entry.getKey().isAlive()) {
|
||||||
|
iter.remove();
|
||||||
|
deadConnections.add(entry.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
while (!deadConnections.isEmpty()) {
|
while (!deadConnections.isEmpty()) {
|
||||||
|
@ -394,29 +337,29 @@ public class JmsPooledConnectionFactory implements ConnectionFactory {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
List<JmsPooledConnection> connectionsToCheck = null;
|
ArrayList<JmsPooledConnection> connectionsToCheck = null;
|
||||||
synchronized (inUseConnections) {
|
synchronized (inUseConnections) {
|
||||||
connectionsToCheck = new ArrayList<JmsPooledConnection>(
|
connectionsToCheck = new ArrayList<JmsPooledConnection>(
|
||||||
inUseConnections.values());
|
inUseConnections.values());
|
||||||
}
|
}
|
||||||
|
|
||||||
int resourcesClosed = 0;
|
int resourcesClosed = 0;
|
||||||
for (JmsPooledConnection conn : connectionsToCheck) {
|
for (JmsPooledConnection conn : connectionsToCheck) {
|
||||||
resourcesClosed += conn.closeOldPooledResources(resourceRetention);
|
resourcesClosed += conn.closeOldPooledResources(resourceRetention);
|
||||||
}
|
}
|
||||||
|
connectionsToCheck.clear();
|
||||||
|
|
||||||
// close pooled resources on pending connections
|
// close pooled resources on pending connections
|
||||||
synchronized (pendingConnections) {
|
synchronized (pendingConnections) {
|
||||||
connectionsToProcess = new ArrayList<AvailableJmsPooledObject<JmsPooledConnection>>(
|
connectionsToCheck.ensureCapacity(pendingConnections.size());
|
||||||
pendingConnections.values());
|
for (AvailableJmsPooledObject<JmsPooledConnection> wrapper : pendingConnections
|
||||||
|
.values()) {
|
||||||
|
connectionsToCheck.add(wrapper.getPooledObject());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
synchronized (availableConnections) {
|
for (JmsPooledConnection conn : connectionsToCheck) {
|
||||||
connectionsToProcess.addAll(availableConnections);
|
resourcesClosed += conn.closeOldPooledResources(resourceRetention);
|
||||||
}
|
|
||||||
|
|
||||||
for (AvailableJmsPooledObject<JmsPooledConnection> wrapper : connectionsToProcess) {
|
|
||||||
resourcesClosed += wrapper.getPooledObject()
|
|
||||||
.closeOldPooledResources(resourceRetention);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((connectionsClosed > 0) || (resourcesClosed > 0)) {
|
if ((connectionsClosed > 0) || (resourcesClosed > 0)) {
|
||||||
|
@ -429,33 +372,4 @@ public class JmsPooledConnectionFactory implements ConnectionFactory {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the connectionHoldTime
|
|
||||||
*/
|
|
||||||
public int getConnectionHoldTime() {
|
|
||||||
return connectionHoldTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param connectionHoldTime
|
|
||||||
* the connectionHoldTime to set
|
|
||||||
*/
|
|
||||||
public void setConnectionHoldTime(int connectionHoldTime) {
|
|
||||||
this.connectionHoldTime = connectionHoldTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the maxSpareConnections
|
|
||||||
*/
|
|
||||||
public int getMaxSpareConnections() {
|
|
||||||
return maxSpareConnections;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param maxSpareConnections
|
|
||||||
* the maxSpareConnections to set
|
|
||||||
*/
|
|
||||||
public void setMaxSpareConnections(int maxSpareConnections) {
|
|
||||||
this.maxSpareConnections = maxSpareConnections;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,8 @@ import javax.jms.Destination;
|
||||||
import javax.jms.JMSException;
|
import javax.jms.JMSException;
|
||||||
import javax.jms.MessageConsumer;
|
import javax.jms.MessageConsumer;
|
||||||
|
|
||||||
|
import org.apache.qpid.client.BasicMessageConsumer;
|
||||||
|
|
||||||
import com.raytheon.uf.common.jms.wrapper.JmsConsumerWrapper;
|
import com.raytheon.uf.common.jms.wrapper.JmsConsumerWrapper;
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
|
@ -47,9 +49,10 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
*
|
*
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Apr 18, 2011 rjpeter Initial creation
|
* Apr 18, 2011 rjpeter Initial creation.
|
||||||
* Mar 08, 2012 194 njensen Improved logging
|
* Mar 08, 2012 194 njensen Improved logging.
|
||||||
* Feb 26, 2013 1642 rjpeter Removed lazy initialization
|
* Feb 26, 2013 1642 rjpeter Removed lazy initialization.
|
||||||
|
* Feb 07, 2014 2357 rjpeter Updated logging.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author rjpeter
|
* @author rjpeter
|
||||||
|
@ -87,6 +90,14 @@ public class JmsPooledConsumer {
|
||||||
this.destKey = destKey;
|
this.destKey = destKey;
|
||||||
consumer = sess.getSession().createConsumer(destination,
|
consumer = sess.getSession().createConsumer(destination,
|
||||||
messageSelector);
|
messageSelector);
|
||||||
|
|
||||||
|
if (consumer instanceof BasicMessageConsumer) {
|
||||||
|
statusHandler.info("Creating AMQ consumer "
|
||||||
|
+ ((BasicMessageConsumer) consumer).getDestination()
|
||||||
|
.getQueueName()); // njensen
|
||||||
|
} else {
|
||||||
|
statusHandler.info("Creating consumer " + destKey); // njensen
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDestKey() {
|
public String getDestKey() {
|
||||||
|
@ -164,7 +175,13 @@ public class JmsPooledConsumer {
|
||||||
|
|
||||||
if (close) {
|
if (close) {
|
||||||
try {
|
try {
|
||||||
statusHandler.info("Closing consumer " + destKey); // njensen
|
if (consumer instanceof BasicMessageConsumer) {
|
||||||
|
statusHandler.info("Closing AMQ consumer "
|
||||||
|
+ ((BasicMessageConsumer) consumer)
|
||||||
|
.getDestination().getQueueName()); // njensen
|
||||||
|
} else {
|
||||||
|
statusHandler.info("Closing consumer " + destKey); // njensen
|
||||||
|
}
|
||||||
consumer.close();
|
consumer.close();
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
statusHandler.handle(Priority.WARN, "Failed to close consumer "
|
statusHandler.handle(Priority.WARN, "Failed to close consumer "
|
||||||
|
|
|
@ -25,6 +25,9 @@ import java.util.List;
|
||||||
import javax.jms.JMSException;
|
import javax.jms.JMSException;
|
||||||
import javax.jms.MessageProducer;
|
import javax.jms.MessageProducer;
|
||||||
|
|
||||||
|
import org.apache.qpid.client.AMQDestination;
|
||||||
|
import org.apache.qpid.client.BasicMessageProducer;
|
||||||
|
|
||||||
import com.raytheon.uf.common.jms.wrapper.JmsProducerWrapper;
|
import com.raytheon.uf.common.jms.wrapper.JmsProducerWrapper;
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
|
@ -46,9 +49,10 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
*
|
*
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Apr 18, 2011 rjpeter Initial creation
|
* Apr 18, 2011 rjpeter Initial creation.
|
||||||
* Mar 08, 2012 194 njensen Improved logging
|
* Mar 08, 2012 194 njensen Improved logging.
|
||||||
* Feb 26, 2013 1642 rjpeter Removed lazy initialization
|
* Feb 26, 2013 1642 rjpeter Removed lazy initialization.
|
||||||
|
* Feb 07, 2014 2357 rjpeter Updated logging.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author rjpeter
|
* @author rjpeter
|
||||||
|
@ -84,6 +88,19 @@ public class JmsPooledProducer {
|
||||||
this.sess = sess;
|
this.sess = sess;
|
||||||
this.destKey = destKey;
|
this.destKey = destKey;
|
||||||
this.producer = producer;
|
this.producer = producer;
|
||||||
|
if (producer instanceof BasicMessageProducer) {
|
||||||
|
try {
|
||||||
|
statusHandler.info("Creating AMQ producer "
|
||||||
|
+ ((AMQDestination) ((BasicMessageProducer) producer)
|
||||||
|
.getDestination()).getQueueName());
|
||||||
|
} catch (Exception e) {
|
||||||
|
statusHandler
|
||||||
|
.error("Could not get producer destination for key "
|
||||||
|
+ destKey, e);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
statusHandler.info("Creating producer " + destKey); // njensen
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDestKey() {
|
public String getDestKey() {
|
||||||
|
@ -161,7 +178,14 @@ public class JmsPooledProducer {
|
||||||
|
|
||||||
if (close) {
|
if (close) {
|
||||||
try {
|
try {
|
||||||
statusHandler.info("Closing producer " + destKey); // njensen
|
if (producer instanceof BasicMessageProducer) {
|
||||||
|
statusHandler
|
||||||
|
.info("Closing AMQ producer "
|
||||||
|
+ ((AMQDestination) ((BasicMessageProducer) producer)
|
||||||
|
.getDestination()).getQueueName()); // njensen
|
||||||
|
} else {
|
||||||
|
statusHandler.info("Closing producer " + destKey); // njensen
|
||||||
|
}
|
||||||
producer.close();
|
producer.close();
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
statusHandler.handle(Priority.WARN, "Failed to close producer",
|
statusHandler.handle(Priority.WARN, "Failed to close producer",
|
||||||
|
|
|
@ -44,7 +44,9 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
* can be released to the pool. Any exception will close pooled session instead
|
* can be released to the pool. Any exception will close pooled session instead
|
||||||
* of returning to the pool. The consumers/producers are tracked in both active
|
* of returning to the pool. The consumers/producers are tracked in both active
|
||||||
* and available states. An available consumer/producer can be reused by the
|
* and available states. An available consumer/producer can be reused by the
|
||||||
* next client.
|
* next client. Once a consumer has been closed the entire session is closed at
|
||||||
|
* next opportunity since QPID tracks consumers at the session level. Not doing
|
||||||
|
* this can leave a topic with no consumers on the qpid broker.
|
||||||
*
|
*
|
||||||
* Synchronization Principle To prevent deadlocks: Chained sync blocks can only
|
* Synchronization Principle To prevent deadlocks: Chained sync blocks can only
|
||||||
* happen in a downward direction. A manager has a synchronized lock can make a
|
* happen in a downward direction. A manager has a synchronized lock can make a
|
||||||
|
@ -60,6 +62,9 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
* Apr 15, 2011 rjpeter Initial creation
|
* Apr 15, 2011 rjpeter Initial creation
|
||||||
* Mar 08, 2012 194 njensen Improved logging
|
* Mar 08, 2012 194 njensen Improved logging
|
||||||
* Feb 21, 2013 1642 rjpeter Fix deadlock scenario
|
* Feb 21, 2013 1642 rjpeter Fix deadlock scenario
|
||||||
|
* Jan 26, 2014 2357 rjpeter Close a session when it has no producers or consumers.
|
||||||
|
* Feb 07, 2014 2357 rjpeter Close session at next return to pool after a
|
||||||
|
* consumer has closed.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author rjpeter
|
* @author rjpeter
|
||||||
|
@ -77,7 +82,7 @@ public class JmsPooledSession {
|
||||||
|
|
||||||
// The thread this session was most recently used by for tracking a pending
|
// The thread this session was most recently used by for tracking a pending
|
||||||
// session that is being reserved for a given thread.
|
// session that is being reserved for a given thread.
|
||||||
private String threadKey;
|
private final Thread thread;
|
||||||
|
|
||||||
private volatile boolean exceptionOccurred = false;
|
private volatile boolean exceptionOccurred = false;
|
||||||
|
|
||||||
|
@ -85,6 +90,10 @@ public class JmsPooledSession {
|
||||||
|
|
||||||
private volatile State state = State.InUse;
|
private volatile State state = State.InUse;
|
||||||
|
|
||||||
|
// flag to stat that session should be closed instead of returned to pool on
|
||||||
|
// next iteration
|
||||||
|
private volatile boolean shouldClose = false;
|
||||||
|
|
||||||
// keeps track of number of creates vs. closes to know when it can be
|
// keeps track of number of creates vs. closes to know when it can be
|
||||||
// returned to the pool
|
// returned to the pool
|
||||||
private final List<JmsSessionWrapper> references = new ArrayList<JmsSessionWrapper>(
|
private final List<JmsSessionWrapper> references = new ArrayList<JmsSessionWrapper>(
|
||||||
|
@ -101,6 +110,8 @@ public class JmsPooledSession {
|
||||||
public JmsPooledSession(JmsPooledConnection conn, Session sess) {
|
public JmsPooledSession(JmsPooledConnection conn, Session sess) {
|
||||||
this.conn = conn;
|
this.conn = conn;
|
||||||
this.sess = sess;
|
this.sess = sess;
|
||||||
|
this.thread = conn.getThread();
|
||||||
|
statusHandler.info("Opening session: " + this.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getCreateTime() {
|
public long getCreateTime() {
|
||||||
|
@ -120,12 +131,8 @@ public class JmsPooledSession {
|
||||||
return conn;
|
return conn;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getThreadKey() {
|
public Thread getThread() {
|
||||||
return threadKey;
|
return thread;
|
||||||
}
|
|
||||||
|
|
||||||
public void setThreadKey(String threadKey) {
|
|
||||||
this.threadKey = threadKey;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isValid() {
|
public boolean isValid() {
|
||||||
|
@ -436,6 +443,9 @@ public class JmsPooledSession {
|
||||||
String destKey = consumer.getDestKey();
|
String destKey = consumer.getDestKey();
|
||||||
boolean removed = false;
|
boolean removed = false;
|
||||||
|
|
||||||
|
// a consumer was closed, close the session at next opportunity
|
||||||
|
shouldClose = true;
|
||||||
|
|
||||||
synchronized (inUseConsumers) {
|
synchronized (inUseConsumers) {
|
||||||
JmsPooledConsumer inUse = inUseConsumers.remove(destKey);
|
JmsPooledConsumer inUse = inUseConsumers.remove(destKey);
|
||||||
removed = inUse == consumer;
|
removed = inUse == consumer;
|
||||||
|
@ -462,6 +472,7 @@ public class JmsPooledSession {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canClose) {
|
if (canClose) {
|
||||||
|
statusHandler.info("Closing session: " + this.toString());
|
||||||
closePooledConsumersProducers();
|
closePooledConsumersProducers();
|
||||||
|
|
||||||
// need to close down all wrappers
|
// need to close down all wrappers
|
||||||
|
@ -627,7 +638,7 @@ public class JmsPooledSession {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean valid = isValid();
|
boolean valid = isValid() && !shouldClose && hasProducersOrConsumers();
|
||||||
if (valid && returnToPool) {
|
if (valid && returnToPool) {
|
||||||
valid = conn.returnSessionToPool(this);
|
valid = conn.returnSessionToPool(this);
|
||||||
}
|
}
|
||||||
|
@ -654,4 +665,10 @@ public class JmsPooledSession {
|
||||||
public Object getStateLock() {
|
public Object getStateLock() {
|
||||||
return stateLock;
|
return stateLock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean hasProducersOrConsumers() {
|
||||||
|
return !inUseConsumers.isEmpty() || !inUseProducers.isEmpty()
|
||||||
|
|| !availableConsumers.isEmpty()
|
||||||
|
|| !availableProducers.isEmpty();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,8 +37,9 @@ import com.raytheon.uf.common.jms.JmsPooledConsumer;
|
||||||
*
|
*
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Apr 18, 2011 rjpeter Initial creation
|
* Apr 18, 2011 rjpeter Initial creation.
|
||||||
* Feb 26, 2013 1642 rjpeter Added volatile references for better concurrency handling.
|
* Feb 26, 2013 1642 rjpeter Added volatile references for better concurrency handling.
|
||||||
|
* Feb 07, 2014 2357 rjpeter Set linked exception in exception handling.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author rjpeter
|
* @author rjpeter
|
||||||
|
@ -124,8 +125,11 @@ public class JmsConsumerWrapper implements MessageConsumer {
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
exceptionOccurred = true;
|
exceptionOccurred = true;
|
||||||
JMSException exc = new JMSException(
|
JMSException exc = new JMSException(
|
||||||
"Exception occurred on pooled consumer");
|
"Exception occurred on pooled consumer in getMessageListener");
|
||||||
exc.initCause(e);
|
exc.initCause(e);
|
||||||
|
if (e instanceof Exception) {
|
||||||
|
exc.setLinkedException((Exception) e);
|
||||||
|
}
|
||||||
throw exc;
|
throw exc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -144,8 +148,11 @@ public class JmsConsumerWrapper implements MessageConsumer {
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
exceptionOccurred = true;
|
exceptionOccurred = true;
|
||||||
JMSException exc = new JMSException(
|
JMSException exc = new JMSException(
|
||||||
"Exception occurred on pooled consumer");
|
"Exception occurred on pooled consumer in getMessageSelector");
|
||||||
exc.initCause(e);
|
exc.initCause(e);
|
||||||
|
if (e instanceof Exception) {
|
||||||
|
exc.setLinkedException((Exception) e);
|
||||||
|
}
|
||||||
throw exc;
|
throw exc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -164,8 +171,11 @@ public class JmsConsumerWrapper implements MessageConsumer {
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
exceptionOccurred = true;
|
exceptionOccurred = true;
|
||||||
JMSException exc = new JMSException(
|
JMSException exc = new JMSException(
|
||||||
"Exception occurred on pooled consumer");
|
"Exception occurred on pooled consumer in receive");
|
||||||
exc.initCause(e);
|
exc.initCause(e);
|
||||||
|
if (e instanceof Exception) {
|
||||||
|
exc.setLinkedException((Exception) e);
|
||||||
|
}
|
||||||
throw exc;
|
throw exc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -184,8 +194,11 @@ public class JmsConsumerWrapper implements MessageConsumer {
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
exceptionOccurred = true;
|
exceptionOccurred = true;
|
||||||
JMSException exc = new JMSException(
|
JMSException exc = new JMSException(
|
||||||
"Exception occurred on pooled consumer");
|
"Exception occurred on pooled consumer in receive(timeout)");
|
||||||
exc.initCause(e);
|
exc.initCause(e);
|
||||||
|
if (e instanceof Exception) {
|
||||||
|
exc.setLinkedException((Exception) e);
|
||||||
|
}
|
||||||
throw exc;
|
throw exc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -204,8 +217,11 @@ public class JmsConsumerWrapper implements MessageConsumer {
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
exceptionOccurred = true;
|
exceptionOccurred = true;
|
||||||
JMSException exc = new JMSException(
|
JMSException exc = new JMSException(
|
||||||
"Exception occurred on pooled consumer");
|
"Exception occurred on pooled consumer in receiveNoWait");
|
||||||
exc.initCause(e);
|
exc.initCause(e);
|
||||||
|
if (e instanceof Exception) {
|
||||||
|
exc.setLinkedException((Exception) e);
|
||||||
|
}
|
||||||
throw exc;
|
throw exc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -226,8 +242,11 @@ public class JmsConsumerWrapper implements MessageConsumer {
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
exceptionOccurred = true;
|
exceptionOccurred = true;
|
||||||
JMSException exc = new JMSException(
|
JMSException exc = new JMSException(
|
||||||
"Exception occurred on pooled consumer");
|
"Exception occurred on pooled consumer in setMessageLister");
|
||||||
exc.initCause(e);
|
exc.initCause(e);
|
||||||
|
if (e instanceof Exception) {
|
||||||
|
exc.setLinkedException((Exception) e);
|
||||||
|
}
|
||||||
throw exc;
|
throw exc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,9 +37,10 @@ import com.raytheon.uf.common.jms.JmsPooledProducer;
|
||||||
*
|
*
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Dec fi8, 2011 rjpeter Initial creation
|
* Dec 08, 2011 rjpeter Initial creation.
|
||||||
* Feb 26, 2013 1642 rjpeter Added volatile references for better concurrency handling.
|
* Feb 26, 2013 1642 rjpeter Added volatile references for better concurrency handling.
|
||||||
* Jun 07, 2013 DR 16316 rjpeter Fix memory leak
|
* Jun 07, 2013 DR 16316 rjpeter Fix memory leak.
|
||||||
|
* Feb 07, 2014 2357 rjpeter Set linked exception in exception handling.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author rjpeter
|
* @author rjpeter
|
||||||
|
@ -122,6 +123,9 @@ public class JmsProducerWrapper implements MessageProducer {
|
||||||
JMSException exc = new JMSException(
|
JMSException exc = new JMSException(
|
||||||
"Exception occurred on pooled producer");
|
"Exception occurred on pooled producer");
|
||||||
exc.initCause(e);
|
exc.initCause(e);
|
||||||
|
if (e instanceof Exception) {
|
||||||
|
exc.setLinkedException((Exception) e);
|
||||||
|
}
|
||||||
throw exc;
|
throw exc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -142,6 +146,9 @@ public class JmsProducerWrapper implements MessageProducer {
|
||||||
JMSException exc = new JMSException(
|
JMSException exc = new JMSException(
|
||||||
"Exception occurred on pooled producer");
|
"Exception occurred on pooled producer");
|
||||||
exc.initCause(e);
|
exc.initCause(e);
|
||||||
|
if (e instanceof Exception) {
|
||||||
|
exc.setLinkedException((Exception) e);
|
||||||
|
}
|
||||||
throw exc;
|
throw exc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -162,6 +169,9 @@ public class JmsProducerWrapper implements MessageProducer {
|
||||||
JMSException exc = new JMSException(
|
JMSException exc = new JMSException(
|
||||||
"Exception occurred on pooled producer");
|
"Exception occurred on pooled producer");
|
||||||
exc.initCause(e);
|
exc.initCause(e);
|
||||||
|
if (e instanceof Exception) {
|
||||||
|
exc.setLinkedException((Exception) e);
|
||||||
|
}
|
||||||
throw exc;
|
throw exc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -182,6 +192,9 @@ public class JmsProducerWrapper implements MessageProducer {
|
||||||
JMSException exc = new JMSException(
|
JMSException exc = new JMSException(
|
||||||
"Exception occurred on pooled producer");
|
"Exception occurred on pooled producer");
|
||||||
exc.initCause(e);
|
exc.initCause(e);
|
||||||
|
if (e instanceof Exception) {
|
||||||
|
exc.setLinkedException((Exception) e);
|
||||||
|
}
|
||||||
throw exc;
|
throw exc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -202,6 +215,9 @@ public class JmsProducerWrapper implements MessageProducer {
|
||||||
JMSException exc = new JMSException(
|
JMSException exc = new JMSException(
|
||||||
"Exception occurred on pooled producer");
|
"Exception occurred on pooled producer");
|
||||||
exc.initCause(e);
|
exc.initCause(e);
|
||||||
|
if (e instanceof Exception) {
|
||||||
|
exc.setLinkedException((Exception) e);
|
||||||
|
}
|
||||||
throw exc;
|
throw exc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -222,6 +238,9 @@ public class JmsProducerWrapper implements MessageProducer {
|
||||||
JMSException exc = new JMSException(
|
JMSException exc = new JMSException(
|
||||||
"Exception occurred on pooled producer");
|
"Exception occurred on pooled producer");
|
||||||
exc.initCause(e);
|
exc.initCause(e);
|
||||||
|
if (e instanceof Exception) {
|
||||||
|
exc.setLinkedException((Exception) e);
|
||||||
|
}
|
||||||
throw exc;
|
throw exc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -242,6 +261,9 @@ public class JmsProducerWrapper implements MessageProducer {
|
||||||
JMSException exc = new JMSException(
|
JMSException exc = new JMSException(
|
||||||
"Exception occurred on pooled producer");
|
"Exception occurred on pooled producer");
|
||||||
exc.initCause(e);
|
exc.initCause(e);
|
||||||
|
if (e instanceof Exception) {
|
||||||
|
exc.setLinkedException((Exception) e);
|
||||||
|
}
|
||||||
throw exc;
|
throw exc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -264,6 +286,9 @@ public class JmsProducerWrapper implements MessageProducer {
|
||||||
JMSException exc = new JMSException(
|
JMSException exc = new JMSException(
|
||||||
"Exception occurred on pooled producer");
|
"Exception occurred on pooled producer");
|
||||||
exc.initCause(e);
|
exc.initCause(e);
|
||||||
|
if (e instanceof Exception) {
|
||||||
|
exc.setLinkedException((Exception) e);
|
||||||
|
}
|
||||||
throw exc;
|
throw exc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -285,6 +310,9 @@ public class JmsProducerWrapper implements MessageProducer {
|
||||||
JMSException exc = new JMSException(
|
JMSException exc = new JMSException(
|
||||||
"Exception occurred on pooled producer");
|
"Exception occurred on pooled producer");
|
||||||
exc.initCause(e);
|
exc.initCause(e);
|
||||||
|
if (e instanceof Exception) {
|
||||||
|
exc.setLinkedException((Exception) e);
|
||||||
|
}
|
||||||
throw exc;
|
throw exc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -309,6 +337,9 @@ public class JmsProducerWrapper implements MessageProducer {
|
||||||
JMSException exc = new JMSException(
|
JMSException exc = new JMSException(
|
||||||
"Exception occurred on pooled producer");
|
"Exception occurred on pooled producer");
|
||||||
exc.initCause(e);
|
exc.initCause(e);
|
||||||
|
if (e instanceof Exception) {
|
||||||
|
exc.setLinkedException((Exception) e);
|
||||||
|
}
|
||||||
throw exc;
|
throw exc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -329,6 +360,9 @@ public class JmsProducerWrapper implements MessageProducer {
|
||||||
JMSException exc = new JMSException(
|
JMSException exc = new JMSException(
|
||||||
"Exception occurred on pooled producer");
|
"Exception occurred on pooled producer");
|
||||||
exc.initCause(e);
|
exc.initCause(e);
|
||||||
|
if (e instanceof Exception) {
|
||||||
|
exc.setLinkedException((Exception) e);
|
||||||
|
}
|
||||||
throw exc;
|
throw exc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -349,6 +383,9 @@ public class JmsProducerWrapper implements MessageProducer {
|
||||||
JMSException exc = new JMSException(
|
JMSException exc = new JMSException(
|
||||||
"Exception occurred on pooled producer");
|
"Exception occurred on pooled producer");
|
||||||
exc.initCause(e);
|
exc.initCause(e);
|
||||||
|
if (e instanceof Exception) {
|
||||||
|
exc.setLinkedException((Exception) e);
|
||||||
|
}
|
||||||
throw exc;
|
throw exc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -369,6 +406,9 @@ public class JmsProducerWrapper implements MessageProducer {
|
||||||
JMSException exc = new JMSException(
|
JMSException exc = new JMSException(
|
||||||
"Exception occurred on pooled producer");
|
"Exception occurred on pooled producer");
|
||||||
exc.initCause(e);
|
exc.initCause(e);
|
||||||
|
if (e instanceof Exception) {
|
||||||
|
exc.setLinkedException((Exception) e);
|
||||||
|
}
|
||||||
throw exc;
|
throw exc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -389,6 +429,9 @@ public class JmsProducerWrapper implements MessageProducer {
|
||||||
JMSException exc = new JMSException(
|
JMSException exc = new JMSException(
|
||||||
"Exception occurred on pooled producer");
|
"Exception occurred on pooled producer");
|
||||||
exc.initCause(e);
|
exc.initCause(e);
|
||||||
|
if (e instanceof Exception) {
|
||||||
|
exc.setLinkedException((Exception) e);
|
||||||
|
}
|
||||||
throw exc;
|
throw exc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -409,6 +452,9 @@ public class JmsProducerWrapper implements MessageProducer {
|
||||||
JMSException exc = new JMSException(
|
JMSException exc = new JMSException(
|
||||||
"Exception occurred on pooled producer");
|
"Exception occurred on pooled producer");
|
||||||
exc.initCause(e);
|
exc.initCause(e);
|
||||||
|
if (e instanceof Exception) {
|
||||||
|
exc.setLinkedException((Exception) e);
|
||||||
|
}
|
||||||
throw exc;
|
throw exc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,17 +15,6 @@
|
||||||
<constructor-arg value="com.raytheon.uf.common.activetable"/>
|
<constructor-arg value="com.raytheon.uf.common.activetable"/>
|
||||||
<constructor-arg ref="activeTableDatabaseProperties"/>
|
<constructor-arg ref="activeTableDatabaseProperties"/>
|
||||||
</bean>
|
</bean>
|
||||||
<bean id="jms-activetable" class="org.apache.camel.component.jms.JmsComponent">
|
|
||||||
<constructor-arg ref="jmsActiveTableConfig" />
|
|
||||||
<property name="taskExecutor" ref="activeTableMergeThreadPool" />
|
|
||||||
</bean>
|
|
||||||
<bean id="jmsActiveTableConfig" class="org.apache.camel.component.jms.JmsConfiguration"
|
|
||||||
factory-bean="jmsConfig" factory-method="copy" />
|
|
||||||
<bean id="activeTableMergeThreadPool"
|
|
||||||
class="com.raytheon.uf.edex.esb.camel.spring.JmsThreadPoolTaskExecutor">
|
|
||||||
<property name="corePoolSize" value="2" />
|
|
||||||
<property name="maxPoolSize" value="2" />
|
|
||||||
</bean>
|
|
||||||
<bean id="timeOffsetDecoder" class="com.raytheon.uf.edex.python.decoder.TimeOffsetDecoder">
|
<bean id="timeOffsetDecoder" class="com.raytheon.uf.edex.python.decoder.TimeOffsetDecoder">
|
||||||
<property name="pluginName" value="warning" />
|
<property name="pluginName" value="warning" />
|
||||||
<property name="pluginFQN" value="com.raytheon.edex.plugin.warning" />
|
<property name="pluginFQN" value="com.raytheon.edex.plugin.warning" />
|
||||||
|
@ -46,7 +35,7 @@
|
||||||
<to uri="jms-generic:topic:edex.alerts.vtec?timeToLive=60000" />
|
<to uri="jms-generic:topic:edex.alerts.vtec?timeToLive=60000" />
|
||||||
</route>
|
</route>
|
||||||
<route id="practiceVtecRoute">
|
<route id="practiceVtecRoute">
|
||||||
<from uri="jms-activetable:queue:practiceActiveTable?concurrentConsumers=1" />
|
<from uri="jms-generic:queue:practiceActiveTable" />
|
||||||
<doTry>
|
<doTry>
|
||||||
<bean ref="activeTable" method="dumpProductToTempFile" />
|
<bean ref="activeTable" method="dumpProductToTempFile" />
|
||||||
<bean ref="practiceWarningDecoder" method="decode" />
|
<bean ref="practiceWarningDecoder" method="decode" />
|
||||||
|
|
|
@ -25,8 +25,8 @@
|
||||||
<from uri="jms-generic:queue:practiceNotify" />
|
<from uri="jms-generic:queue:practiceNotify" />
|
||||||
<doTry>
|
<doTry>
|
||||||
<multicast parallelProcessing="false">
|
<multicast parallelProcessing="false">
|
||||||
<to uri="jms-warning:queue:edex.spcWatch" />
|
<to uri="jms-durable:queue:edex.spcWatch" />
|
||||||
<to uri="jms-warning:queue:edex.tpcWatch" />
|
<to uri="jms-durable:queue:edex.tpcWatch" />
|
||||||
</multicast>
|
</multicast>
|
||||||
<doCatch>
|
<doCatch>
|
||||||
<exception>java.lang.Throwable</exception>
|
<exception>java.lang.Throwable</exception>
|
||||||
|
|
|
@ -77,6 +77,7 @@ import com.raytheon.uf.edex.database.processor.IDatabaseProcessor;
|
||||||
* Dec 10, 2013 2555 rjpeter Initial creation.
|
* Dec 10, 2013 2555 rjpeter Initial creation.
|
||||||
* Jan 23, 2014 2555 rjpeter Updated to be a row at a time using ScrollableResults.
|
* Jan 23, 2014 2555 rjpeter Updated to be a row at a time using ScrollableResults.
|
||||||
* Feb 04, 2014 2770 rferrel The dumpPdos now dumps all PluginDataObjects.
|
* Feb 04, 2014 2770 rferrel The dumpPdos now dumps all PluginDataObjects.
|
||||||
|
* Feb 12, 2014 2784 rjpeter Update logging for dup elim scenarios.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author rjpeter
|
* @author rjpeter
|
||||||
|
@ -194,6 +195,7 @@ public class DatabaseArchiveProcessor<T extends PersistableDataObject<?>>
|
||||||
if (entriesInMemory > 0) {
|
if (entriesInMemory > 0) {
|
||||||
try {
|
try {
|
||||||
savePdoMap(pdosByFile);
|
savePdoMap(pdosByFile);
|
||||||
|
pdosByFile.clear();
|
||||||
int prev = recordsSaved;
|
int prev = recordsSaved;
|
||||||
recordsSaved += entriesInMemory;
|
recordsSaved += entriesInMemory;
|
||||||
statusHandler.info(pluginName + ": Processed rows " + prev
|
statusHandler.info(pluginName + ": Processed rows " + prev
|
||||||
|
@ -436,74 +438,93 @@ public class DatabaseArchiveProcessor<T extends PersistableDataObject<?>>
|
||||||
}
|
}
|
||||||
|
|
||||||
List<PersistableDataObject<?>> pdosFromDisk = readDataFromDisk(dataFile);
|
List<PersistableDataObject<?>> pdosFromDisk = readDataFromDisk(dataFile);
|
||||||
if (statusHandler.isPriorityEnabled(Priority.DEBUG)) {
|
if (pdosFromDisk.size() > 0) {
|
||||||
statusHandler.debug(pluginName + ": Checking "
|
|
||||||
+ pdosFromDisk.size() + " old records from file: "
|
|
||||||
+ dataFile.getAbsolutePath());
|
|
||||||
}
|
|
||||||
Iterator<PersistableDataObject<?>> pdoIter = pdosFromDisk
|
|
||||||
.iterator();
|
|
||||||
boolean needsUpdate = false;
|
|
||||||
int dupsRemoved = 0;
|
|
||||||
int index = 0;
|
|
||||||
while (pdoIter.hasNext() && (index < dupElimUntil)) {
|
|
||||||
PersistableDataObject<?> pdo = pdoIter.next();
|
|
||||||
|
|
||||||
if (identifierSet.contains(pdo.getIdentifier())) {
|
|
||||||
pdoIter.remove();
|
|
||||||
needsUpdate = true;
|
|
||||||
dupsRemoved++;
|
|
||||||
}
|
|
||||||
|
|
||||||
index++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (statusHandler.isPriorityEnabled(Priority.DEBUG)
|
|
||||||
&& (dupsRemoved > 0)) {
|
|
||||||
statusHandler.debug(pluginName + ": Removed " + dupsRemoved
|
|
||||||
+ " old records from file: "
|
|
||||||
+ dataFile.getAbsolutePath());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!fileIter.hasNext() && (pdosFromDisk.size() < fetchSize)) {
|
|
||||||
// last file, add more data to it
|
|
||||||
needsUpdate = true;
|
|
||||||
|
|
||||||
if (prevFileStatus == null) {
|
|
||||||
prevFileStatus = new FileStatus();
|
|
||||||
prevFileStatus.dupElimUntilIndex = pdosFromDisk.size();
|
|
||||||
prevFileStatus.fileFull = pdos.size() >= fetchSize;
|
|
||||||
filesCreatedThisSession.put(dataFile.getAbsolutePath(),
|
|
||||||
prevFileStatus);
|
|
||||||
}
|
|
||||||
|
|
||||||
int numToAdd = fetchSize - pdosFromDisk.size();
|
|
||||||
numToAdd = Math.min(numToAdd, pdos.size());
|
|
||||||
|
|
||||||
if (statusHandler.isPriorityEnabled(Priority.DEBUG)) {
|
if (statusHandler.isPriorityEnabled(Priority.DEBUG)) {
|
||||||
statusHandler.debug(pluginName + ": Adding " + numToAdd
|
statusHandler.debug(pluginName + ": Checking "
|
||||||
+ " records to file: "
|
+ pdosFromDisk.size()
|
||||||
|
+ " old records from file: "
|
||||||
+ dataFile.getAbsolutePath());
|
+ dataFile.getAbsolutePath());
|
||||||
}
|
}
|
||||||
|
|
||||||
pdosFromDisk.addAll(pdos.subList(0, numToAdd));
|
Iterator<PersistableDataObject<?>> pdoIter = pdosFromDisk
|
||||||
if (numToAdd < pdos.size()) {
|
.iterator();
|
||||||
pdos = pdos.subList(numToAdd, pdos.size());
|
int dupsRemoved = 0;
|
||||||
} else {
|
int index = 0;
|
||||||
pdos = Collections.emptyList();
|
boolean needsUpdate = false;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (needsUpdate) {
|
while (pdoIter.hasNext() && (index < dupElimUntil)) {
|
||||||
if (!pdosFromDisk.isEmpty()) {
|
PersistableDataObject<?> pdo = pdoIter.next();
|
||||||
writeDataToDisk(dataFile, pdosFromDisk);
|
|
||||||
if (prevFileStatus != null) {
|
if (identifierSet.contains(pdo.getIdentifier())) {
|
||||||
prevFileStatus.fileFull = pdosFromDisk.size() >= fetchSize;
|
pdoIter.remove();
|
||||||
|
needsUpdate = true;
|
||||||
|
dupsRemoved++;
|
||||||
|
}
|
||||||
|
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dupsRemoved > 0) {
|
||||||
|
statusHandler.info(pluginName + ": Removed "
|
||||||
|
+ dupsRemoved + " old records from file: "
|
||||||
|
+ dataFile.getAbsolutePath());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!fileIter.hasNext()
|
||||||
|
&& (pdosFromDisk.size() < fetchSize)) {
|
||||||
|
// last file, add more data to it
|
||||||
|
needsUpdate = true;
|
||||||
|
|
||||||
|
if (prevFileStatus == null) {
|
||||||
|
prevFileStatus = new FileStatus();
|
||||||
|
prevFileStatus.dupElimUntilIndex = pdosFromDisk
|
||||||
|
.size();
|
||||||
|
prevFileStatus.fileFull = pdos.size() >= fetchSize;
|
||||||
|
filesCreatedThisSession.put(
|
||||||
|
dataFile.getAbsolutePath(), prevFileStatus);
|
||||||
|
}
|
||||||
|
|
||||||
|
int numToAdd = fetchSize - pdosFromDisk.size();
|
||||||
|
numToAdd = Math.min(numToAdd, pdos.size());
|
||||||
|
|
||||||
|
if (statusHandler.isPriorityEnabled(Priority.DEBUG)) {
|
||||||
|
statusHandler.debug(pluginName + ": Adding "
|
||||||
|
+ numToAdd + " records to file: "
|
||||||
|
+ dataFile.getAbsolutePath());
|
||||||
|
}
|
||||||
|
|
||||||
|
pdosFromDisk.addAll(pdos.subList(0, numToAdd));
|
||||||
|
if (numToAdd < pdos.size()) {
|
||||||
|
pdos = pdos.subList(numToAdd, pdos.size());
|
||||||
|
} else {
|
||||||
|
pdos = Collections.emptyList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (needsUpdate) {
|
||||||
|
if (!pdosFromDisk.isEmpty()) {
|
||||||
|
writeDataToDisk(dataFile, pdosFromDisk);
|
||||||
|
if (prevFileStatus != null) {
|
||||||
|
prevFileStatus.fileFull = pdosFromDisk.size() >= fetchSize;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
|
dirsToCheckNumbering.add(dataFile.getParentFile());
|
||||||
|
if (dataFile.exists() && !dataFile.delete()) {
|
||||||
|
statusHandler
|
||||||
|
.error(pluginName
|
||||||
|
+ ": Failed to delete file ["
|
||||||
|
+ dataFile.getAbsolutePath()
|
||||||
|
+ "], all entries have been updated in later files.");
|
||||||
|
if (!dataFile.renameTo(new File(dataFile
|
||||||
|
.getAbsoluteFile() + ".bad"))) {
|
||||||
|
statusHandler.error(pluginName + ": file ["
|
||||||
|
+ dataFile.getAbsoluteFile()
|
||||||
|
+ "] cannot be renamed to .bad");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fileIter.remove();
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
dirsToCheckNumbering.add(dataFile.getParentFile());
|
|
||||||
dataFile.delete();
|
|
||||||
fileIter.remove();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -543,7 +564,13 @@ public class DatabaseArchiveProcessor<T extends PersistableDataObject<?>>
|
||||||
} finally {
|
} finally {
|
||||||
if (!successful) {
|
if (!successful) {
|
||||||
// couldn't read in file, move it to bad
|
// couldn't read in file, move it to bad
|
||||||
file.renameTo(new File(file.getAbsoluteFile() + ".bad"));
|
if (file.exists()
|
||||||
|
&& !file.renameTo(new File(file.getAbsoluteFile()
|
||||||
|
+ ".bad"))) {
|
||||||
|
statusHandler.error(pluginName + ": file ["
|
||||||
|
+ file.getAbsoluteFile()
|
||||||
|
+ "] cannot be renamed to .bad");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (is != null) {
|
if (is != null) {
|
||||||
try {
|
try {
|
||||||
|
@ -668,8 +695,9 @@ public class DatabaseArchiveProcessor<T extends PersistableDataObject<?>>
|
||||||
writer = new BufferedWriter(new FileWriter(dumpFile));
|
writer = new BufferedWriter(new FileWriter(dumpFile));
|
||||||
|
|
||||||
if (statusHandler.isPriorityEnabled(Priority.INFO)) {
|
if (statusHandler.isPriorityEnabled(Priority.INFO)) {
|
||||||
statusHandler.info(String.format("%s: Dumping records to: %s",
|
statusHandler.info(String.format("%s: Dumping " + pdos.size()
|
||||||
pluginName, dumpFile.getAbsolutePath()));
|
+ " records to: %s", pluginName,
|
||||||
|
dumpFile.getAbsolutePath()));
|
||||||
}
|
}
|
||||||
|
|
||||||
while (pdoIter.hasNext()) {
|
while (pdoIter.hasNext()) {
|
||||||
|
@ -753,6 +781,8 @@ public class DatabaseArchiveProcessor<T extends PersistableDataObject<?>>
|
||||||
} while (size > 0);
|
} while (size > 0);
|
||||||
|
|
||||||
DecimalFormat format = new DecimalFormat(formatString.toString());
|
DecimalFormat format = new DecimalFormat(formatString.toString());
|
||||||
|
statusHandler.info("Checking file numbering consistency for "
|
||||||
|
+ dir.getAbsolutePath());
|
||||||
|
|
||||||
for (Map.Entry<Integer, File> entry : fileMap.entrySet()) {
|
for (Map.Entry<Integer, File> entry : fileMap.entrySet()) {
|
||||||
int fileNum = entry.getKey();
|
int fileNum = entry.getKey();
|
||||||
|
@ -771,7 +801,15 @@ public class DatabaseArchiveProcessor<T extends PersistableDataObject<?>>
|
||||||
}
|
}
|
||||||
|
|
||||||
File newFile = new File(oldFile.getParent(), newFileName);
|
File newFile = new File(oldFile.getParent(), newFileName);
|
||||||
oldFile.renameTo(newFile);
|
if (!oldFile.renameTo(newFile)) {
|
||||||
|
statusHandler
|
||||||
|
.error("Failed rename file "
|
||||||
|
+ oldFile.getAbsolutePath()
|
||||||
|
+ " to "
|
||||||
|
+ newFile.getAbsolutePath()
|
||||||
|
+ ". Stopping file number consistency checking.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nextFileCount++;
|
nextFileCount++;
|
||||||
|
|
|
@ -58,6 +58,7 @@ import com.raytheon.uf.edex.database.plugin.PluginFactory;
|
||||||
* Nov 05, 2013 2499 rjpeter Repackaged, removed config files, always compresses hdf5.
|
* Nov 05, 2013 2499 rjpeter Repackaged, removed config files, always compresses hdf5.
|
||||||
* Nov 11, 2013 2478 rjpeter Updated data store copy to always copy hdf5.
|
* Nov 11, 2013 2478 rjpeter Updated data store copy to always copy hdf5.
|
||||||
* Dec 13, 2013 2555 rjpeter Refactored logic into DatabaseArchiveProcessor.
|
* Dec 13, 2013 2555 rjpeter Refactored logic into DatabaseArchiveProcessor.
|
||||||
|
* Feb 12, 2014 2784 rjpeter Fixed clusterLock to not update the time by default.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author rjpeter
|
* @author rjpeter
|
||||||
|
@ -145,14 +146,16 @@ public class DatabaseArchiver implements IPluginArchiver {
|
||||||
|
|
||||||
// cluster lock, grabbing time of last successful archive
|
// cluster lock, grabbing time of last successful archive
|
||||||
CurrentTimeClusterLockHandler lockHandler = new CurrentTimeClusterLockHandler(
|
CurrentTimeClusterLockHandler lockHandler = new CurrentTimeClusterLockHandler(
|
||||||
CLUSTER_LOCK_TIMEOUT, dateFormat.format(runTime.getTime()),
|
CLUSTER_LOCK_TIMEOUT, false);
|
||||||
false);
|
|
||||||
ClusterTask ct = ClusterLockUtils.lock(TASK_NAME, pluginName,
|
ClusterTask ct = ClusterLockUtils.lock(TASK_NAME, pluginName,
|
||||||
lockHandler, false);
|
lockHandler, false);
|
||||||
if (!LockState.SUCCESSFUL.equals(ct.getLockState())) {
|
if (!LockState.SUCCESSFUL.equals(ct.getLockState())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// keep extra info the same until processing updates the time.
|
||||||
|
lockHandler.setExtraInfo(ct.getExtraInfo());
|
||||||
|
|
||||||
Calendar startTime = null;
|
Calendar startTime = null;
|
||||||
long timimgStartMillis = System.currentTimeMillis();
|
long timimgStartMillis = System.currentTimeMillis();
|
||||||
int recordCount = 0;
|
int recordCount = 0;
|
||||||
|
@ -226,12 +229,6 @@ public class DatabaseArchiver implements IPluginArchiver {
|
||||||
.info(pluginName + ": Found no records to archive");
|
.info(pluginName + ": Found no records to archive");
|
||||||
}
|
}
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
// previous run time needs to be reset
|
|
||||||
if (startTime != null) {
|
|
||||||
lockHandler
|
|
||||||
.setExtraInfo(dateFormat.format(startTime.getTime()));
|
|
||||||
}
|
|
||||||
|
|
||||||
statusHandler.error(pluginName + ": Error occurred archiving data",
|
statusHandler.error(pluginName + ": Error occurred archiving data",
|
||||||
e);
|
e);
|
||||||
} finally {
|
} finally {
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
autoStartup="false">
|
autoStartup="false">
|
||||||
<!-- Need to reroute to a queue to allow for multiple jms consumers -->
|
<!-- Need to reroute to a queue to allow for multiple jms consumers -->
|
||||||
<route id="cpgsrvTopicToQueueRoute">
|
<route id="cpgsrvTopicToQueueRoute">
|
||||||
<from uri="jms-generic:topic:edex.alerts"/>
|
<from uri="jms-generic:topic:edex.alerts?threadName=cpgsrv-edex.alerts"/>
|
||||||
<!-- technically with qpid should be able to make this a durable subscription and not need to forward to another queue -->
|
<!-- technically with qpid should be able to make this a durable subscription and not need to forward to another queue -->
|
||||||
<doTry>
|
<doTry>
|
||||||
<multicast>
|
<multicast>
|
||||||
|
|
|
@ -3,21 +3,6 @@
|
||||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
||||||
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
||||||
|
|
||||||
<bean id="jmsIngestHarvesterConfig" class="org.apache.camel.component.jms.JmsConfiguration"
|
|
||||||
factory-bean="jmsGenericConfig" factory-method="copy">
|
|
||||||
</bean>
|
|
||||||
|
|
||||||
<bean id="jms-harvester" class="org.apache.camel.component.jms.JmsComponent">
|
|
||||||
<constructor-arg ref="jmsIngestHarvesterConfig" />
|
|
||||||
<property name="taskExecutor" ref="harvesterThreadPool" />
|
|
||||||
</bean>
|
|
||||||
|
|
||||||
<bean id="harvesterThreadPool"
|
|
||||||
class="com.raytheon.uf.edex.esb.camel.spring.JmsThreadPoolTaskExecutor">
|
|
||||||
<property name="corePoolSize" value="${metadata-process.threads}" />
|
|
||||||
<property name="maxPoolSize" value="${metadata-process.threads}" />
|
|
||||||
</bean>
|
|
||||||
|
|
||||||
<bean id="crawlerCommunicationStrategy" class="com.raytheon.uf.edex.datadelivery.harvester.crawler.FileCommunicationStrategy" />
|
<bean id="crawlerCommunicationStrategy" class="com.raytheon.uf.edex.datadelivery.harvester.crawler.FileCommunicationStrategy" />
|
||||||
|
|
||||||
<bean id="MetaDataProcessor" class="com.raytheon.uf.edex.datadelivery.harvester.CrawlMetaDataHandler" depends-on="registryInit,registerDataDeliveryHandlers,registryManagerInstanceInitializer">
|
<bean id="MetaDataProcessor" class="com.raytheon.uf.edex.datadelivery.harvester.CrawlMetaDataHandler" depends-on="registryInit,registerDataDeliveryHandlers,registryManagerInstanceInitializer">
|
||||||
|
@ -29,11 +14,11 @@
|
||||||
errorHandlerRef="errorHandler">
|
errorHandlerRef="errorHandler">
|
||||||
|
|
||||||
<endpoint id="metaDataCron" uri="quartz://datadelivery/harvester/?cron=${metadata-process.cron}"/>
|
<endpoint id="metaDataCron" uri="quartz://datadelivery/harvester/?cron=${metadata-process.cron}"/>
|
||||||
<endpoint id="harvesterProcessWorkEndpoint" uri="jms-harvester:queue:metaDataProcessWork?concurrentConsumers=${metadata-process.threads}"/>
|
<endpoint id="harvesterProcessWorkEndpoint" uri="jms-generic:queue:metaDataProcessWork?concurrentConsumers=${metadata-process.threads}&threadName=harvester"/>
|
||||||
|
|
||||||
<route id="metaDataProcess">
|
<route id="metaDataProcess">
|
||||||
<from uri="metaDataCron" />
|
<from uri="metaDataCron" />
|
||||||
<to uri="jms-harvester:queue:metaDataProcessWork" />
|
<to uri="jms-generic:queue:metaDataProcessWork" />
|
||||||
</route>
|
</route>
|
||||||
|
|
||||||
<route id="metaDataProcessWork">
|
<route id="metaDataProcessWork">
|
||||||
|
|
|
@ -8,19 +8,6 @@
|
||||||
<bean id="handleoupDistributionSrv" class="com.raytheon.uf.edex.distribution.DistributionSrv" />
|
<bean id="handleoupDistributionSrv" class="com.raytheon.uf.edex.distribution.DistributionSrv" />
|
||||||
<bean id="radarserverDistributionSrv" class="com.raytheon.uf.edex.distribution.DistributionSrv" />
|
<bean id="radarserverDistributionSrv" class="com.raytheon.uf.edex.distribution.DistributionSrv" />
|
||||||
|
|
||||||
<bean id="jms-dist" class="org.apache.camel.component.jms.JmsComponent">
|
|
||||||
<!-- All initial distribution queues are durable -->
|
|
||||||
<constructor-arg ref="jmsDistConfig" />
|
|
||||||
<property name="taskExecutor" ref="distributionThreadPool" />
|
|
||||||
</bean>
|
|
||||||
<bean id="jmsDistConfig" class="org.apache.camel.component.jms.JmsConfiguration"
|
|
||||||
factory-bean="jmsDurableConfig" factory-method="copy"/>
|
|
||||||
<bean id="distributionThreadPool"
|
|
||||||
class="com.raytheon.uf.edex.esb.camel.spring.JmsThreadPoolTaskExecutor">
|
|
||||||
<property name="corePoolSize" value="7" />
|
|
||||||
<property name="maxPoolSize" value="7" />
|
|
||||||
</bean>
|
|
||||||
|
|
||||||
<camelContext id="distro"
|
<camelContext id="distro"
|
||||||
xmlns="http://camel.apache.org/schema/spring"
|
xmlns="http://camel.apache.org/schema/spring"
|
||||||
errorHandlerRef="errorHandler"
|
errorHandlerRef="errorHandler"
|
||||||
|
@ -29,7 +16,7 @@
|
||||||
<endpoint id="refreshDistributionCron" uri="quartz://refreshDist/refreshDistRoute/?cron=${distribution.cron}"/>
|
<endpoint id="refreshDistributionCron" uri="quartz://refreshDist/refreshDistRoute/?cron=${distribution.cron}"/>
|
||||||
|
|
||||||
<route id="distribution">
|
<route id="distribution">
|
||||||
<from uri="jms-dist:queue:external.dropbox?concurrentConsumers=5&maxConcurrentConsumers=5"/>
|
<from uri="jms-durable:queue:external.dropbox?concurrentConsumers=5&maxConcurrentConsumers=5"/>
|
||||||
<doTry>
|
<doTry>
|
||||||
<bean ref="distributionSrv" method="route" />
|
<bean ref="distributionSrv" method="route" />
|
||||||
<doCatch>
|
<doCatch>
|
||||||
|
@ -40,7 +27,7 @@
|
||||||
</route>
|
</route>
|
||||||
|
|
||||||
<route id="handleoupDistribution">
|
<route id="handleoupDistribution">
|
||||||
<from uri="jms-dist:queue:handleoup.dropbox"/>
|
<from uri="jms-durable:queue:handleoup.dropbox"/>
|
||||||
<doTry>
|
<doTry>
|
||||||
<bean ref="handleoupDistributionSrv" method="route" />
|
<bean ref="handleoupDistributionSrv" method="route" />
|
||||||
<doCatch>
|
<doCatch>
|
||||||
|
@ -51,7 +38,7 @@
|
||||||
</route>
|
</route>
|
||||||
|
|
||||||
<route id="radarserverDistribution">
|
<route id="radarserverDistribution">
|
||||||
<from uri="jms-dist:queue:radarserver.dropbox" />
|
<from uri="jms-durable:queue:radarserver.dropbox" />
|
||||||
<doTry>
|
<doTry>
|
||||||
<bean ref="radarserverDistributionSrv" method="route" />
|
<bean ref="radarserverDistributionSrv" method="route" />
|
||||||
<doCatch>
|
<doCatch>
|
||||||
|
|
|
@ -0,0 +1,101 @@
|
||||||
|
/**
|
||||||
|
* This software was developed and / or modified by Raytheon Company,
|
||||||
|
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||||
|
*
|
||||||
|
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||||
|
* This software product contains export-restricted data whose
|
||||||
|
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||||
|
* to non-U.S. persons whether in the United States or abroad requires
|
||||||
|
* an export license or other authorization.
|
||||||
|
*
|
||||||
|
* Contractor Name: Raytheon Company
|
||||||
|
* Contractor Address: 6825 Pine Street, Suite 340
|
||||||
|
* Mail Stop B8
|
||||||
|
* Omaha, NE 68106
|
||||||
|
* 402.291.0100
|
||||||
|
*
|
||||||
|
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||||
|
* further licensing information.
|
||||||
|
**/
|
||||||
|
package com.raytheon.uf.edex.esb.camel.jms;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.camel.Endpoint;
|
||||||
|
import org.apache.camel.component.jms.JmsComponent;
|
||||||
|
import org.apache.camel.component.jms.JmsEndpoint;
|
||||||
|
|
||||||
|
import com.raytheon.uf.edex.esb.camel.spring.JmsThreadPoolTaskExecutor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom JMS component that makes dedicated thread pools for each JmsEndpoint
|
||||||
|
* based on the concurrent consumers needed. Each pool is named based on the JMS
|
||||||
|
* endpoint. Each endpoint also overrides the message listener container factory
|
||||||
|
* to monitor the created containers to see if they need to be restarted in a
|
||||||
|
* disconnect scenario.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
*
|
||||||
|
* SOFTWARE HISTORY
|
||||||
|
* Date Ticket# Engineer Description
|
||||||
|
* ------------ ---------- ----------- --------------------------
|
||||||
|
* Feb 07, 2014 2357 rjpeter Initial creation.
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @author rjpeter
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
public class DedicatedThreadJmsComponent extends JmsComponent {
|
||||||
|
|
||||||
|
public DedicatedThreadJmsComponent(
|
||||||
|
org.apache.camel.component.jms.JmsConfiguration jmsconfig) {
|
||||||
|
super(jmsconfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see
|
||||||
|
* org.apache.camel.component.jms.JmsComponent#createEndpoint(java.lang.
|
||||||
|
* String, java.lang.String, java.util.Map)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected Endpoint createEndpoint(String uri, String remaining,
|
||||||
|
Map<String, Object> parameters) throws Exception {
|
||||||
|
String threadName = (String) parameters.remove("threadName");
|
||||||
|
Endpoint e = super.createEndpoint(uri, remaining, parameters);
|
||||||
|
if (e instanceof JmsEndpoint) {
|
||||||
|
JmsEndpoint jmsE = (JmsEndpoint) e;
|
||||||
|
if ((threadName != null) && (threadName.length() > 0)
|
||||||
|
&& !threadName.endsWith("-")) {
|
||||||
|
threadName += "-";
|
||||||
|
} else {
|
||||||
|
threadName = jmsE.getDestinationName() + "-";
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* This is used for a SimpleMessageListenerContainer use case.
|
||||||
|
*
|
||||||
|
* JmsSimpleMessageListenerTaskExecutor executor = new
|
||||||
|
* JmsSimpleMessageListenerTaskExecutor(
|
||||||
|
* jmsE.getConcurrentConsumers(), threadName);
|
||||||
|
*/
|
||||||
|
// DefaultMessageListenerContainer use case
|
||||||
|
JmsThreadPoolTaskExecutor executor = new JmsThreadPoolTaskExecutor();
|
||||||
|
executor.setThreadNamePrefix(threadName);
|
||||||
|
executor.setCorePoolSize(jmsE.getConcurrentConsumers());
|
||||||
|
executor.setMaxPoolSize(Math.max(jmsE.getConcurrentConsumers(),
|
||||||
|
jmsE.getMaxConcurrentConsumers()));
|
||||||
|
executor.setQueueCapacity(0);
|
||||||
|
executor.afterPropertiesSet();
|
||||||
|
|
||||||
|
jmsE.setTaskExecutor(executor);
|
||||||
|
jmsE.setMessageListenerContainerFactory(MonitoredDefaultMessageListenerContainerFactory
|
||||||
|
.getInstance());
|
||||||
|
|
||||||
|
return jmsE;
|
||||||
|
}
|
||||||
|
throw new Exception(
|
||||||
|
"JmsComponent did not create a JmsEnpoint. Check Camel Jms Override");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,142 @@
|
||||||
|
/**
|
||||||
|
* This software was developed and / or modified by Raytheon Company,
|
||||||
|
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||||
|
*
|
||||||
|
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||||
|
* This software product contains export-restricted data whose
|
||||||
|
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||||
|
* to non-U.S. persons whether in the United States or abroad requires
|
||||||
|
* an export license or other authorization.
|
||||||
|
*
|
||||||
|
* Contractor Name: Raytheon Company
|
||||||
|
* Contractor Address: 6825 Pine Street, Suite 340
|
||||||
|
* Mail Stop B8
|
||||||
|
* Omaha, NE 68106
|
||||||
|
* 402.291.0100
|
||||||
|
*
|
||||||
|
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||||
|
* further licensing information.
|
||||||
|
**/
|
||||||
|
package com.raytheon.uf.edex.esb.camel.jms;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
|
import org.apache.camel.component.jms.DefaultJmsMessageListenerContainer;
|
||||||
|
import org.apache.camel.component.jms.JmsEndpoint;
|
||||||
|
import org.apache.camel.component.jms.MessageListenerContainerFactory;
|
||||||
|
import org.springframework.jms.listener.AbstractMessageListenerContainer;
|
||||||
|
import org.springframework.jms.listener.DefaultMessageListenerContainer;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
|
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||||
|
import com.raytheon.uf.edex.core.EDEXUtil;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates DefaultMessageListenerContainer instances that are then monitored
|
||||||
|
* once a minute for paused tasks. If a paused task is found the container is
|
||||||
|
* restarted. This is necessary in broker restart scenarios.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
*
|
||||||
|
* SOFTWARE HISTORY
|
||||||
|
*
|
||||||
|
* Date Ticket# Engineer Description
|
||||||
|
* ------------ ---------- ----------- --------------------------
|
||||||
|
* Feb 8, 2014 2357 rjpeter Initial creation.
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @author rjpeter
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
public class MonitoredDefaultMessageListenerContainerFactory implements
|
||||||
|
MessageListenerContainerFactory {
|
||||||
|
private static final AtomicInteger threadCount = new AtomicInteger(1);
|
||||||
|
|
||||||
|
private final Collection<DefaultJmsMessageListenerContainer> containers = new ConcurrentLinkedQueue<DefaultJmsMessageListenerContainer>();
|
||||||
|
|
||||||
|
private final IUFStatusHandler statusHandler = UFStatus
|
||||||
|
.getHandler(MonitoredDefaultMessageListenerContainerFactory.class);
|
||||||
|
|
||||||
|
private static final MonitoredDefaultMessageListenerContainerFactory instance = new MonitoredDefaultMessageListenerContainerFactory();
|
||||||
|
|
||||||
|
public static MonitoredDefaultMessageListenerContainerFactory getInstance() {
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
private MonitoredDefaultMessageListenerContainerFactory() {
|
||||||
|
Thread containerChecker = new Thread("MessageListenerContainerMonitor-"
|
||||||
|
+ threadCount.getAndIncrement()) {
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see java.lang.Thread#run()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
while (!EDEXUtil.isRunning()) {
|
||||||
|
try {
|
||||||
|
Thread.sleep(TimeUtil.MILLIS_PER_MINUTE);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
// ignore
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
while (true) {
|
||||||
|
try {
|
||||||
|
for (DefaultMessageListenerContainer container : containers) {
|
||||||
|
if (container.getPausedTaskCount() > 0) {
|
||||||
|
StringBuilder msg = new StringBuilder(160);
|
||||||
|
msg.append("Container[")
|
||||||
|
.append(container.getDestinationName())
|
||||||
|
.append("] has paused tasks. Container is ");
|
||||||
|
if (!container.isRunning()) {
|
||||||
|
msg.append("not ");
|
||||||
|
}
|
||||||
|
msg.append("running. Container is ");
|
||||||
|
if (container.isActive()) {
|
||||||
|
msg.append("not ");
|
||||||
|
}
|
||||||
|
msg.append("active. Restarting container.");
|
||||||
|
statusHandler.warn(msg.toString());
|
||||||
|
container.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
Thread.sleep(TimeUtil.MILLIS_PER_MINUTE);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
// ignore
|
||||||
|
}
|
||||||
|
} catch (Throwable e) {
|
||||||
|
statusHandler
|
||||||
|
.error("Error occurred in checking message listener containers",
|
||||||
|
e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
containerChecker.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see org.apache.camel.component.jms.MessageListenerContainerFactory#
|
||||||
|
* createMessageListenerContainer
|
||||||
|
* (org.apache.camel.component.jms.JmsEndpoint)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AbstractMessageListenerContainer createMessageListenerContainer(
|
||||||
|
JmsEndpoint endpoint) {
|
||||||
|
// track the container for monitoring in the case of a provider
|
||||||
|
// reconnect
|
||||||
|
DefaultJmsMessageListenerContainer container = new DefaultJmsMessageListenerContainer(
|
||||||
|
endpoint);
|
||||||
|
containers.add(container);
|
||||||
|
return container;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
<!-- Begin Grid Process Route -->
|
<!-- Begin Grid Process Route -->
|
||||||
<route id="gridTopoNotificationRoute">
|
<route id="gridTopoNotificationRoute">
|
||||||
<from uri="jms-generic:topic:edex.alerts" />
|
<from uri="jms-generic:topic:edex.alerts?threadName=staticTopo-edex.alerts" />
|
||||||
<doTry>
|
<doTry>
|
||||||
<bean ref="serializationUtil" method="transformFromThrift" />
|
<bean ref="serializationUtil" method="transformFromThrift" />
|
||||||
<bean ref="staticDataGenerator" method="processNotification"/>
|
<bean ref="staticDataGenerator" method="processNotification"/>
|
||||||
|
|
|
@ -9,13 +9,13 @@
|
||||||
<bean id="dpaDistRegistry" factory-bean="distributionSrv"
|
<bean id="dpaDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg value="dpa" />
|
<constructor-arg value="dpa" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.dpa"/>
|
<constructor-arg value="jms-durable:queue:Ingest.dpa"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="dpaRadarServerDistRegistry" factory-bean="radarserverDistributionSrv"
|
<bean id="dpaRadarServerDistRegistry" factory-bean="radarserverDistributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg value="dpa" />
|
<constructor-arg value="dpa" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.dpa"/>
|
<constructor-arg value="jms-durable:queue:Ingest.dpa"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<camelContext id="dpa-camel"
|
<camelContext id="dpa-camel"
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<bean id="arealffgDistRegistry" class="com.raytheon.uf.edex.distribution.DistributionSrv"
|
<bean id="arealffgDistRegistry" class="com.raytheon.uf.edex.distribution.DistributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg value="arealffg" />
|
<constructor-arg value="arealffg" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.arealffg" />
|
<constructor-arg value="jms-durable:queue:Ingest.arealffg" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<camelContext id="arealffg-camel"
|
<camelContext id="arealffg-camel"
|
||||||
|
|
|
@ -9,13 +9,13 @@
|
||||||
<bean id="dhrDistRegistry" factory-bean="distributionSrv"
|
<bean id="dhrDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg value="dhr" />
|
<constructor-arg value="dhr" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.dhr"/>
|
<constructor-arg value="jms-durable:queue:Ingest.dhr"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="dhrRadarServerDistRegistry" factory-bean="radarserverDistributionSrv"
|
<bean id="dhrRadarServerDistRegistry" factory-bean="radarserverDistributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg value="dhr" />
|
<constructor-arg value="dhr" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.dhr"/>
|
<constructor-arg value="jms-durable:queue:Ingest.dhr"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<camelContext id="nonClusteredDHRroutes" xmlns="http://camel.apache.org/schema/spring"
|
<camelContext id="nonClusteredDHRroutes" xmlns="http://camel.apache.org/schema/spring"
|
||||||
|
|
|
@ -0,0 +1,40 @@
|
||||||
|
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
|
||||||
|
|
||||||
|
<!-- IHFS Database Configuration-->
|
||||||
|
<bean id="ihfsDbSessionConfig" class="com.raytheon.uf.edex.database.DatabaseSessionConfiguration">
|
||||||
|
<property name="includes">
|
||||||
|
<list>
|
||||||
|
<value>com.raytheon.edex.plugin.shef</value>
|
||||||
|
</list>
|
||||||
|
</property>
|
||||||
|
</bean>
|
||||||
|
<bean id="ihfsSessionFactory"
|
||||||
|
class="com.raytheon.uf.edex.database.DatabaseSessionFactoryBean">
|
||||||
|
|
||||||
|
<property name="configLocation">
|
||||||
|
<value>file:///${edex.home}/conf/db/hibernateConfig/ihfs/hibernate.cfg.xml</value>
|
||||||
|
</property>
|
||||||
|
<property name="databaseSessionConfiguration" ref="ihfsDbSessionConfig"/>
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
<bean id="ihfsTxManager"
|
||||||
|
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
|
||||||
|
<property name="sessionFactory" ref="ihfsSessionFactory" />
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
<!-- Dam Catalog Database Configuration-->
|
||||||
|
<bean id="damSessionFactory"
|
||||||
|
class="com.raytheon.uf.edex.database.DatabaseSessionFactoryBean">
|
||||||
|
<!-- No hibernate annotations should be loaded -->
|
||||||
|
<property name="configLocation">
|
||||||
|
<value>file:///${edex.home}/conf/db/hibernateConfig/damCatalog/hibernate.cfg.xml</value>
|
||||||
|
</property>
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
<bean id="damTxManager"
|
||||||
|
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
|
||||||
|
<property name="sessionFactory" ref="damSessionFactory" />
|
||||||
|
</bean>
|
||||||
|
</beans>
|
|
@ -1,42 +1,6 @@
|
||||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
|
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
|
||||||
|
|
||||||
<!-- IHFS Database Configuration-->
|
|
||||||
<bean id="ihfsDbSessionConfig" class="com.raytheon.uf.edex.database.DatabaseSessionConfiguration">
|
|
||||||
<property name="includes">
|
|
||||||
<list>
|
|
||||||
<value>com.raytheon.edex.plugin.shef</value>
|
|
||||||
</list>
|
|
||||||
</property>
|
|
||||||
</bean>
|
|
||||||
<bean id="ihfsSessionFactory"
|
|
||||||
class="com.raytheon.uf.edex.database.DatabaseSessionFactoryBean">
|
|
||||||
|
|
||||||
<property name="configLocation">
|
|
||||||
<value>file:///${edex.home}/conf/db/hibernateConfig/ihfs/hibernate.cfg.xml</value>
|
|
||||||
</property>
|
|
||||||
<property name="databaseSessionConfiguration" ref="ihfsDbSessionConfig"/>
|
|
||||||
</bean>
|
|
||||||
|
|
||||||
<bean id="ihfsTxManager"
|
|
||||||
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
|
|
||||||
<property name="sessionFactory" ref="ihfsSessionFactory" />
|
|
||||||
</bean>
|
|
||||||
|
|
||||||
<!-- Dam Catalog Database Configuration-->
|
|
||||||
<bean id="damSessionFactory"
|
|
||||||
class="com.raytheon.uf.edex.database.DatabaseSessionFactoryBean">
|
|
||||||
<!-- No hibernate annotations should be loaded -->
|
|
||||||
<property name="configLocation">
|
|
||||||
<value>file:///${edex.home}/conf/db/hibernateConfig/damCatalog/hibernate.cfg.xml</value>
|
|
||||||
</property>
|
|
||||||
</bean>
|
|
||||||
|
|
||||||
<bean id="damTxManager"
|
|
||||||
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
|
|
||||||
<property name="sessionFactory" ref="damSessionFactory" />
|
|
||||||
</bean>
|
|
||||||
|
|
||||||
<bean id="mpeFieldGenService" class="com.raytheon.uf.edex.ohd.pproc.MpeFieldGenSrv" />
|
<bean id="mpeFieldGenService" class="com.raytheon.uf.edex.ohd.pproc.MpeFieldGenSrv" />
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<bean id="q2DistRegistry" factory-bean="distributionSrv"
|
<bean id="q2DistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg value="q2" />
|
<constructor-arg value="q2" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.q2"/>
|
<constructor-arg value="jms-durable:queue:Ingest.q2"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<camelContext id="q2Proc-context"
|
<camelContext id="q2Proc-context"
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
errorHandlerRef="errorHandler"
|
errorHandlerRef="errorHandler"
|
||||||
autoStartup="false">
|
autoStartup="false">
|
||||||
<route id="satPreIngestRoute">
|
<route id="satPreIngestRoute">
|
||||||
<from uri="jms-generic:topic:edex.alerts"/>
|
<from uri="jms-generic:topic:edex.alerts?threadName=satPreFilter-edex.alerts"/>
|
||||||
<doTry>
|
<doTry>
|
||||||
<pipeline>
|
<pipeline>
|
||||||
<bean ref="serializationUtil" method="transformFromThrift" />
|
<bean ref="serializationUtil" method="transformFromThrift" />
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<bean id="acarsDistRegistry" factory-bean="distributionSrv"
|
<bean id="acarsDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg ref="acarsPluginName" />
|
<constructor-arg ref="acarsPluginName" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.acars"/>
|
<constructor-arg value="jms-durable:queue:Ingest.acars"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="acarsCamelRegistered" factory-bean="contextManager"
|
<bean id="acarsCamelRegistered" factory-bean="contextManager"
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
<bean id="bufrascatDistRegistry" factory-bean="distributionSrv"
|
<bean id="bufrascatDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg value="bufrascat" />
|
<constructor-arg value="bufrascat" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.bufrascat" />
|
<constructor-arg value="jms-durable:queue:Ingest.bufrascat" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="bufrascatCamelRegistered" factory-bean="contextManager"
|
<bean id="bufrascatCamelRegistered" factory-bean="contextManager"
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<bean id="bufrhdwDistRegistry" factory-bean="distributionSrv"
|
<bean id="bufrhdwDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg ref="bufrhdwPluginName" />
|
<constructor-arg ref="bufrhdwPluginName" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.bufrhdw"/>
|
<constructor-arg value="jms-durable:queue:Ingest.bufrhdw"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="bufrhdwCamelRegistered" factory-bean="contextManager"
|
<bean id="bufrhdwCamelRegistered" factory-bean="contextManager"
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<bean id="bufrmthdwDistRegistry" factory-bean="distributionSrv"
|
<bean id="bufrmthdwDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg ref="bufrmthdwPluginName" />
|
<constructor-arg ref="bufrmthdwPluginName" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.bufrmthdw"/>
|
<constructor-arg value="jms-durable:queue:Ingest.bufrmthdw"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="bufrmthdwCamelRegistered" factory-bean="contextManager"
|
<bean id="bufrmthdwCamelRegistered" factory-bean="contextManager"
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<bean id="bufrncwfDistRegistry" factory-bean="distributionSrv"
|
<bean id="bufrncwfDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg ref="bufrncwfPluginName" />
|
<constructor-arg ref="bufrncwfPluginName" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.bufrncwf"/>
|
<constructor-arg value="jms-durable:queue:Ingest.bufrncwf"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="bufrncwfCamelRegistered" factory-bean="contextManager"
|
<bean id="bufrncwfCamelRegistered" factory-bean="contextManager"
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
<bean id="bufrquikscatDistRegistry" factory-bean="distributionSrv"
|
<bean id="bufrquikscatDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg ref="bufrquikscatPluginName" />
|
<constructor-arg ref="bufrquikscatPluginName" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.bufrquikscat"/>
|
<constructor-arg value="jms-durable:queue:Ingest.bufrquikscat"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="bufrquikscatCamelRegistered" factory-bean="contextManager"
|
<bean id="bufrquikscatCamelRegistered" factory-bean="contextManager"
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<bean id="bufrsigwxDistRegistry" factory-bean="distributionSrv"
|
<bean id="bufrsigwxDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg ref="bufrsigwxPluginName" />
|
<constructor-arg ref="bufrsigwxPluginName" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.bufrsigwx" />
|
<constructor-arg value="jms-durable:queue:Ingest.bufrsigwx" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="bufrsigwxCamelRegistered" factory-bean="contextManager"
|
<bean id="bufrsigwxCamelRegistered" factory-bean="contextManager"
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
<bean id="bufrssmiDistRegistry" factory-bean="distributionSrv"
|
<bean id="bufrssmiDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg ref="bufrssmiPluginName" />
|
<constructor-arg ref="bufrssmiPluginName" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.bufrssmi"/>
|
<constructor-arg value="jms-durable:queue:Ingest.bufrssmi"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="bufrssmiCamelRegistered" factory-bean="contextManager"
|
<bean id="bufrssmiCamelRegistered" factory-bean="contextManager"
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<bean id="cwaDistRegistry" factory-bean="distributionSrv"
|
<bean id="cwaDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg ref="cwaPluginName" />
|
<constructor-arg ref="cwaPluginName" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.cwa" />
|
<constructor-arg value="jms-durable:queue:Ingest.cwa" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="cwaCamelRegistered" factory-bean="contextManager"
|
<bean id="cwaCamelRegistered" factory-bean="contextManager"
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<bean id="ldadmesonetDistRegistry" factory-bean="distributionSrv"
|
<bean id="ldadmesonetDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg value="ldadmesonet" />
|
<constructor-arg value="ldadmesonet" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.ldadmesonet"/>
|
<constructor-arg value="jms-durable:queue:Ingest.ldadmesonet"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="ldadmesonetPointData" class="com.raytheon.uf.common.dataplugin.ldadmesonet.LdadmesonetPointDataTransform"/>
|
<bean id="ldadmesonetPointData" class="com.raytheon.uf.common.dataplugin.ldadmesonet.LdadmesonetPointDataTransform"/>
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
<bean id="loctablesDistRegistry" factory-bean="distributionSrv"
|
<bean id="loctablesDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg ref="loctablesPluginName" />
|
<constructor-arg ref="loctablesPluginName" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.loctables" />
|
<constructor-arg value="jms-durable:queue:Ingest.loctables" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<camelContext id="loctables-camel"
|
<camelContext id="loctables-camel"
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<bean id="lsrDistRegistry" factory-bean="distributionSrv"
|
<bean id="lsrDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg ref="lclstrmrptPluginName" />
|
<constructor-arg ref="lclstrmrptPluginName" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.lsr" />
|
<constructor-arg value="jms-durable:queue:Ingest.lsr" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="lclstrmrptCamelRegistered" factory-bean="contextManager"
|
<bean id="lclstrmrptCamelRegistered" factory-bean="contextManager"
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<bean id="crimssDistRegistry" factory-bean="distributionSrv"
|
<bean id="crimssDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg ref="crimssPluginName" />
|
<constructor-arg ref="crimssPluginName" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.crimss" />
|
<constructor-arg value="jms-durable:queue:Ingest.crimss" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="crimssCamelRegistered" factory-bean="contextManager"
|
<bean id="crimssCamelRegistered" factory-bean="contextManager"
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<bean id="nucapsDistRegistry" factory-bean="distributionSrv"
|
<bean id="nucapsDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg ref="nucapsPluginName" />
|
<constructor-arg ref="nucapsPluginName" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.nucaps" />
|
<constructor-arg value="jms-durable:queue:Ingest.nucaps" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="nucapsCamelRegistered" factory-bean="contextManager"
|
<bean id="nucapsCamelRegistered" factory-bean="contextManager"
|
||||||
|
|
|
@ -2,22 +2,12 @@
|
||||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
||||||
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
||||||
|
|
||||||
<bean id="viirsThreadPool"
|
|
||||||
class="com.raytheon.uf.edex.esb.camel.spring.JmsThreadPoolTaskExecutor">
|
|
||||||
<property name="corePoolSize" value="1" />
|
|
||||||
<property name="maxPoolSize" value="1" />
|
|
||||||
</bean>
|
|
||||||
|
|
||||||
<bean id="jms-viirs" class="org.apache.camel.component.jms.JmsComponent">
|
|
||||||
<constructor-arg ref="jmsViirsConfig" />
|
|
||||||
<property name="taskExecutor" ref="viirsThreadPool" />
|
|
||||||
</bean>
|
|
||||||
<bean id="jmsViirsConfig" class="org.apache.camel.component.jms.JmsConfiguration"
|
<bean id="jmsViirsConfig" class="org.apache.camel.component.jms.JmsConfiguration"
|
||||||
factory-bean="jmsDurableConfig" factory-method="copy"/>
|
factory-bean="jmsDurableConfig" factory-method="copy"/>
|
||||||
<bean id="viirsDistRegistry" factory-bean="distributionSrv"
|
<bean id="viirsDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg ref="viirsPluginName" />
|
<constructor-arg ref="viirsPluginName" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.VIIRS" />
|
<constructor-arg value="jms-durable:queue:Ingest.VIIRS" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="viirsCamelRegistered" factory-bean="contextManager"
|
<bean id="viirsCamelRegistered" factory-bean="contextManager"
|
||||||
|
@ -40,7 +30,7 @@
|
||||||
|
|
||||||
<!-- Begin VIIRS routes -->
|
<!-- Begin VIIRS routes -->
|
||||||
<route id="viirsIngestRoute">
|
<route id="viirsIngestRoute">
|
||||||
<from uri="jms-viirs:queue:Ingest.VIIRS"/>
|
<from uri="jms-durable:queue:Ingest.VIIRS"/>
|
||||||
<doTry>
|
<doTry>
|
||||||
<pipeline>
|
<pipeline>
|
||||||
<bean ref="stringToFile" />
|
<bean ref="stringToFile" />
|
||||||
|
|
|
@ -3,26 +3,14 @@
|
||||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
||||||
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
||||||
|
|
||||||
<bean id="jms-satellite-mcidas" class="org.apache.camel.component.jms.JmsComponent">
|
|
||||||
<constructor-arg ref="jmsSatelliteMcidasConfig" />
|
|
||||||
<property name="taskExecutor" ref="satelliteMcidasThreadPool" />
|
|
||||||
</bean>
|
|
||||||
<bean id="satelliteMcidasThreadPool"
|
|
||||||
class="com.raytheon.uf.edex.esb.camel.spring.JmsThreadPoolTaskExecutor">
|
|
||||||
<property name="corePoolSize" value="1" />
|
|
||||||
<property name="maxPoolSize" value="1" />
|
|
||||||
</bean>
|
|
||||||
<bean id="jmsSatelliteMcidasConfig" class="org.apache.camel.component.jms.JmsConfiguration"
|
|
||||||
factory-bean="jmsDurableConfig" factory-method="copy"/>
|
|
||||||
<bean id="satelliteMcidasDecoder" class="com.raytheon.uf.edex.plugin.satellite.mcidas.McidasSatelliteDecoder">
|
|
||||||
</bean>
|
|
||||||
|
|
||||||
<bean id="satMcidasDistRegistry" factory-bean="distributionSrv"
|
<bean id="satMcidasDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg value="satellite.mcidas" />
|
<constructor-arg value="satellite.mcidas" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.Satellite.Mcidas" />
|
<constructor-arg value="jms-durable:queue:Ingest.Satellite.Mcidas" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
|
<bean id="satelliteMcidasDecoder" class="com.raytheon.uf.edex.plugin.satellite.mcidas.McidasSatelliteDecoder"/>
|
||||||
|
|
||||||
<bean id="satMcidasCamelRegistered" factory-bean="contextManager"
|
<bean id="satMcidasCamelRegistered" factory-bean="contextManager"
|
||||||
factory-method="register" depends-on="persistCamelRegistered">
|
factory-method="register" depends-on="persistCamelRegistered">
|
||||||
<constructor-arg ref="sat-mcidas-camel"/>
|
<constructor-arg ref="sat-mcidas-camel"/>
|
||||||
|
@ -35,7 +23,7 @@
|
||||||
|
|
||||||
<!-- Begin McIDAS Sat routes -->
|
<!-- Begin McIDAS Sat routes -->
|
||||||
<route id="satMcidasIngestRoute">
|
<route id="satMcidasIngestRoute">
|
||||||
<from uri="jms-satellite-mcidas:queue:Ingest.Satellite.Mcidas" />
|
<from uri="jms-durable:queue:Ingest.Satellite.Mcidas" />
|
||||||
<setHeader headerName="pluginName">
|
<setHeader headerName="pluginName">
|
||||||
<constant>satellite-mcidas</constant>
|
<constant>satellite-mcidas</constant>
|
||||||
</setHeader>
|
</setHeader>
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<bean id="svrwxDistRegistry" factory-bean="distributionSrv"
|
<bean id="svrwxDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg ref="svrwxPluginName" />
|
<constructor-arg ref="svrwxPluginName" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.svrwx" />
|
<constructor-arg value="jms-durable:queue:Ingest.svrwx" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="svrwxCamelRegistered" factory-bean="contextManager"
|
<bean id="svrwxCamelRegistered" factory-bean="contextManager"
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<bean id="tcgDistRegistry" factory-bean="distributionSrv"
|
<bean id="tcgDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg ref="tcgPluginName" />
|
<constructor-arg ref="tcgPluginName" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.tcg"/>
|
<constructor-arg value="jms-durable:queue:Ingest.tcg"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="tcgCamelRegistered" factory-bean="contextManager"
|
<bean id="tcgCamelRegistered" factory-bean="contextManager"
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<bean id="tcsDistRegistry" factory-bean="distributionSrv"
|
<bean id="tcsDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg ref="tcsPluginName" />
|
<constructor-arg ref="tcsPluginName" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.tcs" />
|
<constructor-arg value="jms-durable:queue:Ingest.tcs" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="tcsCamelRegistered" factory-bean="contextManager"
|
<bean id="tcsCamelRegistered" factory-bean="contextManager"
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<bean id="vaaDistRegistry" factory-bean="distributionSrv"
|
<bean id="vaaDistRegistry" factory-bean="distributionSrv"
|
||||||
factory-method="register">
|
factory-method="register">
|
||||||
<constructor-arg ref="vaaPluginName" />
|
<constructor-arg ref="vaaPluginName" />
|
||||||
<constructor-arg value="jms-dist:queue:Ingest.vaa"/>
|
<constructor-arg value="jms-durable:queue:Ingest.vaa"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="vaaCamelRegistered" factory-bean="contextManager"
|
<bean id="vaaCamelRegistered" factory-bean="contextManager"
|
||||||
|
|
|
@ -1,32 +1,3 @@
|
||||||
/**
|
|
||||||
* AirmetRecord
|
|
||||||
*
|
|
||||||
* This java class performs the mapping to the database table for AIRMET
|
|
||||||
*
|
|
||||||
* HISTORY
|
|
||||||
*
|
|
||||||
* Date Author Description
|
|
||||||
* ------------ ---------- ----------- --------------------------
|
|
||||||
* 05/2009 L. Lin Initial creation
|
|
||||||
*
|
|
||||||
* This code has been developed by the SIB for use in the AWIPS2 system.
|
|
||||||
*
|
|
||||||
* Date Ticket# Engineer Description
|
|
||||||
* ------------ ---------- ----------- --------------------------
|
|
||||||
* 05/2009 39 L. Lin Initial coding
|
|
||||||
* 07/2009 39 L. Lin Migration to TO11
|
|
||||||
* 09/2011 Chin Chen changed to improve purge performance and
|
|
||||||
* removed xml serialization as well
|
|
||||||
* Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime
|
|
||||||
* Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation.
|
|
||||||
* May 07, 2013 1869 bsteffen Remove dataURI column from
|
|
||||||
* PluginDataObject.
|
|
||||||
*
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
* This code has been developed by the SIB for use in the AWIPS2 system.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package gov.noaa.nws.ncep.common.dataplugin.airmet;
|
package gov.noaa.nws.ncep.common.dataplugin.airmet;
|
||||||
|
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
|
@ -53,6 +24,37 @@ import com.raytheon.uf.common.dataplugin.annotations.DataURI;
|
||||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AirmetRecord
|
||||||
|
*
|
||||||
|
* This java class performs the mapping to the database table for AIRMET
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* HISTORY
|
||||||
|
*
|
||||||
|
* Date Author Description
|
||||||
|
* ------------ ---------- ----------- --------------------------
|
||||||
|
* 05/2009 L. Lin Initial creation
|
||||||
|
*
|
||||||
|
* This code has been developed by the SIB for use in the AWIPS2 system.
|
||||||
|
*
|
||||||
|
* Date Ticket# Engineer Description
|
||||||
|
* ------------ ---------- ----------- --------------------------
|
||||||
|
* 05/2009 39 L. Lin Initial coding
|
||||||
|
* 07/2009 39 L. Lin Migration to TO11
|
||||||
|
* 09/2011 Chin Chen changed to improve purge performance and
|
||||||
|
* removed xml serialization as well
|
||||||
|
* Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime
|
||||||
|
* Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation.
|
||||||
|
* May 07, 2013 1869 bsteffen Remove dataURI column from
|
||||||
|
* PluginDataObject.
|
||||||
|
* Feb 11, 2014 2784 rferrel Remove override of setIdentifier.
|
||||||
|
*
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* This code has been developed by the SIB for use in the AWIPS2 system.
|
||||||
|
*/
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "airmetseq")
|
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "airmetseq")
|
||||||
@Table(name = "airmet", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) })
|
@Table(name = "airmet", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) })
|
||||||
|
@ -319,24 +321,6 @@ public class AirmetRecord extends PluginDataObject {
|
||||||
*/
|
*/
|
||||||
public void addAirmetReport(AirmetReport curReport) {
|
public void addAirmetReport(AirmetReport curReport) {
|
||||||
airmetReport.add(curReport);
|
airmetReport.add(curReport);
|
||||||
// curReport.setParentID(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Override existing set method to modify any classes that use the dataURI
|
|
||||||
* as a foreign key
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void setIdentifier(Object dataURI) {
|
|
||||||
|
|
||||||
this.identifier = dataURI;
|
|
||||||
/*
|
|
||||||
* if(this.getAirmetReport() != null && this.getAirmetReport().size() >
|
|
||||||
* 0) { for (Iterator<AirmetReport> iter =
|
|
||||||
* this.getAirmetReport().iterator(); iter.hasNext();) { AirmetReport cs
|
|
||||||
* = iter.next(); cs.setParentID(this); } }
|
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue