JMS2.0规范中文版

JMS消息接口的提供者实现

JMS提供了一组定义JMS消息模型基于消息的接口。它不提供这些接口的实现。

每个JMS提供者提供它自己的实现它的Session的消息创建方法。这使得供应商使用都适合其需求的信息实现。

提供者必须准备接受来自客户端,消息的实现是不是它自己的。与“外部”执行情况的消息可能不会为有效地处理作为一个供应商自身的执行情况;但是,它必须被处理。 46 Java消息服务2.0版

JMS消息接口提供写/ set方法在消息体和消息属性设置对象的值。所有这些方法都必须实现自己的输入对象复制到该消息。输入对象的值允许为空,访问时将返回null。一个例外是,BytesMessage不支持空流的概念,并试图写入一个空进入它必须抛出java.lang.NullPointerException。

JMS消息接口提供读/得到一个消息体和消息属性访问对象的方法。所有这些方法都必须实现返回访问的消息对象的一个副本。

JMS provides a set of message interfaces that define the JMS message model. It does not provide implementations of these interfaces. Each JMS provider provides its own implementation of its Session’s message creation methods. This allows a provider to use message implementations that are tailored to its needs. A provider must be prepared to accept, from a client, a message whose implementation is not one of its own. A message with a ‘foreign’ implementation may not be handled as efficiently as a provider’s own implementation; however, it must be handled. 46 Java Message Service Version 2.0

The JMS message interfaces provide write/set methods for setting object values in a message body and message properties. All of these methods must be implemented to copy their input objects into the message. The value of an input object is allowed to be null and will return null when accessed. One exception to this is that BytesMessage does not support the concept of a null stream and attempting to write a null into it must throw java.lang.NullPointerException. The JMS message interfaces provide read/get methods for accessing objects in a message body and message properties. All of these methods must be implemented to return a copy of the accessed message objects.