1 10 11 package org.mule.umo.routing; 12 13 import org.mule.config.i18n.Message; 14 import org.mule.config.i18n.Messages; 15 import org.mule.umo.MessagingException; 16 import org.mule.umo.UMOMessage; 17 import org.mule.umo.endpoint.UMOImmutableEndpoint; 18 19 27 public class RoutingException extends MessagingException 28 { 29 32 private static final long serialVersionUID = 2478458847072048645L; 33 34 protected transient UMOImmutableEndpoint endpoint; 35 36 public RoutingException(UMOMessage message, UMOImmutableEndpoint endpoint) 37 { 38 super(generateMessage(null, endpoint), message); 39 this.endpoint = endpoint; 40 } 41 42 public RoutingException(UMOMessage umoMessage, UMOImmutableEndpoint endpoint, Throwable cause) 43 { 44 super(generateMessage(null, endpoint), umoMessage, cause); 45 this.endpoint = endpoint; 46 } 47 48 public RoutingException(Message message, UMOMessage umoMessage, UMOImmutableEndpoint endpoint) 49 { 50 super(generateMessage(message, endpoint), umoMessage); 51 this.endpoint = endpoint; 52 } 53 54 public RoutingException(Message message, 55 UMOMessage umoMessage, 56 UMOImmutableEndpoint endpoint, 57 Throwable cause) 58 { 59 super(generateMessage(message, endpoint), umoMessage, cause); 60 this.endpoint = endpoint; 61 } 62 63 public UMOImmutableEndpoint getEndpoint() 64 { 65 return endpoint; 66 } 67 68 private static Message generateMessage(Message message, UMOImmutableEndpoint endpoint) 69 { 70 Message m = new Message(Messages.FAILED_TO_ROUTER_VIA_ENDPOINT, endpoint); 71 if (message != null) 72 { 73 message.setNextMessage(m); 74 return message; 75 } 76 else 77 { 78 return m; 79 } 80 } 81 } 82 | Popular Tags |