Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
LifecycleException |
|
| 1.0;1 |
1 | /* | |
2 | * $Id: LifecycleException.java 10808 2008-02-14 20:36:57Z acooke $ | |
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 CPAL v1.0 | |
7 | * license, a copy of which has been included with this distribution in the | |
8 | * LICENSE.txt file. | |
9 | */ | |
10 | ||
11 | package org.mule.api.lifecycle; | |
12 | ||
13 | import org.mule.api.MuleException; | |
14 | import org.mule.config.i18n.CoreMessages; | |
15 | import org.mule.config.i18n.Message; | |
16 | import org.mule.util.ObjectUtils; | |
17 | ||
18 | /** <code>LifecycleException</code> TODO */ | |
19 | ||
20 | public class LifecycleException extends MuleException | |
21 | { | |
22 | ||
23 | /** Serial version */ | |
24 | private static final long serialVersionUID = 2909614055858287394L; | |
25 | ||
26 | private transient Object component; | |
27 | ||
28 | /** | |
29 | * @param message the exception message | |
30 | * @param service the object that failed during a lifecycle method call | |
31 | */ | |
32 | public LifecycleException(Message message, Object component) | |
33 | { | |
34 | 16 | super(message); |
35 | 16 | this.component = component; |
36 | 16 | } |
37 | ||
38 | /** | |
39 | * @param message the exception message | |
40 | * @param cause the exception that cause this exception to be thrown | |
41 | * @param service the object that failed during a lifecycle method call | |
42 | */ | |
43 | public LifecycleException(Message message, Throwable cause, Object component) | |
44 | { | |
45 | 2 | super(message, cause); |
46 | 2 | this.component = component; |
47 | 2 | } |
48 | ||
49 | /** | |
50 | * @param cause the exception that cause this exception to be thrown | |
51 | * @param service the object that failed during a lifecycle method call | |
52 | */ | |
53 | public LifecycleException(Throwable cause, Object component) | |
54 | { | |
55 | 0 | super(CoreMessages.initialisationFailure(cause.getMessage()), cause); |
56 | 0 | this.component = component; |
57 | 0 | addInfo("Object", ObjectUtils.toString(component, "null")); |
58 | 0 | } |
59 | ||
60 | public Object getComponent() | |
61 | { | |
62 | 0 | return component; |
63 | } | |
64 | } |