KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > geronimo > kernel > config > ManageableAttributeStore


1 /**
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17 package org.apache.geronimo.kernel.config;
18
19 import org.apache.geronimo.gbean.GAttributeInfo;
20 import org.apache.geronimo.gbean.GBeanData;
21 import org.apache.geronimo.gbean.GReferenceInfo;
22 import org.apache.geronimo.gbean.AbstractName;
23 import org.apache.geronimo.gbean.ReferencePatterns;
24 import org.apache.geronimo.kernel.repository.Artifact;
25
26 import java.io.IOException JavaDoc;
27 import java.util.Collection JavaDoc;
28
29 /**
30  * Able to retrieve the values of certain "manageable" attributes from a
31  * repository that is more accessible to an end user (compared to the
32  * serialized data in the ConfigStore).
33  *
34  * @version $Rev: 476457 $ $Date: 2006-11-18 01:49:20 -0500 (Sat, 18 Nov 2006) $
35  */

36 public interface ManageableAttributeStore {
37
38     public static final String JavaDoc ATTRIBUTE_STORE = "AttributeStore";
39
40     /**
41      * Given a configuration name and a set of GBeanDatas, apply all the saved
42      * overrides to that set of GBeans before the caller attempts to load
43      * them.
44      *
45      * @param configurationName The configuration in question
46      * @param datas The initial GBeanData's for all the GBeans in
47      * the configuration
48      * @param classLoader
49      * @return The modified GBeanData's
50      * @throws InvalidConfigException If something bad happens
51      */

52     public Collection JavaDoc applyOverrides(Artifact configurationName, Collection JavaDoc datas, ClassLoader JavaDoc classLoader) throws InvalidConfigException;
53
54     /**
55      * Sets the stored value for a particular attribute. The attribute is
56      * identified by the configuration name, GBean ObjectName, and attribute
57      * information. Note: it is not possible to store a meaningful value of
58      * "null"; that would be treated the same as if no value was stored.
59      *
60      * Generally, whenever the value for a manageable attribute is changed,
61      * this method should be called so that value isn't reversed the next time
62      * the GBean is started.
63      *
64      * @param configurationName The name of the configuration holding the GBean
65      * in question
66      * @param gbean The ObjectName of the GBean in question
67      * @param attribute The attribute in question
68      * @param value The value to save, or null if no value should be saved
69      */

70     public void setValue(Artifact configurationName, AbstractName gbean, GAttributeInfo attribute, Object JavaDoc value);
71
72     /**
73      * Sets the pattern for a GBean reference. The reference is
74      * identified by the configuration name, GBean ObjectName, and reference
75      * information.
76      *
77      * To "null-out" the reference use setReferencePatterns(configurationName, gbean, reference, Collections.EMPTY_SET).
78      *
79      * @param configurationName the name of the configuration holding the GBean in question
80      * @param gbean the ObjectName of the GBean
81      * @param reference the attribute information
82      * @param patterns
83      */

84     public void setReferencePatterns(Artifact configurationName, AbstractName gbean, GReferenceInfo reference, ReferencePatterns patterns);
85
86     /**
87      * Sets whether a particular GBean should be loaded for this configuration.
88      * The GBean must already exist in the configuration, this just toggles the
89      * flag for whether to stop it from loading when the configuration is
90      * loaded.
91      *
92      * @param configurationName The configuration that the GBean belongs to
93      * @param gbean The GBean in question
94      * @param load True if the GBean should load with the configuration
95      */

96     public void setShouldLoad(Artifact configurationName, AbstractName gbean, boolean load);
97
98
99     /**
100      * Adds a GBean to the configuration.
101      * @param configurationName the configuration that the GBean belongs to
102      * @param gbeanData the GBean to add
103      */

104     public void addGBean(Artifact configurationName, GBeanData gbeanData);
105
106     /**
107      * Saves the current values to persistent storage. This should be called
108      * when the server is shut down or more often, to make sure that any
109      * changes will be reflected the next time the server starts and the
110      * store is consulted.
111      */

112     public void save() throws IOException JavaDoc;
113 }
114
Popular Tags