1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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
71
72
73
74
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
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="locations">
            <list>
                <value>classpath:config/myapp.properties</value>
            </list>
        </property>
    </bean>

    <bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
        <property name="basename" value="classpath:config/messages" />
    </bean>
    <bean id="dateFormat" class="java.text.SimpleDateFormat">
        <constructor-arg value="MMM-dd-yyyy hh:mm:ss a" />
    </bean>

    <bean id="sunMessageConverter" class="net.mybank.myapp.util.SunMessageConverter" />

    <!-- datasources -->
    <bean id="xyzDataSource" class="net.mybank.myapp.common.dao.JndiDataSource">
        <property name="jndiName" value="jdbc/MYBANK" />
    </bean>

   <bean id="abcDataSource" class="net.mybank.myapp.common.dao.JndiDataSource">
        <property name="jndiName" value="jdbc/abc" />
    </bean>

    <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
        <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" />
        <property name="url" value="jdbc:oracle:thin:@12.345.678.90:1521:test" />
        <property name="username" value="username" />
        <property name="password" value="password" />
    </bean>

    <!-- jms connection factory -->
    <bean id="queueConnectionFactory" class="net.mybank.myapp.jms.QueueConnectionFactory">
        <property name="dataSource" ref="dataSource" />
    </bean>

     <bean id="pooledConnectionFactory" class="net.mybank.myapp.jms.PooledQueueConnectionFactory"
        init-method="init" destroy-method="destroy">
        <property name="url" value="jdbc:oracle:thin:@12.345.678.90:1521:test" />
        <property name="username" value="username" />
        <property name="password" value="password" />
        <property name="initialLimit" value="10" />
        <property name="minLimit" value="10" />
        <property name="maxLimit" value="50" />
        <property name="connectionWaitTimeout" value="10" />
        <property name="inactivityTimeout" value="1800" />
    </bean >

  <!-- transaction queue listener -->

    <bean class="org.springframework.jms.listener.DefaultMessageListenerContainer102">
        <property name="cacheLevel" value="0" />
        <property name="concurrentConsumers" value="2" />
        <property name="maxConcurrentConsumers" value="5" />
        <property name="receiveTimeout" value="10000" />
        <property name="connectionFactory" ref="pooledConnectionFactory" />
        <property name="destinationName" value="DEVICE_RECEIVE" />
        <property name="messageListener" ref="ucpQueueListener" />
        <property name="messageSelector" value="device = 'device1'" />
        <property name="transactionManager" ref="jmsTransactionManager" />
    </bean>




    <!-- jms transaction manager -->
    <bean id="jmsTransactionManager" class="org.springframework.jms.connection.JmsTransactionManager102">
        <property name="connectionFactory" ref="pooledConnectionFactory" />
    </bean>

    <!-- queue senders -->
    <bean id="abcSendQueueTemplate" class="org.springframework.jms.core.JmsTemplate102">
        <property name="connectionFactory" ref="pooledConnectionFactory" />
        <property name="defaultDestinationName" value="${myapp.queue.abcreply.name}" />
        <property name="explicitQosEnabled" value="true" />
        <property name="timeToLive" value="${myapp.queue.abcreply.timetolive}" />
    </bean>



    <!-- jms helper -->


    <!-- jms listeners -->

    <bean id="ucpQueueListener" class="net.mybank.myapp.jms.abcQueueListenerNotifier">
        <property name="messageListener">
            <bean class="net.mybank.myapp.jms.abcQueueListener">
                <property name="textManager" ref="ucpTextManager" />
            </bean>
        </property>
        <property name="mailSender" ref="mailSender" />
    </bean>



    <bean id="logDao" class="net.mybank.myapp.abc.dao.DefaultLogDao">
        <property name="dataSource" ref="abcDataSource" />
    </bean>

    <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource" ref="abcDataSource" />
    </bean>

    <bean id="acknowledgementListener" class="net.mybank.myapp.client.jms.AcknowledgementListener" />


    <bean id="clientNotifier" class="net.mybank.myapp.client.model.ClientNotifier">
        <property name="jmsHelper" ref="clientJmsHelper" />
    </bean>



    <!-- DAOs -->
    <bean id="userDao" class="net.mybank.myapp.common.dao.DefaultUserDao">
        <property name="dataSource" ref="xyzDataSource" />
    </bean>

</beans>