Imported GNU Classpath 0.90
[official-gcc.git] / libjava / classpath / org / omg / CosNaming / NamingContextOperations.java
blobcc93cb7ba4d02dd90c462439e5f678d96409950d
1 /* NamingContext.java --
2 Copyright (C) 2005, 2006 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING. If not, write to the
18 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 02110-1301 USA.
21 Linking this library statically or dynamically with other modules is
22 making a combined work based on this library. Thus, the terms and
23 conditions of the GNU General Public License cover the whole
24 combination.
26 As a special exception, the copyright holders of this library give you
27 permission to link this library with independent modules to produce an
28 executable, regardless of the license terms of these independent
29 modules, and to copy and distribute the resulting executable under
30 terms of your choice, provided that you also meet, for each linked
31 independent module, the terms and conditions of the license of that
32 module. An independent module is a module which is not derived from
33 or based on this library. If you modify this library, you may extend
34 this exception to your version of the library, but you are not
35 obligated to do so. If you do not wish to do so, delete this
36 exception statement from your version. */
39 package org.omg.CosNaming;
41 import org.omg.CosNaming.NamingContextPackage.AlreadyBound;
42 import org.omg.CosNaming.NamingContextPackage.CannotProceed;
43 import org.omg.CosNaming.NamingContextPackage.InvalidName;
44 import org.omg.CosNaming.NamingContextPackage.NotEmpty;
45 import org.omg.CosNaming.NamingContextPackage.NotFound;
47 /**
48 * The naming context operations. The naming context can
49 * store (bound) and retrieve (resolve) the named objects or
50 * named child contexts.
52 * @see NamingContextExtOperations
54 * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
56 public interface NamingContextOperations
58 /**
59 * Gives the object a name, valid in this context.
61 * @param a_name the name, being given to the object.
62 * @param an_object the object, being named.
64 * @throws AlreadyBound if the object is already named in this context.
65 * @throws InvalidName if the name has zero length or otherwise invalid.
67 void bind(NameComponent[] a_name, org.omg.CORBA.Object an_object)
68 throws NotFound, CannotProceed, InvalidName, AlreadyBound;
70 /**
71 * Gives a child context name, valid in this context.
73 * @param a_name the name, being given to the child context.
74 * @param a_context the child context being named.
76 * @throws AlreadyBound if the child context is already named in
77 * the current context.
79 void bind_context(NameComponent[] a_name, NamingContext a_context)
80 throws NotFound, CannotProceed, InvalidName, AlreadyBound;
82 /**
83 * Create a new context and give it a given name (bound it)
84 * in the current context.
86 * @param a_name the name being given to the new context.
88 * @return the newly created context.
90 * @throws AlreadyBound if the name is already in use.
91 * @throws InvalidName if the name has zero length or otherwise invalid.
93 NamingContext bind_new_context(NameComponent[] a_name)
94 throws NotFound, AlreadyBound, CannotProceed,
95 InvalidName;
97 /**
98 * Destroy this context (must be empty).
99 * @throws NotEmpty if the context being destroyed is not empty.
101 void destroy()
102 throws NotEmpty;
105 * Iterate over all bindings, defined in this namind context.
107 * @param amount the maximal number of context to return in the
108 * holder a_list. The remaining bindings are accessible via iterator
109 * an_iter. If the parameter amount is zero, all bindings are accessed only
110 * via this iterator.
112 * @param a_list the holder, where the returned bindigs are stored.
113 * @param an_iter the iterator that can be used to access the remaining
114 * bindings.
116 void list(int amount, BindingListHolder a_list, BindingIteratorHolder an_iter);
119 * Creates a new naming context, not bound to any name.
121 NamingContext new_context();
124 * Names or renames the object.
126 * @param a_name the new name, being given to the object. If
127 * the object is already named in this context, it is renamed.
129 * @param an_object the object, being named.
131 * @throws InvalidName if the name has zero length or otherwise invalid.
133 void rebind(NameComponent[] a_name, org.omg.CORBA.Object an_object)
134 throws NotFound, CannotProceed, InvalidName;
137 * Names or renames the child context.
138 * If the child context is already named in
139 * the current context, it is renamed.
141 * @param a_name the name, being given to the child context.
142 * @param a_context the child context being named.
144 * @throws InvalidName if the name has zero length or otherwise invalid.
146 void rebind_context(NameComponent[] a_name, NamingContext a_context)
147 throws NotFound, CannotProceed, InvalidName;
150 * Get the object, bound to the specified name in this
151 * context.
153 * @param a_name the object name.
155 * @return the object, matching this name. The client
156 * usually casts or narrows (using the helper) the returned value
157 * to the more specific type.
159 * @throws NotFound
160 * @throws InvalidName if the name has zero length or otherwise invalid.
162 org.omg.CORBA.Object resolve(NameComponent[] a_name)
163 throws NotFound, CannotProceed, InvalidName;
166 * Removes the name from the binding context.
168 * @param a_name a name to remove.
170 * @throws InvalidName if the name has zero length or otherwise invalid.
172 void unbind(NameComponent[] a_name)
173 throws NotFound, CannotProceed, InvalidName;