View Javadoc

1   /*
2    * $Id: MessageTypeNotSupportedException.java 10489 2008-01-23 17:53:38Z dfeist $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.api.transport;
12  
13  import org.mule.api.MessagingException;
14  import org.mule.config.i18n.CoreMessages;
15  
16  /**
17   * <code>MessageTypeNotSupportedException</code> is thrown when a message payload
18   * is set on a Message implementation of MessageAdapter which is not of supported
19   * type for that message or adapter.
20   */
21  
22  public class MessageTypeNotSupportedException extends MessagingException
23  {
24      /**
25       * Serial version
26       */
27      private static final long serialVersionUID = -3954838511333933643L;
28  
29      public MessageTypeNotSupportedException(Object message, Class adapterClass)
30      {
31          super(CoreMessages.messageNotSupportedByAdapter(
32              (message != null ? message.getClass().getName() : "null"),
33              (adapterClass != null ? adapterClass.getName() : "null class")), 
34              message);
35      }
36  
37      public MessageTypeNotSupportedException(Object message, Class adapterClass, Throwable cause)
38      {
39          super(CoreMessages.messageNotSupportedByAdapter(
40              (message != null ? message.getClass().getName() : "null"), 
41              (adapterClass != null ? adapterClass.getName() : "null class")), 
42              message, cause);
43      }
44  }