博客已搬家,更好阅读体验,猛戳 http://www.jack-yin.com/english/translation/activemq-in-action/1598.html
8.6 ActiveMQ and JNDI
8.6 ActiveMQ 和 JNDI
So far this chapter has demonstrated how to configure the ActiveMQ administrative
objects (the ConnectionFactory and Destination objects) for each container that
was covered. This entailed a style of configuration for the ConnectionFactory and
Destination objects that was specific to each container so that they were made accessible
via JNDI to the sample web application. The sample web application then used Spring
to look up those objects via JNDI in order to interact with ActiveMQ. The following listing
shows an example of the Spring JNDI lookup
到目前位置,本章内中已经阐述了如何为本章中涉及到的每一个web容器配置ActiveMQ的管理对象
(ConnectionFactory对象和Destination对象).这就需要一种配置方式,为每一种web容器配置
ConnectionFactory对象和Destination对象,以便容器中的示例程序可以通过JNDI来访问那两个
对象.示例web程序中使用Spring通过JNDI来查找这些对象以便能够跟ActiveMQ交互.下面的代码
清单是Spring的JNDI查找示例配置:
...............................