KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sape > carbon > core > config > node > NodeRemovalException


1 /*
2  * The contents of this file are subject to the Sapient Public License
3  * Version 1.0 (the "License"); you may not use this file except in compliance
4  * with the License. You may obtain a copy of the License at
5  * http://carbon.sf.net/License.html.
6  *
7  * Software distributed under the License is distributed on an "AS IS" basis,
8  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
9  * the specific language governing rights and limitations under the License.
10  *
11  * The Original Code is The Carbon Component Framework.
12  *
13  * The Initial Developer of the Original Code is Sapient Corporation
14  *
15  * Copyright (C) 2003 Sapient Corporation. All Rights Reserved.
16  */

17
18 package org.sape.carbon.core.config.node;
19
20 /**
21  * Thrown when a <code>Node</code> could not be removed.
22  *
23  * Copyright 2002 Sapient
24  * @since carbon 1.0
25  * @author Douglas Voet, February 2002
26  * @version $Revision: 1.12 $($Author: dvoet $ / $Date: 2003/05/05 21:21:18 $)
27  */

28 public class NodeRemovalException extends NodeException {
29
30     /**
31      * The node object that could not be removed.
32      */

33     protected Node node;
34
35     /**
36      * Creates a NodeRemovalException
37      *
38      * @param sourceClass the class in which this exception was caused.
39      * @param node the node object that could not be removed.
40      * @param previousException the exception that may have caused this
41      * failure.
42      */

43     public NodeRemovalException(
44             Class JavaDoc sourceClass, Node node, Throwable JavaDoc previousException) {
45
46
47         super(sourceClass, node.getAbsoluteName(),
48             "The node could not be removed",
49             previousException);
50         this.node = node;
51     }
52
53     /**
54      * Creates a NodeRemovalException
55      *
56      * @param sourceClass the class in which this exception was caused.
57      * @param node the node object that could not be removed.
58      */

59     public NodeRemovalException(Class JavaDoc sourceClass, Node node, String JavaDoc reason) {
60         super(sourceClass, node.getAbsoluteName(),
61             "The node could not be removed, Reason: " + reason);
62         this.node = node;
63     }
64
65     /**
66      * Retrieves the node that could not be removed.
67      * @return the node that could not be removed.
68      */

69     public Node getNode() {
70         return this.node;
71     }
72 }
73
Popular Tags