KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > fr > dyade > aaa > jndi2 > impl > MissingContextException


1 /**
2  * JORAM: Java(TM) Open Reliable Asynchronous Messaging
3  * Copyright (C) 2001 - ScalAgent Distributed Technologies
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
18  * USA.
19  *
20  * Initial developer(s): Sofiane Chibani
21  * Contributor(s): David Feliot, Nicolas Tachker
22  */

23 package fr.dyade.aaa.jndi2.impl;
24
25 import javax.naming.*;
26
27 /**
28  * Thrown when a naming context has not been found
29  * whereas its parent naming context contains a
30  * <code>ContextRecord</code> indicating that
31  * the naming context exists.
32  * This may happen in a distributed JNDI configuration
33  * when a naming context has not been
34  * locally created yet. For example if the context
35  * /A has been created on the server 0 and the context
36  * /A/B on the server 1. If the server 2 starts, it gets
37  * from the server 0 the naming context /A
38  * containing a <code>ContextRecord</code> named B.
39  * If a JNDI request is asked about B (e.g. bind /A/B/C)
40  * then the server 2 can't find the naming context B because
41  * it still didn't get the naming data from server 1. So a
42  * <code>MissingContextException</code> is thrown.
43  */

44 public class MissingContextException extends NamingException {
45
46   /**
47    * The identifier of the missing context
48    */

49   private NamingContextId missingContextId;
50
51   private CompositeName name;
52
53   /**
54    * Constructs a <code>MissingContextException</code>.
55    *
56    * @param missingContextId the identifier of the missing context
57    */

58   public MissingContextException(
59     NamingContextId missingContextId,
60     CompositeName name) {
61     this.missingContextId = missingContextId;
62     this.name = name;
63   }
64   
65   public final NamingContextId getMissingContextId() {
66     return missingContextId;
67   }
68
69   public final CompositeName getName() {
70     return name;
71   }
72
73   public String JavaDoc toString() {
74     return '(' + super.toString() +
75       ",missingContextId=" + missingContextId +
76       ",name=" + name + ')';
77   }
78 }
79
Popular Tags