Updated indentation
This commit is contained in:
parent
d0c9040cb9
commit
ee9f0336b5
|
@ -8,22 +8,20 @@ import javax.jms.Session;
|
||||||
import org.springframework.jms.support.converter.MessageConversionException;
|
import org.springframework.jms.support.converter.MessageConversionException;
|
||||||
import org.springframework.jms.support.converter.MessageConverter;
|
import org.springframework.jms.support.converter.MessageConverter;
|
||||||
|
|
||||||
public class SampleMessageConverter implements MessageConverter{
|
public class SampleMessageConverter implements MessageConverter {
|
||||||
|
|
||||||
public Message toMessage(Object object, Session session)
|
public Message toMessage(Object object, Session session) throws JMSException, MessageConversionException {
|
||||||
throws JMSException, MessageConversionException {
|
Employee person = (Employee) object;
|
||||||
Employee person = (Employee) object;
|
MapMessage message = session.createMapMessage();
|
||||||
MapMessage message = session.createMapMessage();
|
message.setString("name", person.getName());
|
||||||
message.setString("name", person.getName());
|
message.setInt("age", person.getAge());
|
||||||
message.setInt("age", person.getAge());
|
return message;
|
||||||
return message;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public Object fromMessage(Message message) throws JMSException,
|
public Object fromMessage(Message message) throws JMSException, MessageConversionException {
|
||||||
MessageConversionException {
|
MapMessage mapMessage = (MapMessage) message;
|
||||||
MapMessage mapMessage = (MapMessage) message;
|
Employee person = new Employee(mapMessage.getString("name"), mapMessage.getInt("age"));
|
||||||
Employee person = new Employee(mapMessage.getString("name"), mapMessage.getInt("age"));
|
return person;
|
||||||
return person;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue