awips2/ncep/gov.noaa.nws.ncep.edex.common/res/spring/ncinventory-request.xml
Richard Peter de624d87d3 Issue #2726: Edex graceful shutdown.
Refactored to use inheritance and separate logic where possible.
             Addressed comments.

Change-Id: I9e62414cd83121575bdf99a3b47466a7585bedb6

Former-commit-id: e4be1f24e7 [formerly dbba727f3d] [formerly e4be1f24e7 [formerly dbba727f3d] [formerly 17196b5dcd [formerly 6e015b3f61c20635077d6e8271e9b763e5a32fe1]]]
Former-commit-id: 17196b5dcd
Former-commit-id: ff87317bd4 [formerly 8b279966d1]
Former-commit-id: b3fd8e5480
2014-04-14 13:10:11 -05:00

76 lines
No EOL
3.1 KiB
XML

<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
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
<!-- for the ThriftClient requests -->
<bean id="ManageNcInventoryMsgHandler" class="gov.noaa.nws.ncep.edex.common.ncinventory.ManageNcInventoryMsgHandler" />
<bean factory-bean="handlerRegistry" factory-method="register">
<constructor-arg value="gov.noaa.nws.ncep.edex.common.ncinventory.ManageNcInventoryMsg"/>
<constructor-arg ref="ManageNcInventoryMsgHandler"/>
</bean>
<bean id="NcInventoryRequestMsgHandler" class="gov.noaa.nws.ncep.edex.common.ncinventory.NcInventoryRequestMsgHandler" />
<bean factory-bean="handlerRegistry" factory-method="register">
<constructor-arg value="gov.noaa.nws.ncep.edex.common.ncinventory.NcInventoryRequestMsg"/>
<constructor-arg ref="NcInventoryRequestMsgHandler"/>
</bean>
<bean id="NcInventoryMngr"
class="gov.noaa.nws.ncep.edex.common.ncinventory.NcInventoryMngr" />
<bean id="NcInventoryUpdater"
class="gov.noaa.nws.ncep.edex.common.ncinventory.NcInventoryUpdater" />
<bean id="ncInventoryInitializer" class="gov.noaa.nws.ncep.edex.common.ncinventory.NcInventoryInitializer" />
<camelContext id="ncinventory-camel"
xmlns="http://camel.apache.org/schema/spring"
errorHandlerRef="errorHandler">
<route id="ncInventoryInitializationRoute">
<from uri="quartz://ncInventoryInitQuartz?trigger.repeatInterval=1"/>
<bean ref="ncInventoryInitializer" method="initialize" />
</route>
<!-- Need to reroute to a queue to allow for multiple jms consumers -->
<route id="ncInventoryRoute">
<from uri="jms-generic:topic:edex.alerts?threadName=ncInventory-edex.alerts"/>
<doTry>
<pipeline>
<bean ref="serializationUtil" method="transformFromThrift" />
<bean ref="NcInventoryUpdater" method="updateInventoryFromURIs"/>
</pipeline>
<doCatch>
<exception>java.lang.Throwable</exception>
<to uri="log:ncInventory?level=ERROR"/>
</doCatch>
</doTry>
</route>
<route id="manageInventoryRoute">
<from uri="jms-generic:topic:manageInventory" />
<doTry>
<bean ref="NcInventoryMngr" method="manageInventory" />
<doCatch>
<exception>java.lang.Throwable</exception>
<to uri="log:ncInventory?level=ERROR"/>
</doCatch>
</doTry>
</route>
<route id="pluginPurgedRoute">
<from uri="jms-generic:topic:pluginPurged" />
<doTry>
<bean ref="NcInventoryUpdater" method="purgePlugin" />
<doCatch>
<exception>java.lang.Throwable</exception>
<to uri="log:ncInventory?level=ERROR"/>
</doCatch>
</doTry>
</route>
</camelContext>
</beans>