|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.geronimo.system.configuration.LocalAttributeManager
public class LocalAttributeManager
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 configSubstitutionsFile,
String configSubstitutionsPrefix,
boolean readOnly,
ServerInfo serverInfo)
|
Method Summary | |
---|---|
void |
addConfiguration(Artifact configurationName)
Adds a configuration to the list, but does not mark it as started. |
void |
addGBean(Artifact configurationName,
GBeanData gbeanData,
ClassLoader classLoader)
Adds a GBean to the configuration. |
Collection |
applyOverrides(Artifact configName,
Collection untypedGbeanDatas,
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 |
doFail()
Fails the GBean. |
void |
doStart()
Starts the GBean. |
void |
doStop()
Stops the target. |
static GBeanInfo |
getGBeanInfo()
|
Artifact[] |
getListedConfigurations(Artifact query)
Gets all configurations in the list matching the specified query, whether they are marked at starting or not. |
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)
Migrates settings from an old version of a configuration to a newer version of the configuration. |
void |
removeConfiguration(Artifact configName)
Removes all record of the specified configuration from the configuration list. |
List |
restore()
|
void |
save()
Saves the current values to persistent storage. |
void |
setKernelFullyStarted(boolean kernelFullyStarted)
|
void |
setModuleGBeans(Artifact moduleName,
GBeanOverride[] gbeans)
Adds a group of settings to the attribute store. |
void |
setReferencePatterns(Artifact configurationName,
AbstractName gbeanName,
GReferenceInfo reference,
ReferencePatterns patterns)
Sets the pattern for a GBean reference. |
void |
setShouldLoad(Artifact configurationName,
AbstractName gbeanName,
boolean load)
Sets whether a particular GBean should be loaded for this configuration. |
void |
setValue(Artifact configurationName,
AbstractName gbeanName,
GAttributeInfo attribute,
Object value,
ClassLoader classLoader)
Sets the stored value for a particular attribute. |
void |
startConfiguration(Artifact configurationName)
Indicates that the configuration should be started when the server is started. |
void |
stopConfiguration(Artifact configName)
Indicates that the configuration should not be started when the server is started. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final GBeanInfo GBEAN_INFO
Constructor Detail |
---|
public LocalAttributeManager(String configFile, String configSubstitutionsFile, String configSubstitutionsPrefix, boolean readOnly, ServerInfo serverInfo)
Method Detail |
---|
public boolean isReadOnly()
public Collection applyOverrides(Artifact configName, Collection untypedGbeanDatas, ClassLoader classLoader) throws InvalidConfigException
ManageableAttributeStore
applyOverrides
in interface ManageableAttributeStore
configName
- The configuration in questionuntypedGbeanDatas
- The initial GBeanData's for all the GBeans in
the configuration
InvalidConfigException
- If something bad happenspublic void setModuleGBeans(Artifact moduleName, GBeanOverride[] gbeans)
PluginAttributeStore
setModuleGBeans
in interface PluginAttributeStore
public void setValue(Artifact configurationName, AbstractName gbeanName, GAttributeInfo attribute, Object value, ClassLoader classLoader)
ManageableAttributeStore
setValue
in interface ManageableAttributeStore
configurationName
- The name of the configuration holding the GBean
in questiongbeanName
- The ObjectName of the GBean in questionattribute
- The attribute in questionvalue
- The value to save, or null if no value should be savedclassLoader
- The configuration's classLoaderpublic void setReferencePatterns(Artifact configurationName, AbstractName gbeanName, GReferenceInfo reference, ReferencePatterns patterns)
ManageableAttributeStore
setReferencePatterns
in interface ManageableAttributeStore
configurationName
- the name of the configuration holding the GBean in questiongbeanName
- the ObjectName of the GBeanreference
- the attribute informationpublic void setShouldLoad(Artifact configurationName, AbstractName gbeanName, boolean load)
ManageableAttributeStore
setShouldLoad
in interface ManageableAttributeStore
configurationName
- The configuration that the GBean belongs togbeanName
- The GBean in questionload
- True if the GBean should load with the configurationpublic void addGBean(Artifact configurationName, GBeanData gbeanData, ClassLoader classLoader)
ManageableAttributeStore
addGBean
in interface ManageableAttributeStore
configurationName
- the configuration that the GBean belongs togbeanData
- the GBean to addclassLoader
- The configuration classLoaderpublic void load() throws IOException
IOException
public void save() throws IOException
ManageableAttributeStore
save
in interface ManageableAttributeStore
save
in interface PersistentConfigurationList
IOException
public boolean isKernelFullyStarted()
isKernelFullyStarted
in interface PersistentConfigurationList
public void setKernelFullyStarted(boolean kernelFullyStarted)
setKernelFullyStarted
in interface PersistentConfigurationList
public List restore() throws IOException
restore
in interface PersistentConfigurationList
IOException
public void startConfiguration(Artifact configurationName)
PersistentConfigurationList
startConfiguration
in interface PersistentConfigurationList
public void addConfiguration(Artifact configurationName)
PersistentConfigurationList
addConfiguration
in interface PersistentConfigurationList
public void removeConfiguration(Artifact configName)
PersistentConfigurationList
removeConfiguration
in interface PersistentConfigurationList
public Artifact[] getListedConfigurations(Artifact query)
PersistentConfigurationList
getListedConfigurations
in interface PersistentConfigurationList
query
- The artifact to search for, normally not fully resolved
so there may be multiple matches or matches that are not
exactly equal to the argument.
public void stopConfiguration(Artifact configName)
PersistentConfigurationList
stopConfiguration
in interface PersistentConfigurationList
public void migrateConfiguration(Artifact oldName, Artifact newName, Configuration configuration)
PersistentConfigurationList
migrateConfiguration
in interface PersistentConfigurationList
oldName
- The name that the existing settings are undernewName
- The name to move the settings toconfiguration
- The configuration itself, which can be used to
verify that all the settings are still valid as
they are migrated.public boolean hasGBeanAttributes(Artifact configName)
hasGBeanAttributes
in interface PersistentConfigurationList
configName
- Name of the configuration
public void doStart() throws Exception
GBeanLifecycle
doStart
in interface GBeanLifecycle
Exception
- if the target failed to start; this will cause a transition to the failed statepublic void doStop() throws Exception
GBeanLifecycle
doStop
in interface GBeanLifecycle
Exception
- if the target failed to stop; this will cause a transition to the failed statepublic void doFail()
GBeanLifecycle
doFail
in interface GBeanLifecycle
public static GBeanInfo getGBeanInfo()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |