KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > umo > lifecycle > LifecycleException


1 /*
2  * $Id: LifecycleException.java 3798 2006-11-04 04:07:14Z aperepel $
3  * --------------------------------------------------------------------------------------
4  * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
5  *
6  * The software in this package is published under the terms of the MuleSource MPL
7  * license, a copy of which has been included with this distribution in the
8  * LICENSE.txt file.
9  */

10
11 package org.mule.umo.lifecycle;
12
13 import org.apache.commons.lang.ObjectUtils;
14 import org.mule.config.i18n.Message;
15 import org.mule.config.i18n.Messages;
16 import org.mule.umo.UMOException;
17
18 /**
19  * <code>LifecycleException</code> TODO
20  *
21  * @author <a HREF="mailto:ross.mason@symphonysoft.com">Ross Mason</a>
22  * @version $Revision: 3798 $
23  */

24
25 public class LifecycleException extends UMOException
26 {
27     /**
28      * Serial version
29      */

30     private static final long serialVersionUID = 2909614055858287394L;
31
32     private transient Object JavaDoc component;
33
34     /**
35      * @param message the exception message
36      * @param component the object that failed during a lifecycle method call
37      */

38     public LifecycleException(Message message, Object JavaDoc component)
39     {
40         super(message);
41         this.component = component;
42     }
43
44     /**
45      * @param message the exception message
46      * @param cause the exception that cause this exception to be thrown
47      * @param component the object that failed during a lifecycle method call
48      */

49     public LifecycleException(Message message, Throwable JavaDoc cause, Object JavaDoc component)
50     {
51         super(message, cause);
52         this.component = component;
53     }
54
55     /**
56      * @param cause the exception that cause this exception to be thrown
57      * @param component the object that failed during a lifecycle method call
58      */

59     public LifecycleException(Throwable JavaDoc cause, Object JavaDoc component)
60     {
61         super(new Message(Messages.INITIALISATION_FAILURE_X, cause.getMessage()), cause);
62         this.component = component;
63         addInfo("Object", ObjectUtils.toString(component, "null"));
64     }
65
66     public Object JavaDoc getComponent()
67     {
68         return component;
69     }
70
71 }
72
Popular Tags