awips2/edexOsgi/com.raytheon.uf.edex.purgesrv/res/spring/purge-spring.xml
Steve Harris 70e4ff30a6 13.5.1-4 baseline
Former-commit-id: d18b403b332dff67d1c85d4317bbceda337d1b41
2013-06-28 09:46:25 -04:00

75 lines
2.5 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">
<bean id="purge" class="com.raytheon.uf.edex.purgesrv.PurgeSrv">
<constructor-arg ref = "purgeManager"/>
</bean>
<!-- Register database plugin -->
<bean id="purgeDatabaseProperties" class="com.raytheon.uf.edex.database.DatabasePluginProperties">
<property name="pluginFQN" value="com.raytheon.uf.edex.purgesrv" />
<property name="database" value="metadata" />
</bean>
<bean factory-bean="dbPluginRegistry" factory-method="register">
<constructor-arg value="com.raytheon.uf.edex.purgesrv"/>
<constructor-arg ref="purgeDatabaseProperties"/>
</bean>
<bean id="purgeOutgoing" class="com.raytheon.uf.edex.purgesrv.PurgeOutgoing" >
<property name="outgoingDirectory" value="${edex.home}/data/outgoing"/>
</bean>
<camelContext id="clusteredpurgeContext" xmlns="http://camel.apache.org/schema/spring"
errorHandlerRef="errorHandler" autoStartup="false">
<endpoint id="purgeOutgoingCron" uri="quartz://purge/purgeOutgoingScheduled/?cron=${purge.outgoing.cron}"/>
<route id="purgeByRequest">
<from uri="jms-generic:queue:purgeRequest" />
<doTry>
<bean ref="purge" method="purge" />
<doCatch>
<exception>java.lang.Throwable</exception>
<to
uri="log:purge?level=ERROR" />
</doCatch>
</doTry>
</route>
<!-- schedule the timer to purge outgoing directory -->
<route id="purgeOutgoingScheduled">
<from ref="purgeOutgoingCron" />
<bean ref="purgeOutgoing" method="purge" />
</route>
</camelContext>
<camelContext id="purgeContext" xmlns="http://camel.apache.org/schema/spring"
errorHandlerRef="errorHandler">
<endpoint id="purgeCron" uri="quartz://purge/purgeScheduled/?cron=${purge.cron}"/>
<!-- Purge on Scheduled timer -->
<route id="purgeScheduled">
<from ref="purgeCron" />
<doTry>
<bean ref="purgeManager" method="executePurge" />
<doCatch>
<exception>java.lang.Throwable</exception>
<to
uri="log:purge?level=ERROR" />
</doCatch>
</doTry>
</route>
</camelContext>
<bean factory-bean="clusteredCamelContextMgr"
factory-method="register">
<constructor-arg ref="clusteredpurgeContext" />
</bean>
</beans>