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

MessageConverter (Spring Framework) - Spring Framework 1.2.9 API 文档英文版


org.springframework.jms.support.converter
Interface MessageConverter

All Known Implementing Classes:
SimpleMessageConverter, SimpleMessageConverter102

public interface MessageConverter

Strategy interface that specifies a MessageConverter between Java objects and JMS messages.

Since:
1.1
Author:
Mark Pollack, Juergen Hoeller

Method Summary
 Object fromMessage(Message message)
          Convert from a JMS Message to a Java object.
 Message toMessage(Object object, Session session)
          Convert a Java object to a JMS Message using the supplied session to create the message object.
 

Method Detail

toMessage

Message toMessage(Object object,
                  Session session)
                  throws JMSException,
                         MessageConversionException
Convert a Java object to a JMS Message using the supplied session to create the message object.

Parameters:
object - the object to convert
session - the Session to use for creating a JMS Message
Returns:
the JMS Message
Throws:
JMSException - if thrown by JMS API methods
MessageConversionException - in case of conversion failure

fromMessage

Object fromMessage(Message message)
                   throws JMSException,
                          MessageConversionException
Convert from a JMS Message to a Java object.

Parameters:
message - the message to convert
Returns:
the converted Java object
Throws:
MessageConversionException - in case of conversion failure
JMSException


Copyright (c) 2002-2007 The Spring Framework Project.