org.apache.geronimo.system.configuration
Class LocalAttributeManager

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

public class LocalAttributeManager
extends Object
implements LocalPluginAttributeStore, org.apache.geronimo.kernel.config.PersistentConfigurationList, org.apache.geronimo.gbean.GBeanLifecycle

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

Version:
$Rev: 1460822 $ $Date: 2013-03-26 02:32:05 +0800 (Tue, 26 Mar 2013) $

Field Summary
static org.apache.geronimo.gbean.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(org.apache.geronimo.kernel.repository.Artifact configurationName)
           
 void addGBean(org.apache.geronimo.kernel.repository.Artifact configurationName, org.apache.geronimo.gbean.GBeanData gbeanData, org.osgi.framework.Bundle bundle)
           
 Collection<org.apache.geronimo.gbean.GBeanData> applyOverrides(org.apache.geronimo.kernel.repository.Artifact configName, Collection<org.apache.geronimo.gbean.GBeanData> untypedGbeanDatas, org.osgi.framework.Bundle bundle)
           
 void doFail()
           
 void doStart()
           
 void doStop()
           
 String getConfigFile()
           
 String getConfigSubstitutionsFile()
           
 String getConfigSubstitutionsPrefix()
           
 Map<String,Object> getConfigSubstitutionsVariables()
           
static org.apache.geronimo.gbean.GBeanInfo getGBeanInfo()
           
 org.apache.geronimo.kernel.repository.Artifact[] getListedConfigurations(org.apache.geronimo.kernel.repository.Artifact query)
           
 boolean hasGBeanAttributes(org.apache.geronimo.kernel.repository.Artifact configName)
          This method checks if there are any custom gbean attributes in the configuration.
 boolean isKernelFullyStarted()
           
 boolean isModuleInstalled(org.apache.geronimo.kernel.repository.Artifact artifact)
           
 boolean isReadOnly()
           
 void load()
           
 void migrateConfiguration(org.apache.geronimo.kernel.repository.Artifact oldName, org.apache.geronimo.kernel.repository.Artifact newName, org.apache.geronimo.kernel.config.Configuration configuration)
           
protected  org.apache.geronimo.gbean.GBeanInfoFactory newGBeanInfoFactory()
           
 void removeConfiguration(org.apache.geronimo.kernel.repository.Artifact configName)
           
 List<org.apache.geronimo.kernel.repository.Artifact> restore()
           
 void save()
           
 void setKernelFullyStarted(boolean kernelFullyStarted)
           
 void setModuleGBeans(org.apache.geronimo.kernel.repository.Artifact moduleName, List<GbeanType> gbeans, boolean load, String condition)
          Adds a group of settings to the attribute store.
 void setReferencePatterns(org.apache.geronimo.kernel.repository.Artifact configurationName, org.apache.geronimo.gbean.AbstractName gbeanName, org.apache.geronimo.gbean.GReferenceInfo reference, org.apache.geronimo.gbean.ReferencePatterns patterns)
           
 void setShouldLoad(org.apache.geronimo.kernel.repository.Artifact configurationName, org.apache.geronimo.gbean.AbstractName gbeanName, boolean load)
           
 void setValue(org.apache.geronimo.kernel.repository.Artifact configurationName, org.apache.geronimo.gbean.AbstractName gbeanName, org.apache.geronimo.gbean.GAttributeInfo attribute, Object value, org.osgi.framework.Bundle bundle)
           
 void startConfiguration(org.apache.geronimo.kernel.repository.Artifact configurationName)
           
 void stopConfiguration(org.apache.geronimo.kernel.repository.Artifact configName)
           
 String substitute(String in)
           
 
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 org.apache.geronimo.gbean.GBeanInfo GBEAN_INFO
Constructor Detail

LocalAttributeManager

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

newGBeanInfoFactory

protected org.apache.geronimo.gbean.GBeanInfoFactory newGBeanInfoFactory()

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

getConfigSubstitutionsVariables

public Map<String,Object> getConfigSubstitutionsVariables()

applyOverrides

public Collection<org.apache.geronimo.gbean.GBeanData> applyOverrides(org.apache.geronimo.kernel.repository.Artifact configName,
                                                                      Collection<org.apache.geronimo.gbean.GBeanData> untypedGbeanDatas,
                                                                      org.osgi.framework.Bundle bundle)
                                                               throws org.apache.geronimo.kernel.config.InvalidConfigException
Specified by:
applyOverrides in interface org.apache.geronimo.kernel.config.ManageableAttributeStore
Throws:
org.apache.geronimo.kernel.config.InvalidConfigException

setModuleGBeans

public void setModuleGBeans(org.apache.geronimo.kernel.repository.Artifact moduleName,
                            List<GbeanType> gbeans,
                            boolean load,
                            String condition)
                     throws org.apache.geronimo.kernel.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:
org.apache.geronimo.kernel.InvalidGBeanException

isModuleInstalled

public boolean isModuleInstalled(org.apache.geronimo.kernel.repository.Artifact artifact)
Specified by:
isModuleInstalled in interface PluginAttributeStore

substitute

public String substitute(String in)
Specified by:
substitute in interface PluginAttributeStore

addConfigSubstitutions

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

setValue

public void setValue(org.apache.geronimo.kernel.repository.Artifact configurationName,
                     org.apache.geronimo.gbean.AbstractName gbeanName,
                     org.apache.geronimo.gbean.GAttributeInfo attribute,
                     Object value,
                     org.osgi.framework.Bundle bundle)
Specified by:
setValue in interface org.apache.geronimo.kernel.config.ManageableAttributeStore

setReferencePatterns

public void setReferencePatterns(org.apache.geronimo.kernel.repository.Artifact configurationName,
                                 org.apache.geronimo.gbean.AbstractName gbeanName,
                                 org.apache.geronimo.gbean.GReferenceInfo reference,
                                 org.apache.geronimo.gbean.ReferencePatterns patterns)
Specified by:
setReferencePatterns in interface org.apache.geronimo.kernel.config.ManageableAttributeStore

setShouldLoad

public void setShouldLoad(org.apache.geronimo.kernel.repository.Artifact configurationName,
                          org.apache.geronimo.gbean.AbstractName gbeanName,
                          boolean load)
Specified by:
setShouldLoad in interface org.apache.geronimo.kernel.config.ManageableAttributeStore

addGBean

public void addGBean(org.apache.geronimo.kernel.repository.Artifact configurationName,
                     org.apache.geronimo.gbean.GBeanData gbeanData,
                     org.osgi.framework.Bundle bundle)
Specified by:
addGBean in interface org.apache.geronimo.kernel.config.ManageableAttributeStore

load

public void load()
          throws IOException
Throws:
IOException

save

public void save()
          throws IOException
Specified by:
save in interface org.apache.geronimo.kernel.config.ManageableAttributeStore
Specified by:
save in interface org.apache.geronimo.kernel.config.PersistentConfigurationList
Throws:
IOException

isKernelFullyStarted

public boolean isKernelFullyStarted()
Specified by:
isKernelFullyStarted in interface org.apache.geronimo.kernel.config.PersistentConfigurationList

setKernelFullyStarted

public void setKernelFullyStarted(boolean kernelFullyStarted)
Specified by:
setKernelFullyStarted in interface org.apache.geronimo.kernel.config.PersistentConfigurationList

restore

public List<org.apache.geronimo.kernel.repository.Artifact> restore()
                                                             throws IOException
Specified by:
restore in interface org.apache.geronimo.kernel.config.PersistentConfigurationList
Throws:
IOException

startConfiguration

public void startConfiguration(org.apache.geronimo.kernel.repository.Artifact configurationName)
Specified by:
startConfiguration in interface org.apache.geronimo.kernel.config.PersistentConfigurationList

addConfiguration

public void addConfiguration(org.apache.geronimo.kernel.repository.Artifact configurationName)
Specified by:
addConfiguration in interface org.apache.geronimo.kernel.config.PersistentConfigurationList

removeConfiguration

public void removeConfiguration(org.apache.geronimo.kernel.repository.Artifact configName)
Specified by:
removeConfiguration in interface org.apache.geronimo.kernel.config.PersistentConfigurationList

getListedConfigurations

public org.apache.geronimo.kernel.repository.Artifact[] getListedConfigurations(org.apache.geronimo.kernel.repository.Artifact query)
Specified by:
getListedConfigurations in interface org.apache.geronimo.kernel.config.PersistentConfigurationList

stopConfiguration

public void stopConfiguration(org.apache.geronimo.kernel.repository.Artifact configName)
Specified by:
stopConfiguration in interface org.apache.geronimo.kernel.config.PersistentConfigurationList

migrateConfiguration

public void migrateConfiguration(org.apache.geronimo.kernel.repository.Artifact oldName,
                                 org.apache.geronimo.kernel.repository.Artifact newName,
                                 org.apache.geronimo.kernel.config.Configuration configuration)
Specified by:
migrateConfiguration in interface org.apache.geronimo.kernel.config.PersistentConfigurationList

hasGBeanAttributes

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

Specified by:
hasGBeanAttributes in interface org.apache.geronimo.kernel.config.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 org.apache.geronimo.gbean.GBeanLifecycle
Throws:
Exception

doStop

public void doStop()
            throws Exception
Specified by:
doStop in interface org.apache.geronimo.gbean.GBeanLifecycle
Throws:
Exception

doFail

public void doFail()
Specified by:
doFail in interface org.apache.geronimo.gbean.GBeanLifecycle

getGBeanInfo

public static org.apache.geronimo.gbean.GBeanInfo getGBeanInfo()


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