KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > dependency > spi > Controller


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

40 public interface Controller extends JBossInterface
41 {
42    /**
43     * Install a context
44     *
45     * @param context the context
46     * @throws Throwable for any error
47     */

48    void install(ControllerContext context) throws Throwable JavaDoc;
49
50    /**
51     * Change a context to the given state
52     *
53     * @param context the context
54     * @param state the state
55     * @throws Throwable for any error
56     */

57    void change(ControllerContext context, ControllerState state) throws Throwable JavaDoc;
58
59    /**
60     * Enable an on demand context
61     *
62     * @param context the context
63     * @throws Throwable for any error
64     */

65    void enableOnDemand(ControllerContext context) throws Throwable JavaDoc;
66    
67    /**
68     * Uninstall a context
69     *
70     * @param name the name of the component
71     * @return the context
72     */

73    ControllerContext uninstall(Object JavaDoc name);
74    
75    /**
76     * Get a context
77     *
78     * @param name the name of the component
79     * @param state the state (pass null for any state)
80     * @return the context
81     */

82    ControllerContext getContext(Object JavaDoc name, ControllerState state);
83    
84    /**
85     * Get an installed context
86     *
87     * @param name the name of the component
88     * @return the context
89     */

90    ControllerContext getInstalledContext(Object JavaDoc name);
91    
92    /**
93     * Get the contexts not installed
94     *
95     * @return Set<ControllerContext>
96     */

97    Set JavaDoc<ControllerContext> getNotInstalled();
98    
99    /**
100     * Add a state.
101     *
102     * @param state the state to add
103     * @param before the state to add before or null to add to the end
104     */

105    void addState(ControllerState state, ControllerState before);
106    
107    /**
108     * Get the states.
109     *
110     * @return the states in order
111     */

112    List JavaDoc<ControllerState> getStates();
113 }
114
Popular Tags