KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > kernel > spi > registry > KernelRegistry


1 /*
2 * JBoss, Home of Professional Open Source
3 * Copyright 2005, JBoss Inc., and individual contributors as indicated
4 * by the @authors tag. See the copyright.txt in the distribution for a
5 * full listing of individual contributors.
6 *
7 * This is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this software; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 */

22 package org.jboss.kernel.spi.registry;
23
24 import org.jboss.kernel.spi.KernelObject;
25
26 /**
27  * A registry.<p>
28  *
29  * The registry is responsible for keeping track of named
30  * beans so they can be invoked over the bus and used in dependencies.<p>
31  *
32  * @author <a HREF="adrian@jboss.com">Adrian Brock</a>
33  * @author <a HREF="mailto:les.hazlewood@jboss.org">Les A. Hazlewood</a>
34  * @version $Revision: 40694 $
35  */

36 public interface KernelRegistry extends KernelObject
37 {
38    /** Event type for registered event */
39    public static final String JavaDoc KERNEL_REGISTRY_REGISTERED = "KERNEL_REGISTRY_REGISTERED";
40
41    /** Event type for unregistered event */
42    public static final String JavaDoc KERNEL_REGISTRY_UNREGISTERED = "KERNEL_REGISTRY_UNREGISTERED";
43    
44    /**
45     * Get a registration
46     *
47     * @param name the name of the object
48     * @return the registration
49     * @throws IllegalArgumentException for a null name
50     * @throws KernelRegistryEntryNotFoundException when not found
51     */

52    KernelRegistryEntry getEntry(Object JavaDoc name);
53  
54    /**
55     * Register an object
56     *
57     * @param name the name of the object
58     * @param entry the registration
59     * @throws IllegalArgumentException for a null name or object
60     * @throws IllegalStateException when the name is already registered
61     */

62    void registerEntry(Object JavaDoc name, KernelRegistryEntry entry);
63    
64    /**
65     * Unregister an object
66     *
67     * @param name the name of the object
68     * @return the unregistered entry
69     * @throws IllegalArgumentException for a null name
70     * @throws IllegalStateException when the name is not registered
71     */

72    KernelRegistryEntry unregisterEntry(Object JavaDoc name);
73
74    /**
75     * Returns whether or not there exists a KernelRegistryEntry with the
76     * given name.
77     * @param name name of the KernelRegistryEntry
78     * @return true if there exists a KernelRegistryEntry with the given name,
79     * false otherwise.
80     */

81    boolean containsEntry( Object JavaDoc name );
82 }
83
Popular Tags