Skip to content

Commit ffade09

Browse files
committed
Improve docs for StoreConfig Lifecycle Listener
1 parent 90b3026 commit ffade09

File tree

1 file changed

+23
-8
lines changed

1 file changed

+23
-8
lines changed

webapps/docs/config/listeners.xml

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -509,10 +509,23 @@
509509

510510
<subsection name="StoreConfig Lifecycle Listener - org.apache.catalina.storeconfig.StoreConfigLifecycleListener">
511511

512-
<p>The <strong>StoreConfig Lifecycle Listener</strong> configures a
513-
StoreConfig MBean that may be used to save the current server configuration
514-
in server.xml or the current configuration for a web application in a
515-
context.xml file.</p>
512+
<p>The <strong>StoreConfig Lifecycle Listener</strong> enables persisting
513+
runtime configuration changes. When Tomcat's configuration is
514+
modified at runtime, for example, adding or removing a virtual host
515+
through the Host Manager, those changes only exist in memory and are lost
516+
on restart. This listener provides the ability to write the current
517+
in-memory configuration to <code>server.xml</code> (or an individual web
518+
application's <code>context.xml</code>), so that runtime changes are
519+
preserved across restarts.</p>
520+
521+
<p>When this listener is enabled, configuration persistence can be
522+
triggered through the
523+
<a href="../host-manager-howto.html#Persist_command">Host Manager</a> and
524+
<a href="../manager-howto.html#Save_Configuration">Manager</a> applications.
525+
The listener compares the current configuration against
526+
default values and only writes attributes that differ from the defaults.
527+
Before overwriting <code>server.xml</code>, a backup of the existing file
528+
is created.</p>
516529

517530
<p>This listener must only be nested within <a href="server.html">Server</a>
518531
elements.</p>
@@ -523,16 +536,18 @@
523536
<attributes>
524537

525538
<attribute name="storeConfigClass" required="false">
526-
<p>The name of the <code>IStoreConfig</code> implementation to use. If
539+
<p>The name of the <code>IStoreConfig</code> implementation to use.
540+
This is an extension point for custom implementations. If
527541
not specified the default of
528542
<code>org.apache.catalina.storeconfig.StoreConfig</code> will be
529543
used.</p>
530544
</attribute>
531545

532546
<attribute name="storeRegistry" required="false">
533-
<p>The URL of the configuration file that configures how the
534-
<code>IStoreConfig</code> is to save the configuration. If not specified
535-
the built in resource
547+
<p>The URL of the configuration file that defines how each server
548+
component type (connectors, hosts, realms, valves, etc.) should be
549+
serialized to XML. This is an extension point for custom serialization
550+
rules. If not specified the built in resource
536551
<code>/org/apache/catalina/storeconfig/server-registry.xml</code> will
537552
be used.</p>
538553
</attribute>

0 commit comments

Comments
 (0)