Class AbstractConfigurationPersister
- java.lang.Object
-
- org.jboss.as.controller.persistence.AbstractConfigurationPersister
-
- All Implemented Interfaces:
ConfigurationPersister
,ExtensibleConfigurationPersister
,SubsystemXmlWriterRegistry
- Direct Known Subclasses:
NullConfigurationPersister
,XmlConfigurationPersister
public abstract class AbstractConfigurationPersister extends Object implements ExtensibleConfigurationPersister
Abstract superclass forExtensibleConfigurationPersister
implementations.- Author:
- Brian Stansberry
-
-
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 AbstractConfigurationPersister(org.jboss.staxmapper.XMLElementWriter<ModelMarshallingContext> rootDeparser)
Construct a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deleteSnapshot(String name)
Deletes a snapshot using its name.ConfigurationPersister.SnapshotInfo
listSnapshots()
Gets the names of the snapshots in the snapshots directoryvoid
marshallAsXml(org.jboss.dmr.ModelNode model, OutputStream output)
Marshals the given configuration model to XML, writing to the given stream.void
registerSubsystemWriter(String name, Supplier<org.jboss.staxmapper.XMLElementWriter<SubsystemMarshallingContext>> writer)
Registers the writer that can marshal to XML the configuration of the named subsystem.void
registerSubsystemWriter(String name, org.jboss.staxmapper.XMLElementWriter<SubsystemMarshallingContext> writer)
Registers the writer that can marshal to XML the configuration of the named subsystem.void
successfulBoot()
Called once the xml has been successfully parsed, translated into updates, executed in the target controller and all services have started successfully.void
unregisterSubsystemWriter(String name)
Unregisters the XML configuration writer of the named subsystem.-
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, load, publish, snapshot, snapshot, store
-
-
-
-
Constructor Detail
-
AbstractConfigurationPersister
public AbstractConfigurationPersister(org.jboss.staxmapper.XMLElementWriter<ModelMarshallingContext> rootDeparser)
Construct a new instance.- Parameters:
rootDeparser
- the root model deparser
-
-
Method Detail
-
registerSubsystemWriter
public void registerSubsystemWriter(String name, org.jboss.staxmapper.XMLElementWriter<SubsystemMarshallingContext> writer)
Description copied from interface:SubsystemXmlWriterRegistry
Registers the writer that can marshal to XML the configuration of the named subsystem.- Specified by:
registerSubsystemWriter
in interfaceSubsystemXmlWriterRegistry
- Parameters:
name
- the name of the subsystemwriter
- the XML writer
-
registerSubsystemWriter
public void registerSubsystemWriter(String name, Supplier<org.jboss.staxmapper.XMLElementWriter<SubsystemMarshallingContext>> writer)
Description copied from interface:SubsystemXmlWriterRegistry
Registers the writer that can marshal to XML the configuration of the named subsystem.- Specified by:
registerSubsystemWriter
in interfaceSubsystemXmlWriterRegistry
- Parameters:
name
- the name of the subsystemwriter
- the XML writer
-
unregisterSubsystemWriter
public void unregisterSubsystemWriter(String name)
Description copied from interface:SubsystemXmlWriterRegistry
Unregisters the XML configuration writer of the named subsystem.- Specified by:
unregisterSubsystemWriter
in interfaceSubsystemXmlWriterRegistry
- Parameters:
name
- the name of the subsystem
-
marshallAsXml
public void marshallAsXml(org.jboss.dmr.ModelNode model, OutputStream output) throws ConfigurationPersistenceException
Marshals the given configuration model to XML, writing to the given stream.- Specified by:
marshallAsXml
in interfaceConfigurationPersister
- Parameters:
model
- the model to persistoutput
- the stream- Throws:
ConfigurationPersistenceException
- if a configuration persistence problem occurs
-
successfulBoot
public void successfulBoot() throws ConfigurationPersistenceException
Description copied from interface:ConfigurationPersister
Called once the xml has been successfully parsed, translated into updates, executed in the target controller and all services have started successfully.- Specified by:
successfulBoot
in interfaceConfigurationPersister
- Throws:
ConfigurationPersistenceException
- See Also:
ConfigurationPersister.isPersisting()
-
listSnapshots
public ConfigurationPersister.SnapshotInfo listSnapshots()
Description copied from interface:ConfigurationPersister
Gets the names of the snapshots in the snapshots directory- Specified by:
listSnapshots
in interfaceConfigurationPersister
- Returns:
- the snapshot info. This will never return null
-
deleteSnapshot
public void deleteSnapshot(String name)
Description copied from interface:ConfigurationPersister
Deletes a snapshot using its name.- Specified by:
deleteSnapshot
in interfaceConfigurationPersister
- Parameters:
name
- the name of the snapshot (as returned byConfigurationPersister.SnapshotInfo.names()
returned fromConfigurationPersister.listSnapshots()
. The whole name is not needed, just enough to uniquely identify it.
-
-