|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2020 the original author or authors. |
| 2 | + * Copyright 2002-2021 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
39 | 39 | *
|
40 | 40 | * <pre class="code">
|
41 | 41 | * <bean class="org.springframework.jca.endpoint.GenericMessageEndpointManager">
|
42 |
| - * <property name="resourceAdapter" ref="resourceAdapter"/> |
43 |
| - * <property name="messageEndpointFactory"> |
44 |
| - * <bean class="org.springframework.jca.endpoint.GenericMessageEndpointFactory"> |
45 |
| - * <property name="messageListener" ref="messageListener"/> |
46 |
| - * </bean> |
47 |
| - * </property> |
48 |
| - * <property name="activationSpec"> |
49 |
| - * <bean class="org.apache.activemq.ra.ActiveMQActivationSpec"> |
50 |
| - * <property name="destination" value="myQueue"/> |
51 |
| - * <property name="destinationType" value="jakarta.jms.Queue"/> |
52 |
| - * </bean> |
53 |
| - * </property> |
54 |
| - * </bean></pre> |
| 42 | + * <property name="resourceAdapter" ref="resourceAdapter"/> |
| 43 | + * <property name="messageEndpointFactory"> |
| 44 | + * <bean class="org.springframework.jca.endpoint.GenericMessageEndpointFactory"> |
| 45 | + * <property name="messageListener" ref="messageListener"/> |
| 46 | + * </bean> |
| 47 | + * </property> |
| 48 | + * <property name="activationSpec"> |
| 49 | + * <bean class="org.apache.activemq.ra.ActiveMQActivationSpec"> |
| 50 | + * <property name="destination" value="myQueue"/> |
| 51 | + * <property name="destinationType" value="jakarta.jms.Queue"/> |
| 52 | + * </bean> |
| 53 | + * </property> |
| 54 | + * </bean> |
| 55 | + * </pre> |
55 | 56 | *
|
56 |
| - * In this example, Spring's own {@link GenericMessageEndpointFactory} is used |
| 57 | + * <p>In this example, Spring's own {@link GenericMessageEndpointFactory} is used |
57 | 58 | * to point to a standard message listener object that happens to be supported
|
58 | 59 | * by the specified target ResourceAdapter: in this case, a JMS
|
59 | 60 | * {@link jakarta.jms.MessageListener} object as supported by the ActiveMQ
|
60 | 61 | * message broker, defined as a Spring bean:
|
61 | 62 | *
|
62 | 63 | * <pre class="code">
|
63 | 64 | * <bean id="messageListener" class="com.myorg.messaging.myMessageListener">
|
64 |
| - * ... |
65 |
| - * </bean></pre> |
| 65 | + * <!-- ... --> |
| 66 | + * </bean> |
| 67 | + * </pre> |
66 | 68 | *
|
67 |
| - * The target ResourceAdapter may be configured as a local Spring bean as well |
| 69 | + * <p>The target ResourceAdapter may be configured as a local Spring bean as well |
68 | 70 | * (the typical case) or obtained from JNDI (e.g. on WebLogic). For the
|
69 | 71 | * example above, a local ResourceAdapter bean could be defined as follows
|
70 | 72 | * (matching the "resourceAdapter" bean reference above):
|
71 | 73 | *
|
72 | 74 | * <pre class="code">
|
73 | 75 | * <bean id="resourceAdapter" class="org.springframework.jca.support.ResourceAdapterFactoryBean">
|
74 |
| - * <property name="resourceAdapter"> |
75 |
| - * <bean class="org.apache.activemq.ra.ActiveMQResourceAdapter"> |
76 |
| - * <property name="serverUrl" value="tcp://localhost:61616"/> |
77 |
| - * </bean> |
78 |
| - * </property> |
79 |
| - * <property name="workManager"> |
80 |
| - * <bean class="org.springframework.jca.work.SimpleTaskWorkManager"/> |
81 |
| - * </property> |
82 |
| - * </bean></pre> |
| 76 | + * <property name="resourceAdapter"> |
| 77 | + * <bean class="org.apache.activemq.ra.ActiveMQResourceAdapter"> |
| 78 | + * <property name="serverUrl" value="tcp://localhost:61616"/> |
| 79 | + * </bean> |
| 80 | + * </property> |
| 81 | + * <property name="workManager"> |
| 82 | + * <bean class="..."/> |
| 83 | + * </property> |
| 84 | + * </bean> |
| 85 | + * </pre> |
83 | 86 | *
|
84 |
| - * For a different target resource, the configuration would simply point to a |
| 87 | + * <p>For a different target resource, the configuration would simply point to a |
85 | 88 | * different ResourceAdapter and a different ActivationSpec object (which are
|
86 | 89 | * both specific to the resource provider), and possibly a different message
|
87 | 90 | * listener (e.g. a CCI {@link jakarta.resource.cci.MessageListener} for a
|
88 | 91 | * resource adapter which is based on the JCA Common Client Interface).
|
89 | 92 | *
|
90 | 93 | * <p>The asynchronous execution strategy can be customized through the
|
91 |
| - * "workManager" property on the ResourceAdapterFactoryBean (as shown above). |
92 |
| - * Check out {@link org.springframework.jca.work.SimpleTaskWorkManager}'s |
93 |
| - * javadoc for its configuration options; alternatively, any other |
94 |
| - * JCA-compliant WorkManager can be used (e.g. Geronimo's). |
| 94 | + * "workManager" property on the ResourceAdapterFactoryBean as shown above, |
| 95 | + * where {@code <bean class="..."/>} should be replaced with configuration for |
| 96 | + * any JCA-compliant {@code WorkManager}. |
95 | 97 | *
|
96 | 98 | * <p>Transactional execution is a responsibility of the concrete message endpoint,
|
97 | 99 | * as built by the specified MessageEndpointFactory. {@link GenericMessageEndpointFactory}
|
|
101 | 103 | *
|
102 | 104 | * <pre class="code">
|
103 | 105 | * <bean class="org.springframework.jca.endpoint.GenericMessageEndpointManager">
|
104 |
| - * <property name="resourceAdapter" ref="resourceAdapter"/> |
105 |
| - * <property name="messageEndpointFactory"> |
106 |
| - * <bean class="org.springframework.jca.endpoint.GenericMessageEndpointFactory"> |
107 |
| - * <property name="messageListener" ref="messageListener"/> |
108 |
| - * <property name="transactionManager" ref="transactionManager"/> |
109 |
| - * </bean> |
110 |
| - * </property> |
111 |
| - * <property name="activationSpec"> |
112 |
| - * <bean class="org.apache.activemq.ra.ActiveMQActivationSpec"> |
113 |
| - * <property name="destination" value="myQueue"/> |
114 |
| - * <property name="destinationType" value="jakarta.jms.Queue"/> |
115 |
| - * </bean> |
116 |
| - * </property> |
| 106 | + * <property name="resourceAdapter" ref="resourceAdapter"/> |
| 107 | + * <property name="messageEndpointFactory"> |
| 108 | + * <bean class="org.springframework.jca.endpoint.GenericMessageEndpointFactory"> |
| 109 | + * <property name="messageListener" ref="messageListener"/> |
| 110 | + * <property name="transactionManager" ref="transactionManager"/> |
| 111 | + * </bean> |
| 112 | + * </property> |
| 113 | + * <property name="activationSpec"> |
| 114 | + * <bean class="org.apache.activemq.ra.ActiveMQActivationSpec"> |
| 115 | + * <property name="destination" value="myQueue"/> |
| 116 | + * <property name="destinationType" value="jakarta.jms.Queue"/> |
| 117 | + * </bean> |
| 118 | + * </property> |
117 | 119 | * </bean>
|
118 | 120 | *
|
119 |
| - * <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager"/></pre> |
| 121 | + * <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager"/> |
| 122 | + * </pre> |
120 | 123 | *
|
121 |
| - * Alternatively, check out your resource provider's ActivationSpec object, |
| 124 | + * <p>Alternatively, check out your resource provider's ActivationSpec object, |
122 | 125 | * which should support local transactions through a provider-specific config flag,
|
123 | 126 | * e.g. ActiveMQActivationSpec's "useRAManagedTransaction" bean property.
|
124 | 127 | *
|
125 | 128 | * <pre class="code">
|
126 | 129 | * <bean class="org.springframework.jca.endpoint.GenericMessageEndpointManager">
|
127 |
| - * <property name="resourceAdapter" ref="resourceAdapter"/> |
128 |
| - * <property name="messageEndpointFactory"> |
129 |
| - * <bean class="org.springframework.jca.endpoint.GenericMessageEndpointFactory"> |
130 |
| - * <property name="messageListener" ref="messageListener"/> |
131 |
| - * </bean> |
132 |
| - * </property> |
133 |
| - * <property name="activationSpec"> |
134 |
| - * <bean class="org.apache.activemq.ra.ActiveMQActivationSpec"> |
135 |
| - * <property name="destination" value="myQueue"/> |
136 |
| - * <property name="destinationType" value="jakarta.jms.Queue"/> |
137 |
| - * <property name="useRAManagedTransaction" value="true"/> |
138 |
| - * </bean> |
139 |
| - * </property> |
140 |
| - * </bean></pre> |
| 130 | + * <property name="resourceAdapter" ref="resourceAdapter"/> |
| 131 | + * <property name="messageEndpointFactory"> |
| 132 | + * <bean class="org.springframework.jca.endpoint.GenericMessageEndpointFactory"> |
| 133 | + * <property name="messageListener" ref="messageListener"/> |
| 134 | + * </bean> |
| 135 | + * </property> |
| 136 | + * <property name="activationSpec"> |
| 137 | + * <bean class="org.apache.activemq.ra.ActiveMQActivationSpec"> |
| 138 | + * <property name="destination" value="myQueue"/> |
| 139 | + * <property name="destinationType" value="jakarta.jms.Queue"/> |
| 140 | + * <property name="useRAManagedTransaction" value="true"/> |
| 141 | + * </bean> |
| 142 | + * </property> |
| 143 | + * </bean> |
| 144 | + * </pre> |
141 | 145 | *
|
142 | 146 | * @author Juergen Hoeller
|
143 | 147 | * @since 2.5
|
|
0 commit comments