KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > umo > provider > UniqueIdNotSupportedException


1 /*
2  * $Id: UniqueIdNotSupportedException.java 3798 2006-11-04 04:07:14Z aperepel $
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 MuleSource MPL
7  * license, a copy of which has been included with this distribution in the
8  * LICENSE.txt file.
9  */

10
11 package org.mule.umo.provider;
12
13 import org.mule.MuleRuntimeException;
14 import org.mule.config.i18n.Message;
15 import org.mule.config.i18n.Messages;
16
17 /**
18  * <code>UniqueIdNotSupportedException</code> is thrown by
19  * UMOMessageAdapter.getUniqueId() if the underlying message does not support or have
20  * a unique identifier.
21  *
22  * @author <a HREF="mailto:ross.mason@symphonysoft.com">Ross Mason</a>
23  * @version $Revision: 3798 $
24  */

25
26 public class UniqueIdNotSupportedException extends MuleRuntimeException
27 {
28     /**
29      * Serial version
30      */

31     private static final long serialVersionUID = -6719055482076081111L;
32
33     public UniqueIdNotSupportedException(UMOMessageAdapter adapter)
34     {
35         super(new Message(Messages.UNIQUE_ID_NOT_SUPPORTED_BY_ADAPTER_X, adapter.getClass().getName()));
36     }
37
38     public UniqueIdNotSupportedException(UMOMessageAdapter adapter, Message message)
39     {
40         super(chainMessage(new Message(Messages.UNIQUE_ID_NOT_SUPPORTED_BY_ADAPTER_X, adapter.getClass()
41             .getName()), message));
42     }
43
44     public UniqueIdNotSupportedException(UMOMessageAdapter adapter, Throwable JavaDoc cause)
45     {
46         super(new Message(Messages.UNIQUE_ID_NOT_SUPPORTED_BY_ADAPTER_X, adapter.getClass().getName()), cause);
47     }
48
49     protected static Message chainMessage(Message m1, Message m2)
50     {
51         m1.setNextMessage(m2);
52         return m1;
53     }
54 }
55
Popular Tags