org.apache.geronimo.kernel.config
Interface ManageableAttributeStore


public interface ManageableAttributeStore

Able to retrieve the values of certain "manageable" attributes from a repository that is more accessible to an end user (compared to the serialized data in the ConfigStore).


Field Summary
static String ATTRIBUTE_STORE
           
 
Method Summary
 void addGBean(Artifact configurationName, GBeanData gbeanData)
          Adds a GBean to the configuration.
 Collection applyOverrides(Artifact configurationName, Collection datas, ClassLoader classLoader)
          Given a configuration name and a set of GBeanDatas, apply all the saved overrides to that set of GBeans before the caller attempts to load them.
 void save()
          Saves the current values to persistent storage.
 void setReferencePatterns(Artifact configurationName, AbstractName gbean, GReferenceInfo reference, ReferencePatterns patterns)
          Sets the pattern for a GBean reference.
 void setShouldLoad(Artifact configurationName, AbstractName gbean, boolean load)
          Sets whether a particular GBean should be loaded for this configuration.
 void setValue(Artifact configurationName, AbstractName gbean, GAttributeInfo attribute, Object value)
          Sets the stored value for a particular attribute.
 

Field Detail

ATTRIBUTE_STORE

static final String ATTRIBUTE_STORE
See Also:
Constant Field Values
Method Detail

applyOverrides

Collection applyOverrides(Artifact configurationName,
                          Collection datas,
                          ClassLoader classLoader)
                          throws InvalidConfigException
Given a configuration name and a set of GBeanDatas, apply all the saved overrides to that set of GBeans before the caller attempts to load them.

Parameters:
configurationName - The configuration in question
datas - The initial GBeanData's for all the GBeans in the configuration
classLoader -
Returns:
The modified GBeanData's
Throws:
InvalidConfigException - If something bad happens

setValue

void setValue(Artifact configurationName,
              AbstractName gbean,
              GAttributeInfo attribute,
              Object value)
Sets the stored value for a particular attribute. The attribute is identified by the configuration name, GBean ObjectName, and attribute information. Note: it is not possible to store a meaningful value of "null"; that would be treated the same as if no value was stored. Generally, whenever the value for a manageable attribute is changed, this method should be called so that value isn't reversed the next time the GBean is started.

Parameters:
configurationName - The name of the configuration holding the GBean in question
gbean - The ObjectName of the GBean in question
attribute - The attribute in question
value - The value to save, or null if no value should be saved

setReferencePatterns

void setReferencePatterns(Artifact configurationName,
                          AbstractName gbean,
                          GReferenceInfo reference,
                          ReferencePatterns patterns)
Sets the pattern for a GBean reference. The reference is identified by the configuration name, GBean ObjectName, and reference information. To "null-out" the reference use setReferencePatterns(configurationName, gbean, reference, Collections.EMPTY_SET).

Parameters:
configurationName - the name of the configuration holding the GBean in question
gbean - the ObjectName of the GBean
reference - the attribute information
patterns -

setShouldLoad

void setShouldLoad(Artifact configurationName,
                   AbstractName gbean,
                   boolean load)
Sets whether a particular GBean should be loaded for this configuration. The GBean must already exist in the configuration, this just toggles the flag for whether to stop it from loading when the configuration is loaded.

Parameters:
configurationName - The configuration that the GBean belongs to
gbean - The GBean in question
load - True if the GBean should load with the configuration

addGBean

void addGBean(Artifact configurationName,
              GBeanData gbeanData)
Adds a GBean to the configuration.

Parameters:
configurationName - the configuration that the GBean belongs to
gbeanData - the GBean to add

save

void save()
          throws IOException
Saves the current values to persistent storage. This should be called when the server is shut down or more often, to make sure that any changes will be reflected the next time the server starts and the store is consulted.

Throws:
IOException


Copyright © 2006 Apache Software Foundation. All Rights Reserved.