Author: markt
Date: Sun Dec 14 18:31:54 2014
New Revision: 1645487
URL: http://svn.apache.org/r1645487
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=57267
Add the following for the manager's save command:
- basic description in Manager Javadoc
- document the StoreConfigLifecycleListener
- add the /save command to the Manager How-To
Modified:
tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java
tomcat/trunk/webapps/docs/config/listeners.xml
tomcat/trunk/webapps/docs/manager-howto.xml
Modified: tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java?rev=1645487&r1=1645486&r2=1645487&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java Sun Dec
14 18:31:54 2014
@@ -123,6 +123,11 @@ import org.apache.tomcat.util.res.String
* typically as a result of being placed there via the <code>/deploy</code>
* command.</li>
* <li><b>/vminfo</b> - Write some VM info.</li>
+ * <li><b>/save</b> - Save the current server configuration to server.xml</li>
+ * <li><b>/save?path=/xxx</b> - Save the context configuration for the web
+ * application deployed with path <code>/xxx</code> to an appropriately
+ * named context.xml file in the <code>xmlBase</code> for the associated
+ * Host.</li>
* </ul>
* <p>Use <code>path=/</code> for the ROOT context.</p>
* <p>The syntax of the URL for a web application archive must conform to one
Modified: tomcat/trunk/webapps/docs/config/listeners.xml
URL:
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/listeners.xml?rev=1645487&r1=1645486&r2=1645487&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/listeners.xml (original)
+++ tomcat/trunk/webapps/docs/config/listeners.xml Sun Dec 14 18:31:54 2014
@@ -315,6 +315,40 @@
</subsection>
+ <subsection name="StoreConfig Lifecycle Listener -
org.apache.catalina.storeconfig.StoreConfigLifecycleListener">
+
+ <p>The <strong>StoreConfig Lifecycle Listener</strong> configures a
+ StoreConfig MBean that may be used to save the current server configuration
+ in server.xml or the current configuration for a web application in a
+ context.xml file.</p>
+
+ <p>This listener must only be nested within <a
href="server.html">Server</a>
+ elements.</p>
+
+ <p>The following additional attributes are supported by the
+ <strong>StoreConfig Lifecycle Listener</strong>:</p>
+
+ <attributes>
+
+ <attribute name="storeConfigClass" required="false">
+ <p>The name of the <code>IStoreConfig</code> implementation to use. If
+ not specified the default of
+ <code>org.apache.catalina.storeconfig.StoreConfig</code> will be
+ used.</p>
+ </attribute>
+
+ <attribute name="storeRegsitry" required="false">
+ <p>The URL of the configuration file that configures how the
+ <code>IStoreConfig</code> is to save the configuration. If not
specified
+ the built in resource
+ <code>/org/apache/catalina/storeconfig/server-registry.xml</code> will
+ be used.</p>
+ </attribute>
+
+ </attributes>
+
+ </subsection>
+
<subsection name="ThreadLocal Leak Prevention Listener -
org.apache.catalina.core.ThreadLocalLeakPreventionListener">
<p>The <strong>ThreadLocal Leak Prevention Listener</strong> triggers the
Modified: tomcat/trunk/webapps/docs/manager-howto.xml
URL:
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/manager-howto.xml?rev=1645487&r1=1645486&r2=1645487&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/manager-howto.xml (original)
+++ tomcat/trunk/webapps/docs/manager-howto.xml Sun Dec 14 18:31:54 2014
@@ -933,6 +933,29 @@ OS information:
</subsection>
+<subsection name="Save Configuration">
+
+<source>http://localhost:8080/manager/text/save</source>
+
+<p>If specified without any parameters, this command saves the current
+configuration of the server to server.xml. The existing file will be renamed as
+a backup if required.</p>
+
+<p>If specified with a <code>path</code> parameter that matches the path of
+a deployed web application then the configuration for that web application will
+be saved to an appropriately named context.xml file in the <code>xmlBase</code>
+for the current Host.</p>
+
+<p>To use the command a StoreConfig MBean must be present. Typically this is
+configured using the <a
+href="config/listeners.html#StoreConfig_Lifecycle_Listener_-_org.apache.catalina.storeconfig.StoreConfigLifecycleListener">StoreConfigLifecycleListener</a>.
+</p>
+
+<p>If the command does not succeed, the response will start with
+<code>FAIL</code> and include an error message.</p>
+
+</subsection>
+
</section>
<section name="Server Status">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]