Class XmlConfigurationPersister
- java.lang.Object
-
- org.jboss.as.controller.persistence.AbstractConfigurationPersister
-
- org.jboss.as.controller.persistence.XmlConfigurationPersister
-
- All Implemented Interfaces:
ConfigurationPersister
,ExtensibleConfigurationPersister
,SubsystemXmlWriterRegistry
- Direct Known Subclasses:
BackupXmlConfigurationPersister
public class XmlConfigurationPersister extends AbstractConfigurationPersister
A configuration persister which uses an XML file for backing storage.- Author:
- David M. Lloyd
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jboss.as.controller.persistence.ConfigurationPersister
ConfigurationPersister.PersistenceResource, ConfigurationPersister.SnapshotInfo
-
-
Field Summary
-
Fields inherited from interface org.jboss.as.controller.persistence.ConfigurationPersister
NULL_SNAPSHOT_INFO
-
-
Constructor Summary
Constructors Constructor Description XmlConfigurationPersister(File fileName, QName rootElement, org.jboss.staxmapper.XMLElementReader<List<org.jboss.dmr.ModelNode>> rootParser, org.jboss.staxmapper.XMLElementWriter<ModelMarshallingContext> rootDeparser)
Construct a new instance.XmlConfigurationPersister(File fileName, QName rootElement, org.jboss.staxmapper.XMLElementReader<List<org.jboss.dmr.ModelNode>> rootParser, org.jboss.staxmapper.XMLElementWriter<ModelMarshallingContext> rootDeparser, boolean suppressLoad)
Construct a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<org.jboss.dmr.ModelNode>
load()
Load the configuration model, returning it as a list of updates to be executed by the controller.void
registerAdditionalRootElement(QName anotherRoot, org.jboss.staxmapper.XMLElementReader<List<org.jboss.dmr.ModelNode>> parser)
ConfigurationPersister.PersistenceResource
store(org.jboss.dmr.ModelNode model, Set<PathAddress> affectedAddresses)
Persist the given configuration model ifConfigurationPersister.isPersisting()
would returntrue
, otherwise return a no-opConfigurationPersister.PersistenceResource
.protected void
successfulBoot(File file)
-
Methods inherited from class org.jboss.as.controller.persistence.AbstractConfigurationPersister
deleteSnapshot, listSnapshots, marshallAsXml, registerSubsystemWriter, registerSubsystemWriter, successfulBoot, unregisterSubsystemWriter
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jboss.as.controller.persistence.ConfigurationPersister
isPersisting, publish, snapshot, snapshot
-
-
-
-
Constructor Detail
-
XmlConfigurationPersister
public XmlConfigurationPersister(File fileName, QName rootElement, org.jboss.staxmapper.XMLElementReader<List<org.jboss.dmr.ModelNode>> rootParser, org.jboss.staxmapper.XMLElementWriter<ModelMarshallingContext> rootDeparser)
Construct a new instance.- Parameters:
fileName
- the configuration base file namerootElement
- the root element of the configuration filerootParser
- the root model parserrootDeparser
- the root model deparser
-
XmlConfigurationPersister
public XmlConfigurationPersister(File fileName, QName rootElement, org.jboss.staxmapper.XMLElementReader<List<org.jboss.dmr.ModelNode>> rootParser, org.jboss.staxmapper.XMLElementWriter<ModelMarshallingContext> rootDeparser, boolean suppressLoad)
Construct a new instance.- Parameters:
fileName
- the configuration base file namerootElement
- the root element of the configuration filerootParser
- the root model parserrootDeparser
- the root model deparser
-
-
Method Detail
-
registerAdditionalRootElement
public void registerAdditionalRootElement(QName anotherRoot, org.jboss.staxmapper.XMLElementReader<List<org.jboss.dmr.ModelNode>> parser)
-
store
public ConfigurationPersister.PersistenceResource store(org.jboss.dmr.ModelNode model, Set<PathAddress> affectedAddresses) throws ConfigurationPersistenceException
Persist the given configuration model ifConfigurationPersister.isPersisting()
would returntrue
, otherwise return a no-opConfigurationPersister.PersistenceResource
.- Parameters:
model
- the model to persistaffectedAddresses
- the addresses of the resources that were changed- Returns:
- callback to use to control whether the stored model should be flushed to permanent storage. Will not be
null
- Throws:
ConfigurationPersistenceException
-
load
public List<org.jboss.dmr.ModelNode> load() throws ConfigurationPersistenceException
Load the configuration model, returning it as a list of updates to be executed by the controller.- Returns:
- the configuration model as a list of updates to be executed by the controller.
- Throws:
ConfigurationPersistenceException
-
successfulBoot
protected void successfulBoot(File file) throws ConfigurationPersistenceException
-
-