站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Spring Framework 2.1.0 API 文档英文版

SimpleMessageConverter102 (Spring Framework API 2.1) - Spring Framework 2.1.0 API 文档英文版


The Spring Framework

org.springframework.jms.support.converter
Class SimpleMessageConverter102

java.lang.Object
  extended by org.springframework.jms.support.converter.SimpleMessageConverter
      extended by org.springframework.jms.support.converter.SimpleMessageConverter102
All Implemented Interfaces:
MessageConverter

public class SimpleMessageConverter102
extends SimpleMessageConverter

A subclass of SimpleMessageConverter that uses the JMS 1.0.2 specification, rather than the JMS 1.1 methods used by SimpleMessageConverter itself. This class can be used for JMS 1.0.2 providers, offering the same functionality as SimpleMessageConverter does for JMS 1.1 providers.

The only difference to the default SimpleMessageConverter is that BytesMessage is handled differently: namely, without using the getBodyLength() method which has been introduced in JMS 1.1 and is therefore not available on a JMS 1.0.2 provider.

Since:
1.1.1
Author:
Juergen Hoeller
See Also:
BytesMessage.getBodyLength()

Field Summary
static int BUFFER_SIZE
           
 
Constructor Summary
SimpleMessageConverter102()
           
 
Method Summary
protected  byte[] extractByteArrayFromMessage(BytesMessage message)
          Overrides superclass method to copy bytes from the message into a ByteArrayOutputStream, using a buffer, to avoid using the getBodyLength() method which has been introduced in JMS 1.1 and is therefore not available on a JMS 1.0.2 provider.
 
Methods inherited from class org.springframework.jms.support.converter.SimpleMessageConverter
createMessageForByteArray, createMessageForMap, createMessageForSerializable, createMessageForString, extractMapFromMessage, extractSerializableFromMessage, extractStringFromMessage, fromMessage, toMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUFFER_SIZE

public static final int BUFFER_SIZE
See Also:
Constant Field Values
Constructor Detail

SimpleMessageConverter102

public SimpleMessageConverter102()
Method Detail

extractByteArrayFromMessage

protected byte[] extractByteArrayFromMessage(BytesMessage message)
                                      throws JMSException
Overrides superclass method to copy bytes from the message into a ByteArrayOutputStream, using a buffer, to avoid using the getBodyLength() method which has been introduced in JMS 1.1 and is therefore not available on a JMS 1.0.2 provider.

Overrides:
extractByteArrayFromMessage in class SimpleMessageConverter
Parameters:
message - the message to convert
Returns:
the resulting byte array
Throws:
JMSException - if thrown by JMS methods
See Also:
BytesMessage.getBodyLength()

The Spring Framework

Copyright © 2002-2007 The Spring Framework.