KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > kernel > spi > dependency > KernelController


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.dependency;
23
24 import java.util.Set JavaDoc;
25
26 import org.jboss.beans.metadata.spi.BeanMetaData;
27 import org.jboss.dependency.spi.Controller;
28 import org.jboss.kernel.spi.KernelObject;
29
30 /**
31  * A controller.<p>
32  *
33  * The controller is the core component for keeping track
34  * of beans to make sure the configuration and lifecycle are
35  * done in the correct order including dependencies and
36  * classloading considerations.
37  *
38  * @author <a HREF="adrian@jboss.com">Adrian Brock</a>
39  * @version $Revision: 57133 $
40  */

41 public interface KernelController extends KernelObject, Controller
42 {
43    /**
44     * Install a context
45     *
46     * @param metaData the metaData
47     * @return the context
48     * @throws Throwable for any error
49     */

50    KernelControllerContext install(BeanMetaData metaData) throws Throwable JavaDoc;
51
52    /**
53     * Install a context
54     *
55     * @param metaData the metaData
56     * @param target the target object
57     * @return the context
58     * @throws Throwable for any error
59     */

60    KernelControllerContext install(BeanMetaData metaData, Object JavaDoc target) throws Throwable JavaDoc;
61
62    /**
63     * Add supplies
64     *
65     * @param context the context
66     */

67    void addSupplies(KernelControllerContext context);
68
69    /**
70     * Remove supplies
71     *
72     * @param context the context
73     */

74    void removeSupplies(KernelControllerContext context);
75
76    /**
77     * Get all instantiated contexts of a type
78     *
79     * @param clazz the type
80     * @return the contexts
81     */

82    Set JavaDoc<KernelControllerContext> getInstantiatedContexts(Class JavaDoc clazz);
83
84    /**
85     * If zero or multiple instances match class clazz
86     * a warning is issued, but no throwable is thrown
87     *
88     * @param clazz the type
89     * @return context whose target is instance of this class clazz param or null if zero or multiple such instances
90     */

91    KernelControllerContext getContextByClass(Class JavaDoc clazz);
92
93    /**
94     * add instantiated context into contextsByClass map
95     * look at all target's superclasses and interfaces
96     *
97     * @param context the context
98     */

99    void addInstantiatedContext(KernelControllerContext context);
100
101    /**
102     * remove instantiated context from contextsByClass map
103     * look at all target's superclasses and interfaces
104     *
105     * @param context the context
106     */

107    void removeInstantiatedContext(KernelControllerContext context);
108 }
109
Popular Tags