Package org.springframework.jms.support.converter

Examples of org.springframework.jms.support.converter.MessageConverter


   * @return the content of the message, to be passed into the
   * listener method as argument
   * @throws JMSException if thrown by JMS API methods
   */
  protected Object extractMessage(Message message) throws JMSException {
    MessageConverter converter = getMessageConverter();
    if (converter != null) {
      return converter.fromMessage(message);
    }
    return message;
  }
View Full Code Here


   * @return the JMS <code>Message</code> (never <code>null</code>)
   * @throws JMSException if thrown by JMS API methods
   * @see #setMessageConverter
   */
  protected Message buildMessage(Session session, Object result) throws JMSException {
    MessageConverter converter = getMessageConverter();
    if (converter != null) {
      return converter.toMessage(result, session);
    }
    else {
      if (!(result instanceof Message)) {
        throw new MessageConversionException(
            "No MessageConverter specified - cannot handle message [" + result + "]");
View Full Code Here

  public MessageConverter getMessageConverter() {
    return this.messageConverter;
  }

  private MessageConverter getRequiredMessageConverter() throws IllegalStateException {
    MessageConverter converter = getMessageConverter();
    if (converter == null) {
      throw new IllegalStateException("No 'messageConverter' specified. Check configuration of JmsTemplate.");
    }
    return converter;
  }
View Full Code Here

  public MessageConverter getMessageConverter() {
    return this.messageConverter;
  }

  private MessageConverter getRequiredMessageConverter() throws IllegalStateException {
    MessageConverter converter = getMessageConverter();
    if (converter == null) {
      throw new IllegalStateException("No 'messageConverter' specified. Check configuration of JmsTemplate.");
    }
    return converter;
  }
View Full Code Here

   * @return the content of the message, to be passed into the
   * listener method as argument
   * @throws JMSException if thrown by JMS API methods
   */
  protected Object extractMessage(Message message) throws JMSException {
    MessageConverter converter = getMessageConverter();
    if (converter != null) {
      return converter.fromMessage(message);
    }
    return message;
  }
View Full Code Here

   * @return the JMS <code>Message</code> (never <code>null</code>)
   * @throws JMSException if thrown by JMS API methods
   * @see #setMessageConverter
   */
  protected Message buildMessage(Session session, Object result) throws JMSException {
    MessageConverter converter = getMessageConverter();
    if (converter != null) {
      return converter.toMessage(result, session);
    }
    else {
      if (!(result instanceof Message)) {
        throw new MessageConversionException(
            "No MessageConverter specified - cannot handle message [" + result + "]");
View Full Code Here

   * @return the content of the message, to be passed into the
   * listener method as argument
   * @throws JMSException if thrown by JMS API methods
   */
  protected Object extractMessage(Message message) throws JMSException {
    MessageConverter converter = getMessageConverter();
    if (converter != null) {
      return converter.fromMessage(message);
    }
    return message;
  }
View Full Code Here

   * @return the JMS <code>Message</code> (never <code>null</code>)
   * @throws JMSException if thrown by JMS API methods
   * @see #setMessageConverter
   */
  protected Message buildMessage(Session session, Object result) throws JMSException {
    MessageConverter converter = getMessageConverter();
    if (converter != null) {
      return converter.toMessage(result, session);
    }
    else {
      if (!(result instanceof Message)) {
        throw new MessageConversionException(
            "No MessageConverter specified - cannot handle message [" + result + "]");
View Full Code Here

   * listener method as argument
   * @throws MessageConversionException if the message could not be unmarshaled
   */
  protected Object extractMessage(Message message)  {
    try {
      MessageConverter converter = getMessageConverter();
      if (converter != null) {
        return converter.fromMessage(message);
      }
      return message;
    }
    catch (JMSException ex) {
      throw new MessageConversionException("Could not unmarshal message", ex);
View Full Code Here

  public MessageConverter getMessageConverter() {
    return this.messageConverter;
  }

  private MessageConverter getRequiredMessageConverter() throws IllegalStateException {
    MessageConverter converter = getMessageConverter();
    if (converter == null) {
      throw new IllegalStateException("No 'messageConverter' specified. Check configuration of JmsTemplate.");
    }
    return converter;
  }
View Full Code Here

TOP

Related Classes of org.springframework.jms.support.converter.MessageConverter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.