KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jfun > yan > UnsatisfiedComponentException


1 /*****************************************************************************
2  * Copyright (C) Codehaus.org. All rights reserved. *
3  * ------------------------------------------------------------------------- *
4  * The software in this package is published under the terms of the BSD *
5  * style license a copy of which has been included with this distribution in *
6  * the LICENSE.txt file. *
7  *****************************************************************************/

8 /*
9  * Created on Mar 7, 2005
10  *
11  * Author Ben Yu
12  * ZBS
13  */

14 package jfun.yan;
15
16 /**
17  * Represents an exception when a component's dependency cannot be satisfied.
18  * <p>
19  * Codehaus.org.
20  *
21  * @author Ben Yu
22  *
23  */

24 public class UnsatisfiedComponentException extends ComponentResolutionException {
25   private final Object JavaDoc key;
26   /**
27    * Create a UnsatisfiedComponentException object.
28    * @param k the component key.
29    * @param msg the error message.
30    */

31   public UnsatisfiedComponentException(Object JavaDoc k, String JavaDoc msg) {
32     super(msg);
33     this.key = k;
34   }
35
36   /**
37    * Create a UnsatisfiedComponentException object.
38    * @param k the component key.
39    */

40   public UnsatisfiedComponentException(Object JavaDoc k) {
41     super("component <"+k + "> not satisfied");
42     this.key = k;
43   }
44   /**
45    * Get the component key.
46    * @return the component key.
47    */

48   public Object JavaDoc getComponentKey(){
49     return key;
50   }
51 }
52
Popular Tags