1
2
3
4
5
6
7 package org.mule.api.transport;
8
9 import org.mule.api.MuleException;
10 import org.mule.api.endpoint.ImmutableEndpoint;
11 import org.mule.config.i18n.CoreMessages;
12 import org.mule.config.i18n.Message;
13 import org.mule.util.ObjectUtils;
14
15
16
17
18
19 public class ReceiveException extends MuleException
20 {
21
22
23
24 private static final long serialVersionUID = 1960304517882133951L;
25
26 private ImmutableEndpoint endpoint;
27
28
29
30
31 public ReceiveException(Message message, ImmutableEndpoint endpoint, long timeout)
32 {
33 super(message);
34 this.endpoint = endpoint;
35 addInfo("Endpoint", ObjectUtils.toString(this.endpoint, "null"));
36 addInfo("Timeout", String.valueOf(timeout));
37 }
38
39
40
41
42
43 public ReceiveException(Message message, ImmutableEndpoint endpoint, long timeout, Throwable cause)
44 {
45 super(message, cause);
46 this.endpoint = endpoint;
47 addInfo("Endpoint", ObjectUtils.toString(this.endpoint, "null"));
48 addInfo("Timeout", String.valueOf(timeout));
49 }
50
51 public ReceiveException(ImmutableEndpoint endpoint, long timeout, Throwable cause)
52 {
53 this(CoreMessages.failedToRecevieWithTimeout(endpoint, timeout),
54 endpoint, timeout, cause);
55 }
56 }