|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.amqp.support.converter.AbstractMessageConverter
org.springframework.amqp.support.converter.SimpleMessageConverter
public class SimpleMessageConverter
Implementation of MessageConverter that can work with Strings, Serializable instances,
or byte arrays. The AbstractMessageConverter.toMessage(Object, MessageProperties) method simply checks the
type of the provided instance while the fromMessage(Message) method relies upon the
content-type of the provided Message.
| Field Summary | |
|---|---|
static java.lang.String |
DEFAULT_CHARSET
|
| Constructor Summary | |
|---|---|
SimpleMessageConverter()
|
|
| Method Summary | |
|---|---|
protected Message |
createMessage(java.lang.Object object,
MessageProperties messageProperties)
Creates an AMQP Message from the provided Object. |
protected java.io.ObjectInputStream |
createObjectInputStream(java.io.InputStream is,
java.lang.String codebaseUrl)
Create an ObjectInputStream for the given InputStream and codebase. |
java.lang.Object |
fromMessage(Message message)
Converts from a AMQP Message to an Object. |
void |
setBeanClassLoader(java.lang.ClassLoader beanClassLoader)
|
void |
setCodebaseUrl(java.lang.String codebaseUrl)
Set the codebase URL to download classes from if not found locally. |
void |
setDefaultCharset(java.lang.String defaultCharset)
Specify the default charset to use when converting to or from text-based Message body content. |
| Methods inherited from class org.springframework.amqp.support.converter.AbstractMessageConverter |
|---|
isCreateMessageIds, setCreateMessageIds, toMessage |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String DEFAULT_CHARSET
| Constructor Detail |
|---|
public SimpleMessageConverter()
| Method Detail |
|---|
public void setBeanClassLoader(java.lang.ClassLoader beanClassLoader)
setBeanClassLoader in interface org.springframework.beans.factory.BeanClassLoaderAwarepublic void setCodebaseUrl(java.lang.String codebaseUrl)
Follows RMI's codebase conventions for dynamic class download.
CodebaseAwareObjectInputStream,
java.rmi.server.RMIClassLoaderpublic void setDefaultCharset(java.lang.String defaultCharset)
public java.lang.Object fromMessage(Message message)
throws MessageConversionException
fromMessage in interface MessageConverterfromMessage in class AbstractMessageConvertermessage - the message to convert
MessageConversionException - in case of conversion failure
protected Message createMessage(java.lang.Object object,
MessageProperties messageProperties)
throws MessageConversionException
createMessage in class AbstractMessageConverterobject - the payloadmessageProperties - the message properties (headers)
MessageConversionException
protected java.io.ObjectInputStream createObjectInputStream(java.io.InputStream is,
java.lang.String codebaseUrl)
throws java.io.IOException
is - the InputStream to read fromcodebaseUrl - the codebase URL to load classes from if not found locally (can be null)
java.io.IOException - if creation of the ObjectInputStream failedCodebaseAwareObjectInputStream
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||