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.UMOComponent; 16 import org.mule.umo.UMOMessage; 17 import org.mule.umo.endpoint.UMOImmutableEndpoint; 18 19 27 public class ComponentRoutingException extends RoutingException 28 { 29 32 private static final long serialVersionUID = -113944443831267318L; 33 34 private transient UMOComponent component; 35 36 public ComponentRoutingException(Message message, 37 UMOMessage umoMessage, 38 UMOImmutableEndpoint endpoint, 39 UMOComponent component) 40 { 41 super(generateMessage(message, endpoint, component), umoMessage, endpoint); 42 this.component = component; 43 } 44 45 public ComponentRoutingException(Message message, 46 UMOMessage umoMessage, 47 UMOImmutableEndpoint endpoint, 48 UMOComponent component, 49 Throwable cause) 50 { 51 super(generateMessage(message, endpoint, component), umoMessage, endpoint, cause); 52 this.component = component; 53 } 54 55 public ComponentRoutingException(UMOMessage umoMessage, 56 UMOImmutableEndpoint endpoint, 57 UMOComponent component) 58 { 59 super(generateMessage(null, endpoint, component), umoMessage, endpoint); 60 this.component = component; 61 } 62 63 public ComponentRoutingException(UMOMessage umoMessage, 64 UMOImmutableEndpoint endpoint, 65 UMOComponent component, 66 Throwable cause) 67 { 68 super(generateMessage(null, endpoint, component), umoMessage, endpoint, cause); 69 this.component = component; 70 71 } 72 73 private static Message generateMessage(Message message, 74 UMOImmutableEndpoint endpoint, 75 UMOComponent component) 76 { 77 78 Message m = new Message(Messages.COMPONENT_X_ROUTING_FAILED_ON_ENDPOINT_X, component.getDescriptor() 79 .getName(), endpoint.getEndpointURI()); 80 if (message != null) 81 { 82 message.setNextMessage(m); 83 return message; 84 } 85 else 86 { 87 return m; 88 } 89 } 90 91 public UMOComponent getComponent() 92 { 93 return component; 94 } 95 } 96 | Popular Tags |