event-config.xml 5.29 KB
Newer Older
Peter Harrison's avatar
Peter Harrison committed
1 2 3 4 5 6
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
	xmlns:jee="http://www.springframework.org/schema/jee" xmlns:jms="http://www.springframework.org/schema/jms"
	xmlns:util="http://www.springframework.org/schema/util" xmlns:context="http://www.springframework.org/schema/context"
	xsi:schemaLocation="http://www.springframework.org/schema/beans 
7
	http://www.springframework.org/schema/beans/spring-beans-3.1.xsd 
Peter Harrison's avatar
Peter Harrison committed
8 9 10
	http://www.springframework.org/schema/tx 
	http://www.springframework.org/schema/tx/spring-tx.xsd 
	http://www.springframework.org/schema/jee
11
	http://www.springframework.org/schema/jee/spring-jee-3.1.xsd
Peter Harrison's avatar
Peter Harrison committed
12
	http://www.springframework.org/schema/jms 
13
    http://www.springframework.org/schema/jms/spring-jms-3.1.xsd
Peter Harrison's avatar
Peter Harrison committed
14
    http://www.springframework.org/schema/util 
15
	http://www.springframework.org/schema/util/spring-util-3.1.xsd
Peter Harrison's avatar
Peter Harrison committed
16
	http://www.springframework.org/schema/context
17
    http://www.springframework.org/schema/context/spring-context-3.1.xsd">
Peter Harrison's avatar
Peter Harrison committed
18 19 20


	<!-- EVENT LISTENING FROM QUEUE -->
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
 
	<bean id="jmsConnectionFactory" class="org.hornetq.jms.client.HornetQJMSConnectionFactory">
		<constructor-arg name="ha" value="false" />
		<constructor-arg>
			<bean class="org.hornetq.api.core.TransportConfiguration">
				<constructor-arg
					value="org.hornetq.core.remoting.impl.netty.NettyConnectorFactory" />
				<constructor-arg>
					<map key-type="java.lang.String" value-type="java.lang.Object">
						<entry key="host" value="${hornetq.server}"></entry>
						<entry key="port" value="${hornetq.port}"></entry>
					</map>
				</constructor-arg>
			</bean>
		</constructor-arg>
Peter Harrison's avatar
Peter Harrison committed
36
	</bean>
37
 
Peter Harrison's avatar
Peter Harrison committed
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
	<jms:listener-container container-type="default"
		connection-factory="jmsConnectionFactory" acknowledge="auto">

		<jms:listener destination="gravityEvents" 
			ref="eventListener"
			method="onMessage" />
	</jms:listener-container>

	<jms:listener-container container-type="default"
		connection-factory="jmsConnectionFactory" 
		acknowledge="auto" 
		destination-type="topic">
			
		<jms:listener destination="gravityCacheInvalidation" 
			ref="cacheManager"
			method="onMessage" />

		<jms:listener destination="gravityCardLocking" 
			ref="cardsLockCache"
			method="onMessage" />

		<jms:listener destination="gravityPhaseChange" 
			ref="boardsCache"
			method="onMessage" />

		<jms:listener destination="gravityIdGenerator" 
			ref="idSyncReceiver"
			method="onMessage" />

	</jms:listener-container>

	<bean id="eventListener" class="nz.net.orcon.kanban.automation.JmsEventListener" />

71
	<!-- 
Peter Harrison's avatar
Peter Harrison committed
72 73
	<jee:jndi-lookup id="gravityEventsQueue" jndi-name="/queue/gravityEvents"
		resource-ref="true" environment-ref="hornetqConfiguration" />
74
 	-->
Peter Harrison's avatar
Peter Harrison committed
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
	<bean id="eventsJmsTemplate" class="org.springframework.jms.core.JmsTemplate">
		<property name="connectionFactory" ref="jmsConnectionFactory" />
		<property name="explicitQosEnabled" value="true" />
		<property name="timeToLive" value="3600000" />
		<property name="defaultDestinationName" value="gravityEvents" />
	</bean>

	<bean id="invalidationJmsTemplate" class="org.springframework.jms.core.JmsTemplate">
		<property name="connectionFactory" ref="jmsConnectionFactory" />
		<property name="explicitQosEnabled" value="true" />
		<property name="timeToLive" value="3600000" />
		<property name="defaultDestinationName" value="gravityCacheInvalidation" />
		<property name="pubSubDomain" value="true"/>
	</bean>

	<bean id="cardLockingJmsTemplate" class="org.springframework.jms.core.JmsTemplate">
		<property name="connectionFactory" ref="jmsConnectionFactory" />
		<property name="explicitQosEnabled" value="true" />
		<property name="timeToLive" value="3600000" />
		<property name="defaultDestinationName" value="gravityCardLocking" />
		<property name="pubSubDomain" value="true"/>
	</bean>

	<bean id="phaseChangeJmsTemplate" class="org.springframework.jms.core.JmsTemplate">
		<property name="connectionFactory" ref="jmsConnectionFactory" />
		<property name="explicitQosEnabled" value="true" />
		<property name="timeToLive" value="3600000" />
		<property name="defaultDestinationName" value="gravityPhaseChange" />
		<property name="pubSubDomain" value="true"/>
	</bean>

	<bean id="idJmsTemplate" class="org.springframework.jms.core.JmsTemplate">
		<property name="connectionFactory" ref="jmsConnectionFactory" />
		<property name="explicitQosEnabled" value="true" />
		<property name="timeToLive" value="3600000" />
		<property name="defaultDestinationName" value="gravityIdGenerator" />
		<property name="pubSubDomain" value="true"/>
	</bean>
	
	<bean id="cardListener" class="nz.net.orcon.kanban.automation.CardListener">
		<property name="automationDelay" value="${automation.delay}"/>
	</bean>
	
	<bean id="cacheManager" class="nz.net.orcon.kanban.automation.CacheManager">
		<property name="cacheList">
			<map>
				<entry key="BOARD" value-ref="boardsCache"/>
				<entry key="FORM" value-ref="formCache"/>
				<entry key="LIST" value-ref="listCache"/>
				<entry key="RESOURCE" value-ref="resourceCache"/>
				<entry key="TEAM" value-ref="teamCache"/>
				<entry key="TEMPLATE" value-ref="templateCache"/>
Peter Harrison's avatar
Peter Harrison committed
127
				<entry key="RULE" value-ref="ruleCache"/>
Peter Harrison's avatar
Peter Harrison committed
128 129 130 131 132 133 134
			</map>
		</property>
	</bean>
	
	<bean id="idSyncReceiver" class="nz.net.orcon.kanban.automation.IdGeneratorReceiver"/>
	
</beans>