01: /*
02: * $Id: UniqueIdNotSupportedException.java 10489 2008-01-23 17:53:38Z dfeist $
03: * --------------------------------------------------------------------------------------
04: * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
05: *
06: * The software in this package is published under the terms of the CPAL v1.0
07: * license, a copy of which has been included with this distribution in the
08: * LICENSE.txt file.
09: */
10:
11: package org.mule.api.transport;
12:
13: import org.mule.api.MuleRuntimeException;
14: import org.mule.config.i18n.CoreMessages;
15: import org.mule.config.i18n.Message;
16:
17: /**
18: * <code>UniqueIdNotSupportedException</code> is thrown by
19: * MessageAdapter.getUniqueId() if the underlying message does not support or have
20: * a unique identifier.
21: */
22:
23: public class UniqueIdNotSupportedException extends MuleRuntimeException {
24: /**
25: * Serial version
26: */
27: private static final long serialVersionUID = -6719055482076081111L;
28:
29: public UniqueIdNotSupportedException(MessageAdapter adapter) {
30: super (CoreMessages.uniqueIdNotSupportedByAdapter(adapter
31: .getClass().getName()));
32: }
33:
34: public UniqueIdNotSupportedException(MessageAdapter adapter,
35: Message message) {
36: super (chainMessage(CoreMessages
37: .uniqueIdNotSupportedByAdapter(adapter.getClass()
38: .getName()), message));
39: }
40:
41: public UniqueIdNotSupportedException(MessageAdapter adapter,
42: Throwable cause) {
43: super (CoreMessages.uniqueIdNotSupportedByAdapter(adapter
44: .getClass().getName()), cause);
45: }
46:
47: protected static Message chainMessage(Message m1, Message m2) {
48: m1.setNextMessage(m2);
49: return m1;
50: }
51: }
|