首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 开源软件 >

JMS 基础概念(2)

2012-09-25 
JMS 基础概念(二)本节讲述:The JMS API Programming Model上图为JMS Programming Model 的框架图一、首先阐

JMS 基础概念(二)
本节讲述:The JMS API Programming Model



上图为JMS Programming Model 的框架图


一、首先阐述上一篇文档的遗留问题:Administered Objects.

Administered Objects

    Two parts of a JMS application--destinations and connection factories--are best maintained administratively rather than programmatically . 【Administered Objects 是通过文件配置的,包含两部分destinations 和 connection factories】

    1.1 Connection Factories
    A connection factory is the object a client uses to create a connection to a provider. A connection factory encapsulates a set of connection configuration parameters that has been defined by an administrator. Each connection factory is an instance of the ConnectionFactory, QueueConnectionFactory, or TopicConnectionFactory interface.
  
    如下图:



     At the beginning of a JMS client program, you usually perform a JNDI lookup of a connection factory, then cast and assign it to a ConnectionFactory object.

    



    


     6.2 Message Bodies
     The JMS API defines five message body formats, also called message types, which allow you to send and to receive data in many different forms and provide compatibility with existing messaging formats.

    


     The JMS API provides methods for creating messages of each type and for filling in their contents. For example, to create and send a TextMessage, you might use the following statements:
    

    
      至于整个的流程和例子,以及JSM的优缺点会在后续的文章中给出.
    

热点排行