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).

Version:
$Rev: 809078 $ $Date: 2009-08-29 08:51:12 +0800 (Sat, 29 Aug 2009) $

Field Summary
static String ATTRIBUTE_STORE
           
 
Method Summary
 void addGBean(Artifact configurationName, GBeanData gbeanData, org.osgi.framework.Bundle bundle)
          Adds a GBean to the configuration.
 Collection<GBeanData> applyOverrides(Artifact configurationName, Collection<GBeanData> datas, org.osgi.framework.Bundle bundle)
          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 gbeanName, GAttributeInfo attribute, Object value, org.osgi.framework.Bundle bundle)
          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<GBeanData> applyOverrides(Artifact configurationName,
                                     Collection<GBeanData> datas,
                                     org.osgi.framework.Bundle bundle)
                                     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
bundle -
Returns:
The modified GBeanData's
Throws:
InvalidConfigException - If something bad happens

setValue

void setValue(Artifact configurationName,
              AbstractName gbeanName,
              GAttributeInfo attribute,
              Object value,
              org.osgi.framework.Bundle bundle)
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
gbeanName -
attribute - The attribute in question
value - The value to save, or null if no value should be saved
bundle -

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,
              org.osgi.framework.Bundle bundle)
Adds a GBean to the configuration.

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

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 © 2003-2013 The Apache Geronimo development community. All Rights Reserved.