1 10 11 package org.mule.umo; 12 13 import org.mule.config.i18n.Message; 14 import org.mule.config.i18n.Messages; 15 16 20 public class ComponentException extends MessagingException 22 { 23 26 private static final long serialVersionUID = 56178344205041599L; 27 28 private transient final UMOComponent component; 29 30 33 public ComponentException(Message message, UMOMessage umoMessage, UMOComponent component) 34 { 35 super(generateMessage(message, component), umoMessage); 36 this.component = component; 37 } 38 39 43 public ComponentException(Message message, UMOMessage umoMessage, UMOComponent component, Throwable cause) 44 { 45 super(generateMessage(message, component), umoMessage, cause); 46 this.component = component; 47 } 48 49 public ComponentException(UMOMessage umoMessage, UMOComponent component, Throwable cause) 50 { 51 super(generateMessage(null, component), umoMessage, cause); 52 this.component = component; 53 } 54 55 public UMOComponent getComponent() 56 { 57 return component; 58 } 59 60 private static Message generateMessage(Message previousMessage, UMOComponent component) 61 { 62 Message returnMessage = new Message(Messages.COMPONENT_CAUSED_ERROR_IS_X, component); 63 if (previousMessage != null) 64 { 65 previousMessage.setNextMessage(returnMessage); 66 return previousMessage; 67 } 68 else 69 { 70 return returnMessage; 71 } 72 } 73 74 } 75 | Popular Tags |