org.apache.geronimo.system.configuration
Class LocalAttributeManager

java.lang.Object
  extended by org.apache.geronimo.system.configuration.LocalAttributeManager
All Implemented Interfaces:
GBeanLifecycle, ManageableAttributeStore, PersistentConfigurationList, LocalPluginAttributeStore, PluginAttributeStore
Direct Known Subclasses:
SwitchableLocalAttributeManager

public class LocalAttributeManager
extends Object
implements LocalPluginAttributeStore, PersistentConfigurationList, GBeanLifecycle

Stores managed attributes in an XML file on the local filesystem.


Field Summary
static GBeanInfo GBEAN_INFO
           
 
Fields inherited from interface org.apache.geronimo.kernel.config.ManageableAttributeStore
ATTRIBUTE_STORE
 
Fields inherited from interface org.apache.geronimo.kernel.config.PersistentConfigurationList
PERSISTENT_CONFIGURATION_LIST
 
Constructor Summary
LocalAttributeManager(String configFile, String configSubstitutionsFileName, String configSubstitutionsPrefix, boolean readOnly, ServerInfo serverInfo)
           
 
Method Summary
 void addConfigSubstitutions(Properties properties)
           
 void addConfiguration(Artifact configurationName)
           
 void addGBean(Artifact configurationName, GBeanData gbeanData, ClassLoader classLoader)
           
 Collection applyOverrides(Artifact configName, Collection<GBeanData> untypedGbeanDatas, ClassLoader classLoader)
           
 void doFail()
           
 void doStart()
           
 void doStop()
           
 String getConfigFile()
           
 String getConfigSubstitutionsFile()
           
 String getConfigSubstitutionsPrefix()
           
static GBeanInfo getGBeanInfo()
           
 Artifact[] getListedConfigurations(Artifact query)
           
 boolean hasGBeanAttributes(Artifact configName)
          This method checks if there are any custom gbean attributes in the configuration.
 boolean isKernelFullyStarted()
           
 boolean isReadOnly()
           
 void load()
           
 void migrateConfiguration(Artifact oldName, Artifact newName, Configuration configuration)
           
 void removeConfiguration(Artifact configName)
           
 List<Artifact> restore()
           
 void save()
           
 void setKernelFullyStarted(boolean kernelFullyStarted)
           
 void setModuleGBeans(Artifact moduleName, List<GbeanType> gbeans, boolean load, String condition)
          Adds a group of settings to the attribute store.
 void setReferencePatterns(Artifact configurationName, AbstractName gbeanName, GReferenceInfo reference, ReferencePatterns patterns)
           
 void setShouldLoad(Artifact configurationName, AbstractName gbeanName, boolean load)
           
 void setValue(Artifact configurationName, AbstractName gbeanName, GAttributeInfo attribute, Object value, ClassLoader classLoader)
           
 void startConfiguration(Artifact configurationName)
           
 void stopConfiguration(Artifact configName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GBEAN_INFO

public static final GBeanInfo GBEAN_INFO
Constructor Detail

LocalAttributeManager

public LocalAttributeManager(String configFile,
                             String configSubstitutionsFileName,
                             String configSubstitutionsPrefix,
                             boolean readOnly,
                             ServerInfo serverInfo)
Method Detail

isReadOnly

public boolean isReadOnly()

getConfigFile

public String getConfigFile()
Specified by:
getConfigFile in interface LocalPluginAttributeStore

getConfigSubstitutionsFile

public String getConfigSubstitutionsFile()
Specified by:
getConfigSubstitutionsFile in interface LocalPluginAttributeStore

getConfigSubstitutionsPrefix

public String getConfigSubstitutionsPrefix()
Specified by:
getConfigSubstitutionsPrefix in interface LocalPluginAttributeStore

applyOverrides

public Collection applyOverrides(Artifact configName,
                                 Collection<GBeanData> untypedGbeanDatas,
                                 ClassLoader classLoader)
                          throws InvalidConfigException
Specified by:
applyOverrides in interface ManageableAttributeStore
Throws:
InvalidConfigException

setModuleGBeans

public void setModuleGBeans(Artifact moduleName,
                            List<GbeanType> gbeans,
                            boolean load,
                            String condition)
                     throws InvalidGBeanException
Description copied from interface: PluginAttributeStore
Adds a group of settings to the attribute store. This is used by e.g. the plugin installer to add the settings needed for a new plugin.

Specified by:
setModuleGBeans in interface PluginAttributeStore
Throws:
InvalidGBeanException

addConfigSubstitutions

public void addConfigSubstitutions(Properties properties)
Specified by:
addConfigSubstitutions in interface PluginAttributeStore

setValue

public void setValue(Artifact configurationName,
                     AbstractName gbeanName,
                     GAttributeInfo attribute,
                     Object value,
                     ClassLoader classLoader)
Specified by:
setValue in interface ManageableAttributeStore

setReferencePatterns

public void setReferencePatterns(Artifact configurationName,
                                 AbstractName gbeanName,
                                 GReferenceInfo reference,
                                 ReferencePatterns patterns)
Specified by:
setReferencePatterns in interface ManageableAttributeStore

setShouldLoad

public void setShouldLoad(Artifact configurationName,
                          AbstractName gbeanName,
                          boolean load)
Specified by:
setShouldLoad in interface ManageableAttributeStore

addGBean

public void addGBean(Artifact configurationName,
                     GBeanData gbeanData,
                     ClassLoader classLoader)
Specified by:
addGBean in interface ManageableAttributeStore

load

public void load()
          throws IOException
Throws:
IOException

save

public void save()
          throws IOException
Specified by:
save in interface ManageableAttributeStore
Specified by:
save in interface PersistentConfigurationList
Throws:
IOException

isKernelFullyStarted

public boolean isKernelFullyStarted()
Specified by:
isKernelFullyStarted in interface PersistentConfigurationList

setKernelFullyStarted

public void setKernelFullyStarted(boolean kernelFullyStarted)
Specified by:
setKernelFullyStarted in interface PersistentConfigurationList

restore

public List<Artifact> restore()
                       throws IOException
Specified by:
restore in interface PersistentConfigurationList
Throws:
IOException

startConfiguration

public void startConfiguration(Artifact configurationName)
Specified by:
startConfiguration in interface PersistentConfigurationList

addConfiguration

public void addConfiguration(Artifact configurationName)
Specified by:
addConfiguration in interface PersistentConfigurationList

removeConfiguration

public void removeConfiguration(Artifact configName)
Specified by:
removeConfiguration in interface PersistentConfigurationList

getListedConfigurations

public Artifact[] getListedConfigurations(Artifact query)
Specified by:
getListedConfigurations in interface PersistentConfigurationList

stopConfiguration

public void stopConfiguration(Artifact configName)
Specified by:
stopConfiguration in interface PersistentConfigurationList

migrateConfiguration

public void migrateConfiguration(Artifact oldName,
                                 Artifact newName,
                                 Configuration configuration)
Specified by:
migrateConfiguration in interface PersistentConfigurationList

hasGBeanAttributes

public boolean hasGBeanAttributes(Artifact configName)
This method checks if there are any custom gbean attributes in the configuration.

Specified by:
hasGBeanAttributes in interface PersistentConfigurationList
Parameters:
configName - Name of the configuration
Returns:
true if the configuration contains any custom gbean attributes

doStart

public void doStart()
             throws Exception
Specified by:
doStart in interface GBeanLifecycle
Throws:
Exception

doStop

public void doStop()
            throws Exception
Specified by:
doStop in interface GBeanLifecycle
Throws:
Exception

doFail

public void doFail()
Specified by:
doFail in interface GBeanLifecycle

getGBeanInfo

public static GBeanInfo getGBeanInfo()


Copyright © 2003-2011 The Apache Geronimo development community. All Rights Reserved.