GenericMessageEndpointManager.java | Class | Generic bean that manages JCA 1.5 message endpoints within a Spring
application context, activating and deactivating the endpoint as part
of the application context's lifecycle.
This class is completely generic in that it may work with any
ResourceAdapter, any MessageEndpointFactory, and any ActivationSpec.
It can be configured in standard bean style, for example through
Spring's XML bean definition format, as follows:
<bean class="org.springframework.jca.endpoint.GenericMessageEndpointManager">
<property name="resourceAdapter" ref="resourceAdapter"/>
<property name="messageEndpointFactory">
<bean class="org.springframework.jca.endpoint.GenericMessageEndpointFactory">
<property name="messageListener" ref="messageListener"/>
</bean>
</property>
<property name="activationSpec">
<bean class="org.apache.activemq.ra.ActiveMQActivationSpec">
<property name="destination" value="myQueue"/>
<property name="destinationType" value="javax.jms.Queue"/>
</bean>
</property>
</bean>
In this example, Spring's own
GenericMessageEndpointFactory is used
to point to a standard message listener object that happens to be supported
by the specified target ResourceAdapter: in this case, a JMS
javax.jms.MessageListener object as supported by the ActiveMQ
message broker, defined as a Spring bean:
<bean id="messageListener" class="com.myorg.messaging.myMessageListener">
...
</bean>
The target ResourceAdapter may be configured as a local Spring bean as well
(the typical case) or obtained from JNDI (e.g. |