KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > media > util > registry > Registry


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7
8 package org.jboss.media.util.registry;
9
10 import java.util.Iterator JavaDoc;
11
12 /**
13  * A registry.
14  *
15  * @version <tt>$Revision: 1.1 $</tt>
16  * @author <a HREF="mailto:ricardoarguello@users.sourceforge.net">Ricardo ArgŁello</a>
17  */

18 public interface Registry
19 {
20    /**
21     * Binds the given key with the given value.
22     *
23     * @param key.
24     * @param value.
25     * @throws ObjectAlreadyBoundException if there is another value
26     * already bound for that key.
27     */

28    public void bind(Object JavaDoc key, Object JavaDoc value)
29       throws ObjectAlreadyBoundException;
30
31    /**
32     * Rebinds the given key with the given value.
33     *
34     * @param key.
35     * @param value.
36     */

37    public void rebind(Object JavaDoc key, Object JavaDoc value);
38
39    /**
40     * Unbinds a value with the given key.
41     *
42     * @param key.
43     * @return value unbound.
44     * @throws ObjectNotBoundException if there is no value bound to the key.
45     */

46    public Object JavaDoc unbind(Object JavaDoc key) throws ObjectNotBoundException;
47
48    /**
49     * Lookups a value with the given key.
50     *
51     * @param key.
52     * @return value obtained.
53     * @throws ObjectNotBoundException if there is no value bound to the key.
54     */

55    public Object JavaDoc lookup(Object JavaDoc key) throws ObjectNotBoundException;
56
57    /**
58     * Obtains an <code>Iterator</code> for all the keys in the registry.
59     *
60     * @return keys iterator.
61     */

62    public Iterator JavaDoc keyIterator();
63 }
64
Popular Tags