You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2024/05/03 07:19:37 UTC
(tomcat) branch main updated (a7f39b0233 -> 942e0148dd)
This is an automated email from the ASF dual-hosted git repository.
markt pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
from a7f39b0233 Improvements to Japanese translations by tak7iji
new 16f3011acb Code clean-up - formatting. No functional change.
new 7151eaa7ec Code clean-up - formatting. No functional change.
new 513da9085a Code clean-up - formatting. No functional change.
new 942e0148dd Code clean-up - formatting - no functional change
The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
java/jakarta/servlet/http/HttpServletRequest.java | 3 +-
.../apache/catalina/ant/AbstractCatalinaTask.java | 58 +++-----
.../catalina/ant/BaseRedirectorHelperTask.java | 89 ++++-------
java/org/apache/catalina/ant/DeployTask.java | 12 +-
java/org/apache/catalina/ant/FindLeaksTask.java | 12 +-
.../apache/catalina/ant/JKStatusUpdateTask.java | 96 +++++-------
java/org/apache/catalina/ant/JMXGetTask.java | 25 ++--
java/org/apache/catalina/ant/JMXQueryTask.java | 19 ++-
java/org/apache/catalina/ant/JMXSetTask.java | 35 +++--
java/org/apache/catalina/ant/ListTask.java | 4 +-
java/org/apache/catalina/ant/ReloadTask.java | 5 +-
java/org/apache/catalina/ant/ResourcesTask.java | 10 +-
java/org/apache/catalina/ant/ServerinfoTask.java | 3 +-
java/org/apache/catalina/ant/SessionsTask.java | 3 +-
.../catalina/ant/SslConnectorCiphersTask.java | 4 +-
java/org/apache/catalina/ant/StartTask.java | 4 +-
java/org/apache/catalina/ant/StopTask.java | 4 +-
java/org/apache/catalina/ant/ThreaddumpTask.java | 4 +-
java/org/apache/catalina/ant/UndeployTask.java | 4 +-
java/org/apache/catalina/ant/ValidatorTask.java | 9 +-
java/org/apache/catalina/ant/VminfoTask.java | 4 +-
.../catalina/authenticator/AuthenticatorBase.java | 3 +-
.../catalina/authenticator/BasicAuthenticator.java | 4 +-
.../authenticator/SpnegoAuthenticator.java | 3 +-
java/org/apache/catalina/connector/Connector.java | 8 +-
.../org/apache/catalina/connector/InputBuffer.java | 4 +-
java/org/apache/catalina/connector/Request.java | 6 +-
java/org/apache/catalina/connector/Response.java | 1 -
.../catalina/core/ApplicationDispatcher.java | 3 +-
.../catalina/core/ApplicationFilterChain.java | 3 +-
.../catalina/core/ApplicationHttpRequest.java | 1 -
.../core/ApplicationSessionCookieConfig.java | 3 +-
.../catalina/core/OpenSSLLifecycleListener.java | 41 +++---
.../core/PropertiesRoleMappingListener.java | 9 +-
java/org/apache/catalina/core/StandardContext.java | 7 +-
.../apache/catalina/core/StandardHostValve.java | 6 +-
java/org/apache/catalina/core/StandardServer.java | 11 +-
.../catalina/filters/CsrfPreventionFilter.java | 107 ++++++--------
java/org/apache/catalina/ha/CatalinaCluster.java | 1 +
java/org/apache/catalina/ha/ClusterManager.java | 7 +-
java/org/apache/catalina/ha/ClusterMessage.java | 2 +
.../apache/catalina/ha/deploy/FarmWarDeployer.java | 4 +-
.../ha/session/ClusterSessionListener.java | 1 +
.../apache/catalina/ha/session/DeltaSession.java | 2 +
.../catalina/ha/session/SessionMessageImpl.java | 1 +
.../apache/catalina/ha/tcp/ReplicationValve.java | 10 +-
.../apache/catalina/manager/StatusTransformer.java | 70 +++++----
java/org/apache/catalina/mbeans/MBeanUtils.java | 5 +-
java/org/apache/catalina/realm/CombinedRealm.java | 3 +-
java/org/apache/catalina/realm/RealmBase.java | 19 ++-
.../apache/catalina/security/SecurityListener.java | 19 +--
.../apache/catalina/session/DataSourceStore.java | 6 +-
.../startup/CatalinaBaseConfigurationSource.java | 3 +-
java/org/apache/catalina/startup/Tomcat.java | 9 +-
.../catalina/storeconfig/CatalinaClusterSF.java | 12 +-
.../storeconfig/CertificateStoreAppender.java | 5 +-
.../org/apache/catalina/storeconfig/ChannelSF.java | 7 +-
.../apache/catalina/storeconfig/ConnectorSF.java | 17 +--
.../storeconfig/ConnectorStoreAppender.java | 84 +++++------
.../catalina/storeconfig/CredentialHandlerSF.java | 20 +--
.../storeconfig/GlobalNamingResourcesSF.java | 17 +--
.../apache/catalina/storeconfig/IStoreConfig.java | 51 +++----
.../apache/catalina/storeconfig/IStoreFactory.java | 11 +-
.../apache/catalina/storeconfig/InterceptorSF.java | 22 ++-
.../apache/catalina/storeconfig/JarScannerSF.java | 8 +-
java/org/apache/catalina/storeconfig/LoaderSF.java | 24 ++-
.../org/apache/catalina/storeconfig/ManagerSF.java | 26 ++--
.../catalina/storeconfig/NamingResourcesSF.java | 11 +-
.../apache/catalina/storeconfig/OpenSSLConfSF.java | 5 +-
.../catalina/storeconfig/PersistentManagerSF.java | 5 +-
java/org/apache/catalina/storeconfig/RealmSF.java | 26 ++--
.../catalina/storeconfig/SSLHostConfigSF.java | 8 +-
java/org/apache/catalina/storeconfig/SenderSF.java | 7 +-
.../catalina/storeconfig/StandardContextSF.java | 117 +++++++--------
.../catalina/storeconfig/StandardEngineSF.java | 11 +-
.../catalina/storeconfig/StandardHostSF.java | 15 +-
.../catalina/storeconfig/StandardServerSF.java | 22 ++-
.../catalina/storeconfig/StandardServiceSF.java | 5 +-
.../apache/catalina/storeconfig/StoreAppender.java | 164 ++++++++++-----------
.../apache/catalina/storeconfig/StoreConfig.java | 76 ++++------
.../storeconfig/StoreConfigLifecycleListener.java | 29 ++--
.../catalina/storeconfig/StoreContextAppender.java | 78 +++++-----
.../catalina/storeconfig/StoreDescription.java | 46 ++----
.../catalina/storeconfig/StoreFactoryBase.java | 72 ++++-----
.../catalina/storeconfig/StoreFactoryRule.java | 46 +++---
.../catalina/storeconfig/StoreFileMover.java | 26 ++--
.../apache/catalina/storeconfig/StoreLoader.java | 62 +++-----
.../apache/catalina/storeconfig/StoreRegistry.java | 31 ++--
.../catalina/storeconfig/WatchedResourceSF.java | 13 +-
.../catalina/storeconfig/WebResourceRootSF.java | 29 ++--
.../catalina/storeconfig/WrapperLifecycleSF.java | 13 +-
.../catalina/storeconfig/WrapperListenerSF.java | 16 +-
92 files changed, 908 insertions(+), 1118 deletions(-)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
(tomcat) 03/04: Code clean-up - formatting. No functional change.
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 513da9085a12b8c51764033f80249b99d736ed9a
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Fri May 3 08:11:25 2024 +0100
Code clean-up - formatting. No functional change.
---
.../apache/catalina/ant/AbstractCatalinaTask.java | 58 ++++++-------
.../catalina/ant/BaseRedirectorHelperTask.java | 89 ++++++++------------
java/org/apache/catalina/ant/DeployTask.java | 12 ++-
java/org/apache/catalina/ant/FindLeaksTask.java | 12 +--
.../apache/catalina/ant/JKStatusUpdateTask.java | 96 ++++++++--------------
java/org/apache/catalina/ant/JMXGetTask.java | 25 +++---
java/org/apache/catalina/ant/JMXQueryTask.java | 19 +++--
java/org/apache/catalina/ant/JMXSetTask.java | 35 ++++----
java/org/apache/catalina/ant/ListTask.java | 4 +-
java/org/apache/catalina/ant/ReloadTask.java | 5 +-
java/org/apache/catalina/ant/ResourcesTask.java | 10 +--
java/org/apache/catalina/ant/ServerinfoTask.java | 3 +-
java/org/apache/catalina/ant/SessionsTask.java | 3 +-
.../catalina/ant/SslConnectorCiphersTask.java | 4 +-
java/org/apache/catalina/ant/StartTask.java | 4 +-
java/org/apache/catalina/ant/StopTask.java | 4 +-
java/org/apache/catalina/ant/ThreaddumpTask.java | 4 +-
java/org/apache/catalina/ant/UndeployTask.java | 4 +-
java/org/apache/catalina/ant/ValidatorTask.java | 9 +-
java/org/apache/catalina/ant/VminfoTask.java | 4 +-
20 files changed, 167 insertions(+), 237 deletions(-)
diff --git a/java/org/apache/catalina/ant/AbstractCatalinaTask.java b/java/org/apache/catalina/ant/AbstractCatalinaTask.java
index 61ac76e5e5..02a0d2bdc2 100644
--- a/java/org/apache/catalina/ant/AbstractCatalinaTask.java
+++ b/java/org/apache/catalina/ant/AbstractCatalinaTask.java
@@ -32,11 +32,11 @@ import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
/**
- * Abstract base class for Ant tasks that interact with the <em>Manager</em> web
- * application for dynamically deploying and undeploying applications. These
- * tasks require Ant 1.4 or later.
+ * Abstract base class for Ant tasks that interact with the <em>Manager</em> web application for dynamically deploying
+ * and undeploying applications. These tasks require Ant 1.4 or later.
*
* @author Craig R. McClanahan
+ *
* @since 4.1
*/
public abstract class AbstractCatalinaTask extends BaseRedirectorHelperTask {
@@ -107,16 +107,14 @@ public abstract class AbstractCatalinaTask extends BaseRedirectorHelperTask {
}
/**
- * If set to true - ignore the constraint of the first line of the response
- * message that must be "OK -".
+ * If set to true - ignore the constraint of the first line of the response message that must be "OK -".
* <p>
- * When this attribute is set to {@code false} (the default), the first line
- * of server response is expected to start with "OK -". If it does not then
- * the task is considered as failed and the first line is treated as an
- * error message.
+ * When this attribute is set to {@code false} (the default), the first line of server response is expected to start
+ * with "OK -". If it does not then the task is considered as failed and the first line is treated as an error
+ * message.
* <p>
- * When this attribute is set to {@code true}, the first line of the
- * response is treated like any other, regardless of its text.
+ * When this attribute is set to {@code true}, the first line of the response is treated like any other, regardless
+ * of its text.
*/
protected boolean ignoreResponseConstraint = false;
@@ -132,9 +130,8 @@ public abstract class AbstractCatalinaTask extends BaseRedirectorHelperTask {
// --------------------------------------------------------- Public Methods
/**
- * Execute the specified command. This logic only performs the common
- * attribute validation required by all subclasses; it does not perform any
- * functional logic directly.
+ * Execute the specified command. This logic only performs the common attribute validation required by all
+ * subclasses; it does not perform any functional logic directly.
*
* @exception BuildException if a validation error occurs
*/
@@ -159,19 +156,18 @@ public abstract class AbstractCatalinaTask extends BaseRedirectorHelperTask {
/**
- * Execute the specified command, based on the configured properties. The
- * input stream will be closed upon completion of this task, whether it was
- * executed successfully or not.
+ * Execute the specified command, based on the configured properties. The input stream will be closed upon
+ * completion of this task, whether it was executed successfully or not.
*
- * @param command Command to be executed
- * @param istream InputStream to include in an HTTP PUT, if any
- * @param contentType Content type to specify for the input, if any
+ * @param command Command to be executed
+ * @param istream InputStream to include in an HTTP PUT, if any
+ * @param contentType Content type to specify for the input, if any
* @param contentLength Content length to specify for the input, if any
*
* @exception BuildException if an error occurs
*/
public void execute(String command, InputStream istream, String contentType, long contentLength)
- throws BuildException {
+ throws BuildException {
URLConnection conn = null;
InputStreamReader reader = null;
@@ -289,19 +285,13 @@ public abstract class AbstractCatalinaTask extends BaseRedirectorHelperTask {
/*
- * This is a hack.
- * We need to use streaming to avoid OOME on large uploads.
- * We'd like to use Authenticator.setDefault() for authentication as the JRE
- * then provides the DIGEST client implementation.
- * However, the above two are not compatible. When the request is made, the
- * resulting 401 triggers an exception because, when using streams, the
- * InputStream is no longer available to send with the repeated request that
- * now includes the appropriate Authorization header.
- * The hack is to make a simple OPTIONS request- i.e. without a request
- * body.
- * This triggers authentication and the requirement to authenticate for this
- * host is cached and used to provide an appropriate Authorization when the
- * next request is made (that includes a request body).
+ * This is a hack. We need to use streaming to avoid OOME on large uploads. We'd like to use
+ * Authenticator.setDefault() for authentication as the JRE then provides the DIGEST client implementation. However,
+ * the above two are not compatible. When the request is made, the resulting 401 triggers an exception because, when
+ * using streams, the InputStream is no longer available to send with the repeated request that now includes the
+ * appropriate Authorization header. The hack is to make a simple OPTIONS request- i.e. without a request body.This
+ * triggers authentication and the requirement to authenticate for this host is cached and used to provide an
+ * appropriate Authorization when the next request is made (that includes a request body).
*/
private void preAuthenticate() throws IOException, URISyntaxException {
URLConnection conn = null;
diff --git a/java/org/apache/catalina/ant/BaseRedirectorHelperTask.java b/java/org/apache/catalina/ant/BaseRedirectorHelperTask.java
index 7e4d7c3892..0316faad45 100644
--- a/java/org/apache/catalina/ant/BaseRedirectorHelperTask.java
+++ b/java/org/apache/catalina/ant/BaseRedirectorHelperTask.java
@@ -28,20 +28,16 @@ import org.apache.tools.ant.taskdefs.Redirector;
import org.apache.tools.ant.types.RedirectorElement;
/**
- * Abstract base class to add output redirection support for Catalina Ant tasks.
- * These tasks require Ant 1.5 or later.
+ * Abstract base class to add output redirection support for Catalina Ant tasks. These tasks require Ant 1.5 or later.
* <br>
- * <strong>WARNING:</strong> due to depends chain, Ant could call a Task more
- * than once and this can affect the output redirection when configured. If you
- * are collecting the output in a property, it will collect the output of only
- * the first run, since Ant properties are immutable and once created they
- * cannot be changed. <br>
- * If you are collecting output in a file the file will be overwritten with the
- * output of the last run, unless you set append="true", in which case each run
- * will append it's output to the file.
- *
+ * <strong>WARNING:</strong> due to depends chain, Ant could call a Task more than once and this can affect the output
+ * redirection when configured. If you are collecting the output in a property, it will collect the output of only the
+ * first run, since Ant properties are immutable and once created they cannot be changed. <br>
+ * If you are collecting output in a file the file will be overwritten with the output of the last run, unless you set
+ * append="true", in which case each run will append it's output to the file.
*
* @author Gabriele Garuglieri
+ *
* @since 5.5
*/
public abstract class BaseRedirectorHelperTask extends Task {
@@ -65,37 +61,31 @@ public abstract class BaseRedirectorHelperTask extends Task {
PrintStream redirectErrPrintStream = null;
/**
- * Whether to fail (with a BuildException) if ManagerServlet returns an
- * error. The default behavior is to do so. <b> This flag does not control
- * parameters checking. If the task is called with wrong or invalid
- * parameters, it will throw BuildException independently from the setting
- * of this flag. </b>
+ * Whether to fail (with a BuildException) if ManagerServlet returns an error. The default behavior is to do so. <b>
+ * This flag does not control parameters checking. If the task is called with wrong or invalid parameters, it will
+ * throw BuildException independently from the setting of this flag. </b>
*/
protected boolean failOnError = true;
/**
- * <code>true</code> true when output redirection is requested for this task.
- * Default is to log on Ant log.
+ * <code>true</code> true when output redirection is requested for this task. Default is to log on Ant log.
*/
protected boolean redirectOutput = false;
/**
- * will be set to <code>true</code> when the configuration of the Redirector
- * is complete.
+ * will be set to <code>true</code> when the configuration of the Redirector is complete.
*/
protected boolean redirectorConfigured = false;
/**
- * Flag which indicates that, if redirected, output should also be always
- * sent to the log. Default is that output is sent only to redirected
- * streams.
+ * Flag which indicates that, if redirected, output should also be always sent to the log. Default is that output is
+ * sent only to redirected streams.
*/
protected boolean alwaysLog = false;
/**
- * Whether to fail (with a BuildException) if ManagerServlet returns an
- * error. The default behavior is to do so.
+ * Whether to fail (with a BuildException) if ManagerServlet returns an error. The default behavior is to do so.
*
* @param fail The new value of failonerror
*/
@@ -107,8 +97,7 @@ public abstract class BaseRedirectorHelperTask extends Task {
/**
* Returns the value of the failOnError property.
*
- * @return <code>true</code> if the task should will if an error occurs,
- * otherwise <code>false</code>
+ * @return <code>true</code> if the task should will if an error occurs, otherwise <code>false</code>
*/
public boolean isFailOnError() {
return failOnError;
@@ -130,7 +119,6 @@ public abstract class BaseRedirectorHelperTask extends Task {
* File the error output of the task is redirected to.
*
* @param error name of the error file
- *
*/
public void setError(File error) {
redirector.setError(error);
@@ -139,11 +127,10 @@ public abstract class BaseRedirectorHelperTask extends Task {
/**
- * Controls whether error output is logged. This is only useful when output
- * is being redirected and error output is desired in the Ant log
+ * Controls whether error output is logged. This is only useful when output is being redirected and error output is
+ * desired in the Ant log
*
- * @param logError if true the standard error is sent to the Ant log system
- * and not sent to output stream.
+ * @param logError if true the standard error is sent to the Ant log system and not sent to output stream.
*/
public void setLogError(boolean logError) {
redirector.setLogError(logError);
@@ -155,7 +142,6 @@ public abstract class BaseRedirectorHelperTask extends Task {
* Property name whose value should be set to the output of the task.
*
* @param outputProperty property name
- *
*/
public void setOutputproperty(String outputProperty) {
redirector.setOutputProperty(outputProperty);
@@ -167,7 +153,6 @@ public abstract class BaseRedirectorHelperTask extends Task {
* Property name whose value should be set to the error of the task.
*
* @param errorProperty property name
- *
*/
public void setErrorProperty(String errorProperty) {
redirector.setErrorProperty(errorProperty);
@@ -179,7 +164,6 @@ public abstract class BaseRedirectorHelperTask extends Task {
* If true, append output to existing file.
*
* @param append if true, append output to existing file
- *
*/
public void setAppend(boolean append) {
redirector.setAppend(append);
@@ -188,12 +172,9 @@ public abstract class BaseRedirectorHelperTask extends Task {
/**
- * If true, (error and non-error) output will be redirected as specified
- * while being sent to Ant's logging mechanism as if no redirection had
- * taken place. Defaults to false.
- * <br>
- * Actually handled internally, with Ant 1.6.3 it will be handled by the
- * <code>Redirector</code> itself.
+ * If true, (error and non-error) output will be redirected as specified while being sent to Ant's logging mechanism
+ * as if no redirection had taken place. Defaults to false. <br>
+ * Actually handled internally, with Ant 1.6.3 it will be handled by the <code>Redirector</code> itself.
*
* @param alwaysLog <code>boolean</code>
*/
@@ -204,8 +185,7 @@ public abstract class BaseRedirectorHelperTask extends Task {
/**
- * Whether output and error files should be created even when empty.
- * Defaults to true.
+ * Whether output and error files should be created even when empty. Defaults to true.
*
* @param createEmptyFiles <CODE>boolean</CODE>.
*/
@@ -238,9 +218,8 @@ public abstract class BaseRedirectorHelperTask extends Task {
redirectOutput = true;
}
/*
- * Due to depends chain, Ant could call the Task more than once, this is
- * to prevent that we attempt to configure uselessly more than once the
- * Redirector.
+ * Due to depends chain, Ant could call the Task more than once, this is to prevent that we attempt to configure
+ * uselessly more than once the Redirector.
*/
redirectorConfigured = true;
}
@@ -264,10 +243,9 @@ public abstract class BaseRedirectorHelperTask extends Task {
/**
- * Ask redirector to close all the streams. It is necessary to call this
- * method before leaving the Task to have the Streams flush their contents.
- * If you are collecting output in a property, it will be created only if
- * this method is called, otherwise you'll find it unset.
+ * Ask redirector to close all the streams. It is necessary to call this method before leaving the Task to have the
+ * Streams flush their contents. If you are collecting output in a property, it will be created only if this method
+ * is called, otherwise you'll find it unset.
*/
protected void closeRedirector() {
try {
@@ -278,8 +256,8 @@ public abstract class BaseRedirectorHelperTask extends Task {
log("Error closing redirector: " + ioe.getMessage(), Project.MSG_ERR);
}
/*
- * Due to depends chain, Ant could call the Task more than once, this is
- * to prevent that we attempt to reuse the previously closed Streams.
+ * Due to depends chain, Ant could call the Task more than once, this is to prevent that we attempt to reuse the
+ * previously closed Streams.
*/
redirectOutStream = null;
redirectOutPrintStream = null;
@@ -313,7 +291,6 @@ public abstract class BaseRedirectorHelperTask extends Task {
* Handles output with the INFO priority and flushes the stream.
*
* @param output The output to log. Should not be <code>null</code>.
- *
*/
@Override
protected void handleFlush(String output) {
@@ -347,7 +324,6 @@ public abstract class BaseRedirectorHelperTask extends Task {
* Handles error output with the ERR priority and flushes the stream.
*
* @param output The error output to log. Should not be <code>null</code>.
- *
*/
@Override
protected void handleErrorFlush(String output) {
@@ -357,10 +333,9 @@ public abstract class BaseRedirectorHelperTask extends Task {
/**
- * Handles output with ERR priority to error stream and all other priorities
- * to output stream.
+ * Handles output with ERR priority to error stream and all other priorities to output stream.
*
- * @param output The output to log. Should not be <code>null</code>.
+ * @param output The output to log. Should not be <code>null</code>.
* @param priority The priority level that should be used
*/
protected void handleOutput(String output, int priority) {
diff --git a/java/org/apache/catalina/ant/DeployTask.java b/java/org/apache/catalina/ant/DeployTask.java
index bf4bc673e9..2ae8650fc6 100644
--- a/java/org/apache/catalina/ant/DeployTask.java
+++ b/java/org/apache/catalina/ant/DeployTask.java
@@ -30,10 +30,10 @@ import java.util.regex.Pattern;
import org.apache.tools.ant.BuildException;
/**
- * Ant task that implements the <code>/deploy</code> command, supported by the
- * Tomcat manager application.
+ * Ant task that implements the <code>/deploy</code> command, supported by the Tomcat manager application.
*
* @author Craig R. McClanahan
+ *
* @since 4.1
*/
public class DeployTask extends AbstractCatalinaCommandTask {
@@ -55,8 +55,7 @@ public class DeployTask extends AbstractCatalinaCommandTask {
/**
- * URL of the server local web application archive (WAR) file to be
- * deployed.
+ * URL of the server local web application archive (WAR) file to be deployed.
*/
protected String localWar = null;
@@ -123,8 +122,7 @@ public class DeployTask extends AbstractCatalinaCommandTask {
throw new BuildException("Must specify 'path' attribute");
}
if ((war == null) && (localWar == null) && (config == null) && (tag == null)) {
- throw new BuildException(
- "Must specify either 'war', 'localWar', 'config', or 'tag' attribute");
+ throw new BuildException("Must specify either 'war', 'localWar', 'config', or 'tag' attribute");
}
// Building an input stream on the WAR to upload, if any
BufferedInputStream stream = null;
@@ -141,7 +139,7 @@ public class DeployTask extends AbstractCatalinaCommandTask {
throw new BuildException(e);
}
} else {
- FileInputStream fsInput= null;
+ FileInputStream fsInput = null;
try {
fsInput = new FileInputStream(war);
FileChannel fsChannel = fsInput.getChannel();
diff --git a/java/org/apache/catalina/ant/FindLeaksTask.java b/java/org/apache/catalina/ant/FindLeaksTask.java
index 4be09969a8..3eb44df7d3 100644
--- a/java/org/apache/catalina/ant/FindLeaksTask.java
+++ b/java/org/apache/catalina/ant/FindLeaksTask.java
@@ -19,16 +19,14 @@ package org.apache.catalina.ant;
import org.apache.tools.ant.BuildException;
/**
- * Ant task that implements the <code>/findleaks</code> command, supported by
- * the Tomcat manager application.
+ * Ant task that implements the <code>/findleaks</code> command, supported by the Tomcat manager application.
*/
public class FindLeaksTask extends AbstractCatalinaTask {
private boolean statusLine = true;
/**
- * Sets the statusLine parameter that controls if the response includes a
- * status line or not.
+ * Sets the statusLine parameter that controls if the response includes a status line or not.
*
* @param statusLine <code>true</code> if the status line should be included
*/
@@ -37,11 +35,9 @@ public class FindLeaksTask extends AbstractCatalinaTask {
}
/**
- * Returns the statusLine parameter that controls if the response includes a
- * status line or not.
+ * Returns the statusLine parameter that controls if the response includes a status line or not.
*
- * @return <code>true</code> if the status line should be included,
- * otherwise <code>false</code>
+ * @return <code>true</code> if the status line should be included, otherwise <code>false</code>
*/
public boolean getStatusLine() {
return statusLine;
diff --git a/java/org/apache/catalina/ant/JKStatusUpdateTask.java b/java/org/apache/catalina/ant/JKStatusUpdateTask.java
index 4f322b74f7..b24f02110a 100644
--- a/java/org/apache/catalina/ant/JKStatusUpdateTask.java
+++ b/java/org/apache/catalina/ant/JKStatusUpdateTask.java
@@ -22,10 +22,10 @@ import java.net.URLEncoder;
import org.apache.tools.ant.BuildException;
/**
- * Ant task that implements the <code>/status</code> command, supported by the
- * mod_jk status (1.2.9) application.
+ * Ant task that implements the <code>/status</code> command, supported by the mod_jk status (1.2.9) application.
*
* @author Peter Rossbach
+ *
* @since 5.5.9
*/
public class JKStatusUpdateTask extends AbstractCatalinaTask {
@@ -74,8 +74,7 @@ public class JKStatusUpdateTask extends AbstractCatalinaTask {
}
/**
- * @param internalid
- * The internalid to set.
+ * @param internalid The internalid to set.
*/
public void setInternalid(int internalid) {
this.internalid = internalid;
@@ -89,8 +88,7 @@ public class JKStatusUpdateTask extends AbstractCatalinaTask {
}
/**
- * @param lbForceSession
- * The lbForceSession to set.
+ * @param lbForceSession The lbForceSession to set.
*/
public void setLbForceSession(Boolean lbForceSession) {
this.lbForceSession = lbForceSession;
@@ -104,8 +102,7 @@ public class JKStatusUpdateTask extends AbstractCatalinaTask {
}
/**
- * @param lbRecovertime
- * The lbRecovertime to set.
+ * @param lbRecovertime The lbRecovertime to set.
*/
public void setLbRecovertime(Integer lbRecovertime) {
this.lbRecovertime = lbRecovertime;
@@ -119,8 +116,7 @@ public class JKStatusUpdateTask extends AbstractCatalinaTask {
}
/**
- * @param lbRetries
- * The lbRetries to set.
+ * @param lbRetries The lbRetries to set.
*/
public void setLbRetries(Integer lbRetries) {
this.lbRetries = lbRetries;
@@ -134,8 +130,7 @@ public class JKStatusUpdateTask extends AbstractCatalinaTask {
}
/**
- * @param lbStickySession
- * The lbStickySession to set.
+ * @param lbStickySession The lbStickySession to set.
*/
public void setLbStickySession(Boolean lbStickySession) {
this.lbStickySession = lbStickySession;
@@ -149,8 +144,7 @@ public class JKStatusUpdateTask extends AbstractCatalinaTask {
}
/**
- * @param worker
- * The worker to set.
+ * @param worker The worker to set.
*/
public void setWorker(String worker) {
this.worker = worker;
@@ -164,8 +158,7 @@ public class JKStatusUpdateTask extends AbstractCatalinaTask {
}
/**
- * @param workerType
- * The workerType to set.
+ * @param workerType The workerType to set.
*/
public void setWorkerType(String workerType) {
this.workerType = workerType;
@@ -179,8 +172,7 @@ public class JKStatusUpdateTask extends AbstractCatalinaTask {
}
/**
- * @param workerLb
- * The workerLb to set.
+ * @param workerLb The workerLb to set.
*/
public void setWorkerLb(String workerLb) {
this.workerLb = workerLb;
@@ -194,8 +186,7 @@ public class JKStatusUpdateTask extends AbstractCatalinaTask {
}
/**
- * @param workerClusterDomain
- * The workerClusterDomain to set.
+ * @param workerClusterDomain The workerClusterDomain to set.
*/
public void setWorkerClusterDomain(String workerClusterDomain) {
this.workerClusterDomain = workerClusterDomain;
@@ -209,8 +200,7 @@ public class JKStatusUpdateTask extends AbstractCatalinaTask {
}
/**
- * @param workerDisabled
- * The workerDisabled to set.
+ * @param workerDisabled The workerDisabled to set.
*/
public void setWorkerDisabled(Boolean workerDisabled) {
this.workerDisabled = workerDisabled;
@@ -238,8 +228,7 @@ public class JKStatusUpdateTask extends AbstractCatalinaTask {
}
/**
- * @param workerLoadFactor
- * The workerLoadFactor to set.
+ * @param workerLoadFactor The workerLoadFactor to set.
*/
public void setWorkerLoadFactor(Integer workerLoadFactor) {
this.workerLoadFactor = workerLoadFactor;
@@ -253,8 +242,7 @@ public class JKStatusUpdateTask extends AbstractCatalinaTask {
}
/**
- * @param workerRedirect
- * The workerRedirect to set.
+ * @param workerRedirect The workerRedirect to set.
*/
public void setWorkerRedirect(String workerRedirect) {
this.workerRedirect = workerRedirect;
@@ -263,8 +251,7 @@ public class JKStatusUpdateTask extends AbstractCatalinaTask {
/**
* Execute the requested operation.
*
- * @exception BuildException
- * if an error occurs
+ * @exception BuildException if an error occurs
*/
@Override
public void execute() throws BuildException {
@@ -279,11 +266,8 @@ public class JKStatusUpdateTask extends AbstractCatalinaTask {
/**
* Create JkStatus link
* <ul>
- * <li><b>load balance example:
- * </b>http://localhost/status?cmd=update&mime=txt&w=lb&lf=false&ls=true</li>
- * <li><b>worker example:
- * </b>http://localhost/status?cmd=update&mime=txt&w=node1&l=lb&wf=1&wd=false&ws=false
- * </li>
+ * <li><b>load balance example: </b>http://localhost/status?cmd=update&mime=txt&w=lb&lf=false&ls=true</li>
+ * <li><b>worker example: </b>http://localhost/status?cmd=update&mime=txt&w=node1&l=lb&wf=1&wd=false&ws=false</li>
* </ul>
*
* @return create jkstatus link
@@ -297,7 +281,7 @@ public class JKStatusUpdateTask extends AbstractCatalinaTask {
sb.append(URLEncoder.encode(worker, getCharset()));
if (isLBMode) {
- //http://localhost/status?cmd=update&mime=txt&w=lb&lf=false&ls=true
+ // http://localhost/status?cmd=update&mime=txt&w=lb&lf=false&ls=true
if ((lbRetries != null)) { // > 0
sb.append("&lr=");
sb.append(lbRetries);
@@ -315,7 +299,7 @@ public class JKStatusUpdateTask extends AbstractCatalinaTask {
sb.append(lbForceSession);
}
} else {
- //http://localhost/status?cmd=update&mime=txt&w=node1&l=lb&wf=1&wd=false&ws=false
+ // http://localhost/status?cmd=update&mime=txt&w=node1&l=lb&wf=1&wd=false&ws=false
if ((workerLb != null)) { // must be configured
sb.append("&l=");
sb.append(URLEncoder.encode(workerLb, getCharset()));
@@ -337,14 +321,12 @@ public class JKStatusUpdateTask extends AbstractCatalinaTask {
}
if ((workerClusterDomain != null)) {
sb.append("&wc=");
- sb.append(URLEncoder.encode(workerClusterDomain,
- getCharset()));
+ sb.append(URLEncoder.encode(workerClusterDomain, getCharset()));
}
}
} catch (UnsupportedEncodingException e) {
- throw new BuildException("Invalid 'charset' attribute: "
- + getCharset());
+ throw new BuildException("Invalid 'charset' attribute: " + getCharset());
}
return sb;
}
@@ -362,54 +344,44 @@ public class JKStatusUpdateTask extends AbstractCatalinaTask {
if ("lb".equals(workerType)) {
if (lbRecovertime == null && lbRetries == null) {
throw new BuildException(
- "Must specify at a lb worker either 'lbRecovertime' or"
- + "'lbRetries' attribute");
+ "Must specify at a lb worker either 'lbRecovertime' or" + "'lbRetries' attribute");
}
if (lbStickySession == null || lbForceSession == null) {
- throw new BuildException("Must specify at a lb worker either"
- + "'lbStickySession' and 'lbForceSession' attribute");
+ throw new BuildException(
+ "Must specify at a lb worker either" + "'lbStickySession' and 'lbForceSession' attribute");
}
if (null != lbRecovertime && 60 < lbRecovertime.intValue()) {
- throw new BuildException(
- "The 'lbRecovertime' must be greater than 59");
+ throw new BuildException("The 'lbRecovertime' must be greater than 59");
}
if (null != lbRetries && 1 < lbRetries.intValue()) {
- throw new BuildException(
- "The 'lbRetries' must be greater than 1");
+ throw new BuildException("The 'lbRetries' must be greater than 1");
}
isLBMode = true;
} else if ("worker".equals(workerType)) {
if (workerDisabled == null) {
- throw new BuildException(
- "Must specify at a node worker 'workerDisabled' attribute");
+ throw new BuildException("Must specify at a node worker 'workerDisabled' attribute");
}
if (workerStopped == null) {
- throw new BuildException(
- "Must specify at a node worker 'workerStopped' attribute");
+ throw new BuildException("Must specify at a node worker 'workerStopped' attribute");
}
- if (workerLoadFactor == null ) {
- throw new BuildException(
- "Must specify at a node worker 'workerLoadFactor' attribute");
+ if (workerLoadFactor == null) {
+ throw new BuildException("Must specify at a node worker 'workerLoadFactor' attribute");
}
if (workerClusterDomain == null) {
- throw new BuildException(
- "Must specify at a node worker 'workerClusterDomain' attribute");
+ throw new BuildException("Must specify at a node worker 'workerClusterDomain' attribute");
}
if (workerRedirect == null) {
- throw new BuildException(
- "Must specify at a node worker 'workerRedirect' attribute");
+ throw new BuildException("Must specify at a node worker 'workerRedirect' attribute");
}
if (workerLb == null) {
throw new BuildException("Must specify 'workerLb' attribute");
}
if (workerLoadFactor.intValue() < 1) {
- throw new BuildException(
- "The 'workerLoadFactor' must be greater or equal 1");
+ throw new BuildException("The 'workerLoadFactor' must be greater or equal 1");
}
isLBMode = false;
} else {
- throw new BuildException(
- "Only 'lb' and 'worker' supported as workerType attribute");
+ throw new BuildException("Only 'lb' and 'worker' supported as workerType attribute");
}
}
}
\ No newline at end of file
diff --git a/java/org/apache/catalina/ant/JMXGetTask.java b/java/org/apache/catalina/ant/JMXGetTask.java
index fd0ba47ff4..b9d1c488b1 100644
--- a/java/org/apache/catalina/ant/JMXGetTask.java
+++ b/java/org/apache/catalina/ant/JMXGetTask.java
@@ -24,8 +24,8 @@ import org.apache.tools.ant.BuildException;
/**
- * Ant task that implements the JMX Get command (<code>/jmxproxy/?get</code>)
- * supported by the Tomcat manager application.
+ * Ant task that implements the JMX Get command (<code>/jmxproxy/?get</code>) supported by the Tomcat manager
+ * application.
*
* @author Peter Rossbach
*/
@@ -36,7 +36,7 @@ public class JMXGetTask extends AbstractCatalinaTask {
/**
* The full bean name
*/
- protected String bean = null;
+ protected String bean = null;
/**
* The attribute you wish to alter
@@ -47,33 +47,37 @@ public class JMXGetTask extends AbstractCatalinaTask {
/**
* Get method for the bean name
+ *
* @return Bean name
*/
- public String getBean () {
+ public String getBean() {
return this.bean;
}
/**
* Set method for the bean name
+ *
* @param bean Bean name
*/
- public void setBean (String bean) {
+ public void setBean(String bean) {
this.bean = bean;
}
/**
* Get method for the attribute name
+ *
* @return Attribute name
*/
- public String getAttribute () {
+ public String getAttribute() {
return this.attribute;
}
/**
* Set method for the attribute name
+ *
* @param attribute Attribute name
*/
- public void setAttribute (String attribute) {
+ public void setAttribute(String attribute) {
this.attribute = attribute;
}
@@ -88,11 +92,10 @@ public class JMXGetTask extends AbstractCatalinaTask {
if (bean == null || attribute == null) {
throw new BuildException("Must specify 'bean' and 'attribute' attributes");
}
- log("Getting attribute " + attribute +
- " in bean " + bean );
+ log("Getting attribute " + attribute + " in bean " + bean);
try {
- execute("/jmxproxy/?get=" + URLEncoder.encode(bean, getCharset())
- + "&att=" + URLEncoder.encode(attribute, getCharset()));
+ execute("/jmxproxy/?get=" + URLEncoder.encode(bean, getCharset()) + "&att=" +
+ URLEncoder.encode(attribute, getCharset()));
} catch (UnsupportedEncodingException e) {
throw new BuildException("Invalid 'charset' attribute: " + getCharset());
}
diff --git a/java/org/apache/catalina/ant/JMXQueryTask.java b/java/org/apache/catalina/ant/JMXQueryTask.java
index d239efb98e..26565d9b97 100644
--- a/java/org/apache/catalina/ant/JMXQueryTask.java
+++ b/java/org/apache/catalina/ant/JMXQueryTask.java
@@ -24,8 +24,8 @@ import org.apache.tools.ant.BuildException;
/**
- * Ant task that implements the JMX Query command
- * (<code>/jmxproxy/?qry</code>) supported by the Tomcat manager application.
+ * Ant task that implements the JMX Query command (<code>/jmxproxy/?qry</code>) supported by the Tomcat manager
+ * application.
*
* @author Vivek Chopra
*/
@@ -35,32 +35,37 @@ public class JMXQueryTask extends AbstractCatalinaTask {
/**
* The JMX query string
+ *
* @see #setQuery(String)
*/
- protected String query = null;
+ protected String query = null;
// Public Methods
/**
* Get method for the JMX query string
+ *
* @return Query string
*/
- public String getQuery () {
+ public String getQuery() {
return this.query;
}
/**
* Set method for the JMX query string.
- * <p>Examples of query format:</p>
+ * <p>
+ * Examples of query format:
+ * </p>
* <UL>
* <LI>*:*</LI>
* <LI>*:type=RequestProcessor,*</LI>
* <LI>*:j2eeType=Servlet,*</LI>
* <LI>Catalina:type=Environment,resourcetype=Global,name=simpleValue</LI>
* </UL>
+ *
* @param query JMX Query string
*/
- public void setQuery (String query) {
+ public void setQuery(String query) {
this.query = query;
}
@@ -83,6 +88,6 @@ public class JMXQueryTask extends AbstractCatalinaTask {
}
}
log("Query string is " + queryString);
- execute ("/jmxproxy/" + queryString);
+ execute("/jmxproxy/" + queryString);
}
}
diff --git a/java/org/apache/catalina/ant/JMXSetTask.java b/java/org/apache/catalina/ant/JMXSetTask.java
index 547669aef7..3e2573829b 100644
--- a/java/org/apache/catalina/ant/JMXSetTask.java
+++ b/java/org/apache/catalina/ant/JMXSetTask.java
@@ -24,8 +24,8 @@ import org.apache.tools.ant.BuildException;
/**
- * Ant task that implements the JMX Set command (<code>/jmxproxy/?set</code>)
- * supported by the Tomcat manager application.
+ * Ant task that implements the JMX Set command (<code>/jmxproxy/?set</code>) supported by the Tomcat manager
+ * application.
*
* @author Vivek Chopra
*/
@@ -36,7 +36,7 @@ public class JMXSetTask extends AbstractCatalinaTask {
/**
* The full bean name
*/
- protected String bean = null;
+ protected String bean = null;
/**
* The attribute you wish to alter
@@ -46,55 +46,61 @@ public class JMXSetTask extends AbstractCatalinaTask {
/**
* The new value for the attribute
*/
- protected String value = null;
+ protected String value = null;
// Public Methods
/**
* Get method for the bean name
+ *
* @return Bean name
*/
- public String getBean () {
+ public String getBean() {
return this.bean;
}
/**
* Set method for the bean name
+ *
* @param bean Bean name
*/
- public void setBean (String bean) {
+ public void setBean(String bean) {
this.bean = bean;
}
/**
* Get method for the attribute name
+ *
* @return Attribute name
*/
- public String getAttribute () {
+ public String getAttribute() {
return this.attribute;
}
/**
* Set method for the attribute name
+ *
* @param attribute Attribute name
*/
- public void setAttribute (String attribute) {
+ public void setAttribute(String attribute) {
this.attribute = attribute;
}
/**
* Get method for the attribute value
+ *
* @return Attribute value
*/
- public String getValue () {
+ public String getValue() {
return this.value;
}
/**
* Set method for the attribute value.
+ *
* @param value Attribute value
*/
- public void setValue (String value) {
+ public void setValue(String value) {
this.value = value;
}
@@ -109,13 +115,10 @@ public class JMXSetTask extends AbstractCatalinaTask {
if (bean == null || attribute == null || value == null) {
throw new BuildException("Must specify 'bean', 'attribute' and 'value' attributes");
}
- log("Setting attribute " + attribute +
- " in bean " + bean +
- " to " + value);
+ log("Setting attribute " + attribute + " in bean " + bean + " to " + value);
try {
- execute("/jmxproxy/?set=" + URLEncoder.encode(bean, getCharset())
- + "&att=" + URLEncoder.encode(attribute, getCharset())
- + "&val=" + URLEncoder.encode(value, getCharset()));
+ execute("/jmxproxy/?set=" + URLEncoder.encode(bean, getCharset()) + "&att=" +
+ URLEncoder.encode(attribute, getCharset()) + "&val=" + URLEncoder.encode(value, getCharset()));
} catch (UnsupportedEncodingException e) {
throw new BuildException("Invalid 'charset' attribute: " + getCharset());
}
diff --git a/java/org/apache/catalina/ant/ListTask.java b/java/org/apache/catalina/ant/ListTask.java
index eeab9cd84f..378f04fcf9 100644
--- a/java/org/apache/catalina/ant/ListTask.java
+++ b/java/org/apache/catalina/ant/ListTask.java
@@ -21,10 +21,10 @@ import org.apache.tools.ant.BuildException;
/**
- * Ant task that implements the <code>/list</code> command, supported by the
- * Tomcat manager application.
+ * Ant task that implements the <code>/list</code> command, supported by the Tomcat manager application.
*
* @author Craig R. McClanahan
+ *
* @since 4.1
*/
public class ListTask extends AbstractCatalinaTask {
diff --git a/java/org/apache/catalina/ant/ReloadTask.java b/java/org/apache/catalina/ant/ReloadTask.java
index 4497c6ab3a..23b824da0d 100644
--- a/java/org/apache/catalina/ant/ReloadTask.java
+++ b/java/org/apache/catalina/ant/ReloadTask.java
@@ -17,15 +17,14 @@
package org.apache.catalina.ant;
-
import org.apache.tools.ant.BuildException;
/**
- * Ant task that implements the <code>/reload</code> command, supported by the
- * Tomcat manager application.
+ * Ant task that implements the <code>/reload</code> command, supported by the Tomcat manager application.
*
* @author Craig R. McClanahan
+ *
* @since 4.1
*/
public class ReloadTask extends AbstractCatalinaCommandTask {
diff --git a/java/org/apache/catalina/ant/ResourcesTask.java b/java/org/apache/catalina/ant/ResourcesTask.java
index b8b6c46be6..88dfa5c3a4 100644
--- a/java/org/apache/catalina/ant/ResourcesTask.java
+++ b/java/org/apache/catalina/ant/ResourcesTask.java
@@ -24,10 +24,10 @@ import org.apache.tools.ant.BuildException;
/**
- * Ant task that implements the <code>/resources</code> command, supported by
- * the Tomcat manager application.
+ * Ant task that implements the <code>/resources</code> command, supported by the Tomcat manager application.
*
* @author Craig R. McClanahan
+ *
* @since 4.1
*/
public class ResourcesTask extends AbstractCatalinaTask {
@@ -37,8 +37,7 @@ public class ResourcesTask extends AbstractCatalinaTask {
/**
- * The fully qualified class name of the resource type being requested
- * (if any).
+ * The fully qualified class name of the resource type being requested (if any).
*/
protected String type = null;
@@ -65,8 +64,7 @@ public class ResourcesTask extends AbstractCatalinaTask {
super.execute();
if (type != null) {
try {
- execute("/resources?type=" +
- URLEncoder.encode(type, getCharset()));
+ execute("/resources?type=" + URLEncoder.encode(type, getCharset()));
} catch (UnsupportedEncodingException e) {
throw new BuildException("Invalid 'charset' attribute: " + getCharset());
}
diff --git a/java/org/apache/catalina/ant/ServerinfoTask.java b/java/org/apache/catalina/ant/ServerinfoTask.java
index f8c2cedc9b..d15ac86cb2 100644
--- a/java/org/apache/catalina/ant/ServerinfoTask.java
+++ b/java/org/apache/catalina/ant/ServerinfoTask.java
@@ -21,8 +21,7 @@ import org.apache.tools.ant.BuildException;
/**
- * Ant task that implements the <code>/serverinfo</code> command
- * supported by the Tomcat manager application.
+ * Ant task that implements the <code>/serverinfo</code> command supported by the Tomcat manager application.
*
* @author Vivek Chopra
*/
diff --git a/java/org/apache/catalina/ant/SessionsTask.java b/java/org/apache/catalina/ant/SessionsTask.java
index 3649ceb75b..78f3ce5ece 100644
--- a/java/org/apache/catalina/ant/SessionsTask.java
+++ b/java/org/apache/catalina/ant/SessionsTask.java
@@ -21,8 +21,7 @@ import org.apache.tools.ant.BuildException;
/**
- * Ant task that implements the <code>/sessions</code> command
- * supported by the Tomcat manager application.
+ * Ant task that implements the <code>/sessions</code> command supported by the Tomcat manager application.
*
* @author Vivek Chopra
*/
diff --git a/java/org/apache/catalina/ant/SslConnectorCiphersTask.java b/java/org/apache/catalina/ant/SslConnectorCiphersTask.java
index 45826a85df..2a96fcffab 100644
--- a/java/org/apache/catalina/ant/SslConnectorCiphersTask.java
+++ b/java/org/apache/catalina/ant/SslConnectorCiphersTask.java
@@ -21,9 +21,7 @@ import org.apache.tools.ant.BuildException;
/**
- * Ant task that implements the <code>/sslConnectorCiphers</code> command
- * supported by the Tomcat manager application.
- *
+ * Ant task that implements the <code>/sslConnectorCiphers</code> command supported by the Tomcat manager application.
*/
public class SslConnectorCiphersTask extends AbstractCatalinaTask {
diff --git a/java/org/apache/catalina/ant/StartTask.java b/java/org/apache/catalina/ant/StartTask.java
index 5eb3c464f8..cbf68f1065 100644
--- a/java/org/apache/catalina/ant/StartTask.java
+++ b/java/org/apache/catalina/ant/StartTask.java
@@ -21,10 +21,10 @@ import org.apache.tools.ant.BuildException;
/**
- * Ant task that implements the <code>/start</code> command, supported by the
- * Tomcat manager application.
+ * Ant task that implements the <code>/start</code> command, supported by the Tomcat manager application.
*
* @author Craig R. McClanahan
+ *
* @since 4.1
*/
public class StartTask extends AbstractCatalinaCommandTask {
diff --git a/java/org/apache/catalina/ant/StopTask.java b/java/org/apache/catalina/ant/StopTask.java
index 0ce063303b..c0cf0c49dc 100644
--- a/java/org/apache/catalina/ant/StopTask.java
+++ b/java/org/apache/catalina/ant/StopTask.java
@@ -21,10 +21,10 @@ import org.apache.tools.ant.BuildException;
/**
- * Ant task that implements the <code>/stop</code> command, supported by the
- * Tomcat manager application.
+ * Ant task that implements the <code>/stop</code> command, supported by the Tomcat manager application.
*
* @author Craig R. McClanahan
+ *
* @since 4.1
*/
public class StopTask extends AbstractCatalinaCommandTask {
diff --git a/java/org/apache/catalina/ant/ThreaddumpTask.java b/java/org/apache/catalina/ant/ThreaddumpTask.java
index 007da3367f..cef554fefe 100644
--- a/java/org/apache/catalina/ant/ThreaddumpTask.java
+++ b/java/org/apache/catalina/ant/ThreaddumpTask.java
@@ -21,9 +21,7 @@ import org.apache.tools.ant.BuildException;
/**
- * Ant task that implements the <code>/threaddump</code> command
- * supported by the Tomcat manager application.
- *
+ * Ant task that implements the <code>/threaddump</code> command supported by the Tomcat manager application.
*/
public class ThreaddumpTask extends AbstractCatalinaTask {
diff --git a/java/org/apache/catalina/ant/UndeployTask.java b/java/org/apache/catalina/ant/UndeployTask.java
index 15e8991c49..fd44b0a71f 100644
--- a/java/org/apache/catalina/ant/UndeployTask.java
+++ b/java/org/apache/catalina/ant/UndeployTask.java
@@ -21,10 +21,10 @@ import org.apache.tools.ant.BuildException;
/**
- * Ant task that implements the <code>/undeploy</code> command, supported by
- * the Tomcat manager application.
+ * Ant task that implements the <code>/undeploy</code> command, supported by the Tomcat manager application.
*
* @author Craig R. McClanahan
+ *
* @since 4.1
*/
public class UndeployTask extends AbstractCatalinaCommandTask {
diff --git a/java/org/apache/catalina/ant/ValidatorTask.java b/java/org/apache/catalina/ant/ValidatorTask.java
index 3ce62b60f5..72b85324d1 100644
--- a/java/org/apache/catalina/ant/ValidatorTask.java
+++ b/java/org/apache/catalina/ant/ValidatorTask.java
@@ -29,10 +29,10 @@ import org.xml.sax.InputSource;
/**
- * Task for validating a web application deployment descriptor, using XML
- * schema validation.
+ * Task for validating a web application deployment descriptor, using XML schema validation.
*
* @author Remy Maucherat
+ *
* @since 5.0
*/
public class ValidatorTask extends BaseRedirectorHelperTask {
@@ -61,9 +61,8 @@ public class ValidatorTask extends BaseRedirectorHelperTask {
// --------------------------------------------------------- Public Methods
/**
- * Execute the specified command. This logic only performs the common
- * attribute validation required by all subclasses; it does not perform
- * any functional logic directly.
+ * Execute the specified command. This logic only performs the common attribute validation required by all
+ * subclasses; it does not perform any functional logic directly.
*
* @exception BuildException if a validation error occurs
*/
diff --git a/java/org/apache/catalina/ant/VminfoTask.java b/java/org/apache/catalina/ant/VminfoTask.java
index 52394cca26..6fccbc9e90 100644
--- a/java/org/apache/catalina/ant/VminfoTask.java
+++ b/java/org/apache/catalina/ant/VminfoTask.java
@@ -21,9 +21,7 @@ import org.apache.tools.ant.BuildException;
/**
- * Ant task that implements the <code>/vminfo</code> command
- * supported by the Tomcat manager application.
- *
+ * Ant task that implements the <code>/vminfo</code> command supported by the Tomcat manager application.
*/
public class VminfoTask extends AbstractCatalinaTask {
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
(tomcat) 02/04: Code clean-up - formatting. No functional change.
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 7151eaa7ec1c2e43a9fd88de006765c911b0ea0e
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Fri May 3 08:06:47 2024 +0100
Code clean-up - formatting. No functional change.
---
java/jakarta/servlet/http/HttpServletRequest.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/java/jakarta/servlet/http/HttpServletRequest.java b/java/jakarta/servlet/http/HttpServletRequest.java
index 8e36a97ccd..277bc32fbc 100644
--- a/java/jakarta/servlet/http/HttpServletRequest.java
+++ b/java/jakarta/servlet/http/HttpServletRequest.java
@@ -511,8 +511,7 @@ public interface HttpServletRequest extends ServletRequest {
*
* @since Servlet 3.1
*/
- <T extends HttpUpgradeHandler> T upgrade(Class<T> httpUpgradeHandlerClass)
- throws IOException, ServletException;
+ <T extends HttpUpgradeHandler> T upgrade(Class<T> httpUpgradeHandlerClass) throws IOException, ServletException;
/**
* Obtain a Map of the trailer fields that is not backed by the request object.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
(tomcat) 01/04: Code clean-up - formatting. No functional change.
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 16f3011acbeb32c7a1ec33384fe89b8580f1edce
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Fri May 3 08:02:22 2024 +0100
Code clean-up - formatting. No functional change.
---
.../catalina/storeconfig/CatalinaClusterSF.java | 12 +-
.../storeconfig/CertificateStoreAppender.java | 5 +-
.../org/apache/catalina/storeconfig/ChannelSF.java | 7 +-
.../apache/catalina/storeconfig/ConnectorSF.java | 17 +--
.../storeconfig/ConnectorStoreAppender.java | 84 +++++------
.../catalina/storeconfig/CredentialHandlerSF.java | 20 +--
.../storeconfig/GlobalNamingResourcesSF.java | 17 +--
.../apache/catalina/storeconfig/IStoreConfig.java | 51 +++----
.../apache/catalina/storeconfig/IStoreFactory.java | 11 +-
.../apache/catalina/storeconfig/InterceptorSF.java | 22 ++-
.../apache/catalina/storeconfig/JarScannerSF.java | 8 +-
java/org/apache/catalina/storeconfig/LoaderSF.java | 24 ++-
.../org/apache/catalina/storeconfig/ManagerSF.java | 26 ++--
.../catalina/storeconfig/NamingResourcesSF.java | 11 +-
.../apache/catalina/storeconfig/OpenSSLConfSF.java | 5 +-
.../catalina/storeconfig/PersistentManagerSF.java | 5 +-
java/org/apache/catalina/storeconfig/RealmSF.java | 26 ++--
.../catalina/storeconfig/SSLHostConfigSF.java | 8 +-
java/org/apache/catalina/storeconfig/SenderSF.java | 7 +-
.../catalina/storeconfig/StandardContextSF.java | 117 +++++++--------
.../catalina/storeconfig/StandardEngineSF.java | 11 +-
.../catalina/storeconfig/StandardHostSF.java | 15 +-
.../catalina/storeconfig/StandardServerSF.java | 22 ++-
.../catalina/storeconfig/StandardServiceSF.java | 5 +-
.../apache/catalina/storeconfig/StoreAppender.java | 164 ++++++++++-----------
.../apache/catalina/storeconfig/StoreConfig.java | 76 ++++------
.../storeconfig/StoreConfigLifecycleListener.java | 29 ++--
.../catalina/storeconfig/StoreContextAppender.java | 78 +++++-----
.../catalina/storeconfig/StoreDescription.java | 46 ++----
.../catalina/storeconfig/StoreFactoryBase.java | 72 ++++-----
.../catalina/storeconfig/StoreFactoryRule.java | 46 +++---
.../catalina/storeconfig/StoreFileMover.java | 26 ++--
.../apache/catalina/storeconfig/StoreLoader.java | 62 +++-----
.../apache/catalina/storeconfig/StoreRegistry.java | 31 ++--
.../catalina/storeconfig/WatchedResourceSF.java | 13 +-
.../catalina/storeconfig/WebResourceRootSF.java | 29 ++--
.../catalina/storeconfig/WrapperLifecycleSF.java | 13 +-
.../catalina/storeconfig/WrapperListenerSF.java | 16 +-
38 files changed, 544 insertions(+), 693 deletions(-)
diff --git a/java/org/apache/catalina/storeconfig/CatalinaClusterSF.java b/java/org/apache/catalina/storeconfig/CatalinaClusterSF.java
index ce1ef29eff..498eba23c3 100644
--- a/java/org/apache/catalina/storeconfig/CatalinaClusterSF.java
+++ b/java/org/apache/catalina/storeconfig/CatalinaClusterSF.java
@@ -30,18 +30,18 @@ import org.apache.catalina.ha.tcp.SimpleTcpCluster;
import org.apache.catalina.tribes.Channel;
/**
- * Generate Cluster Element with Membership,Sender,Receiver,Deployer and
- * ReplicationValve
+ * Generate Cluster Element with Membership,Sender,Receiver,Deployer and ReplicationValve
*/
public class CatalinaClusterSF extends StoreFactoryBase {
/**
* Store the specified Cluster children.
+ * <p>
* {@inheritDoc}
*/
@Override
- public void storeChildren(PrintWriter aWriter, int indent, Object aCluster,
- StoreDescription parentDesc) throws Exception {
+ public void storeChildren(PrintWriter aWriter, int indent, Object aCluster, StoreDescription parentDesc)
+ throws Exception {
if (aCluster instanceof CatalinaCluster) {
CatalinaCluster cluster = (CatalinaCluster) aCluster;
if (cluster instanceof SimpleTcpCluster) {
@@ -69,10 +69,10 @@ public class CatalinaClusterSF extends StoreFactoryBase {
if (aCluster instanceof SimpleTcpCluster) {
// Store nested <Listener> elements
- LifecycleListener listeners[] = ((SimpleTcpCluster)cluster).findLifecycleListeners();
+ LifecycleListener listeners[] = ((SimpleTcpCluster) cluster).findLifecycleListeners();
storeElementArray(aWriter, indent, listeners);
// Store nested <ClusterListener> elements
- ClusterListener mlisteners[] = ((SimpleTcpCluster)cluster).findClusterListeners();
+ ClusterListener mlisteners[] = ((SimpleTcpCluster) cluster).findClusterListeners();
List<ClusterListener> clusterListeners = new ArrayList<>();
for (ClusterListener clusterListener : mlisteners) {
if (clusterListener != deployer) {
diff --git a/java/org/apache/catalina/storeconfig/CertificateStoreAppender.java b/java/org/apache/catalina/storeconfig/CertificateStoreAppender.java
index 50bc71716f..9a5c235029 100644
--- a/java/org/apache/catalina/storeconfig/CertificateStoreAppender.java
+++ b/java/org/apache/catalina/storeconfig/CertificateStoreAppender.java
@@ -26,9 +26,8 @@ import org.apache.tomcat.util.IntrospectionUtils;
public class CertificateStoreAppender extends StoreAppender {
@Override
- protected Object checkAttribute(StoreDescription desc,
- PropertyDescriptor descriptor, String attributeName, Object bean,
- Object bean2) {
+ protected Object checkAttribute(StoreDescription desc, PropertyDescriptor descriptor, String attributeName,
+ Object bean, Object bean2) {
if (attributeName.equals("type")) {
return IntrospectionUtils.getProperty(bean, descriptor.getName());
} else {
diff --git a/java/org/apache/catalina/storeconfig/ChannelSF.java b/java/org/apache/catalina/storeconfig/ChannelSF.java
index f511337d6d..f1395c1cfa 100644
--- a/java/org/apache/catalina/storeconfig/ChannelSF.java
+++ b/java/org/apache/catalina/storeconfig/ChannelSF.java
@@ -33,11 +33,12 @@ public class ChannelSF extends StoreFactoryBase {
/**
* Store the specified Channel children.
+ * <p>
* {@inheritDoc}
*/
@Override
- public void storeChildren(PrintWriter aWriter, int indent, Object aChannel,
- StoreDescription parentDesc) throws Exception {
+ public void storeChildren(PrintWriter aWriter, int indent, Object aChannel, StoreDescription parentDesc)
+ throws Exception {
if (aChannel instanceof Channel) {
Channel channel = (Channel) aChannel;
if (channel instanceof ManagedChannel) {
@@ -63,6 +64,6 @@ public class ChannelSF extends StoreFactoryBase {
storeElement(aWriter, indent, interceptor);
}
}
- }
+ }
}
}
\ No newline at end of file
diff --git a/java/org/apache/catalina/storeconfig/ConnectorSF.java b/java/org/apache/catalina/storeconfig/ConnectorSF.java
index eb7b337dc5..1a223149a1 100644
--- a/java/org/apache/catalina/storeconfig/ConnectorSF.java
+++ b/java/org/apache/catalina/storeconfig/ConnectorSF.java
@@ -29,8 +29,8 @@ import org.apache.tomcat.util.net.SSLHostConfig;
public class ConnectorSF extends StoreFactoryBase {
@Override
- public void storeChildren(PrintWriter aWriter, int indent, Object aConnector,
- StoreDescription parentDesc) throws Exception {
+ public void storeChildren(PrintWriter aWriter, int indent, Object aConnector, StoreDescription parentDesc)
+ throws Exception {
if (aConnector instanceof Connector) {
Connector connector = (Connector) aConnector;
@@ -48,24 +48,21 @@ public class ConnectorSF extends StoreFactoryBase {
}
}
- protected void printOpenTag(PrintWriter aWriter, int indent, Object bean,
- StoreDescription aDesc) throws Exception {
+ protected void printOpenTag(PrintWriter aWriter, int indent, Object bean, StoreDescription aDesc) throws Exception {
aWriter.print("<");
aWriter.print(aDesc.getTag());
storeConnectorAttributes(aWriter, indent, bean, aDesc);
aWriter.println(">");
}
- protected void storeConnectorAttributes(PrintWriter aWriter, int indent,
- Object bean, StoreDescription aDesc) throws Exception {
+ protected void storeConnectorAttributes(PrintWriter aWriter, int indent, Object bean, StoreDescription aDesc)
+ throws Exception {
if (aDesc.isAttributes()) {
- getStoreAppender().printAttributes(aWriter, indent, false, bean,
- aDesc);
+ getStoreAppender().printAttributes(aWriter, indent, false, bean, aDesc);
}
}
- protected void printTag(PrintWriter aWriter, int indent, Object bean,
- StoreDescription aDesc) throws Exception {
+ protected void printTag(PrintWriter aWriter, int indent, Object bean, StoreDescription aDesc) throws Exception {
aWriter.print("<");
aWriter.print(aDesc.getTag());
storeConnectorAttributes(aWriter, indent, bean, aDesc);
diff --git a/java/org/apache/catalina/storeconfig/ConnectorStoreAppender.java b/java/org/apache/catalina/storeconfig/ConnectorStoreAppender.java
index 686844d2e0..e108729705 100644
--- a/java/org/apache/catalina/storeconfig/ConnectorStoreAppender.java
+++ b/java/org/apache/catalina/storeconfig/ConnectorStoreAppender.java
@@ -36,14 +36,13 @@ import org.apache.tomcat.util.IntrospectionUtils;
import org.apache.tomcat.util.net.SocketProperties;
/**
- * Store the Connector attributes. Connector has really special design. A
- * Connector is only a startup Wrapper for a ProtocolHandler. This meant that
- * ProtocolHandler get all there attributes from the Connector attribute map.
- * Strange is that some attributes change their name.
+ * Store the Connector attributes. Connector has really special design. A Connector is only a startup Wrapper for a
+ * ProtocolHandler. This meant that ProtocolHandler get all there attributes from the Connector attribute map. Strange
+ * is that some attributes change their name.
*/
public class ConnectorStoreAppender extends StoreAppender {
- protected static final HashMap<String, String> replacements = new HashMap<>();
+ protected static final HashMap<String,String> replacements = new HashMap<>();
protected static final Set<String> internalExecutorAttributes = new HashSet<>();
static {
replacements.put("timeout", "connectionUploadTimeout");
@@ -55,8 +54,7 @@ public class ConnectorStoreAppender extends StoreAppender {
}
@Override
- public void printAttributes(PrintWriter writer, int indent,
- boolean include, Object bean, StoreDescription desc)
+ public void printAttributes(PrintWriter writer, int indent, boolean include, Object bean, StoreDescription desc)
throws Exception {
// Render a className attribute if requested
@@ -70,7 +68,7 @@ public class ConnectorStoreAppender extends StoreAppender {
String protocol = connector.getProtocol();
List<String> propertyKeys = getPropertyKeys(connector);
// Create blank instance
- Object bean2 = new Connector(protocol);//defaultInstance(bean);
+ Object bean2 = new Connector(protocol);// defaultInstance(bean);
for (String key : propertyKeys) {
Object value = IntrospectionUtils.getProperty(bean, key);
if (desc.isTransientAttribute(key)) {
@@ -105,17 +103,17 @@ public class ConnectorStoreAppender extends StoreAppender {
* Get all properties from Connector and current ProtocolHandler.
*
* @param bean The connector
+ *
* @return List of Connector property names
+ *
* @throws IntrospectionException Error introspecting connector
*/
- protected List<String> getPropertyKeys(Connector bean)
- throws IntrospectionException {
+ protected List<String> getPropertyKeys(Connector bean) throws IntrospectionException {
List<String> propertyKeys = new ArrayList<>();
// Acquire the list of properties for this bean
ProtocolHandler protocolHandler = bean.getProtocolHandler();
// Acquire the list of properties for this bean
- PropertyDescriptor descriptors[] = Introspector.getBeanInfo(
- bean.getClass()).getPropertyDescriptors();
+ PropertyDescriptor descriptors[] = Introspector.getBeanInfo(bean.getClass()).getPropertyDescriptors();
if (descriptors == null) {
descriptors = new PropertyDescriptor[0];
}
@@ -123,21 +121,17 @@ public class ConnectorStoreAppender extends StoreAppender {
if (descriptor instanceof IndexedPropertyDescriptor) {
continue; // Indexed properties are not persisted
}
- if (!isPersistable(descriptor.getPropertyType())
- || (descriptor.getReadMethod() == null)
- || (descriptor.getWriteMethod() == null)) {
+ if (!isPersistable(descriptor.getPropertyType()) || (descriptor.getReadMethod() == null) ||
+ (descriptor.getWriteMethod() == null)) {
continue; // Must be a read-write primitive or String
}
- if ("protocol".equals(descriptor.getName())
- || "protocolHandlerClassName".equals(descriptor
- .getName())) {
+ if ("protocol".equals(descriptor.getName()) || "protocolHandlerClassName".equals(descriptor.getName())) {
continue;
}
propertyKeys.add(descriptor.getName());
}
// Add the properties of the protocol handler
- descriptors = Introspector.getBeanInfo(
- protocolHandler.getClass()).getPropertyDescriptors();
+ descriptors = Introspector.getBeanInfo(protocolHandler.getClass()).getPropertyDescriptors();
if (descriptors == null) {
descriptors = new PropertyDescriptor[0];
}
@@ -145,9 +139,8 @@ public class ConnectorStoreAppender extends StoreAppender {
if (descriptor instanceof IndexedPropertyDescriptor) {
continue; // Indexed properties are not persisted
}
- if (!isPersistable(descriptor.getPropertyType())
- || (descriptor.getReadMethod() == null)
- || (descriptor.getWriteMethod() == null)) {
+ if (!isPersistable(descriptor.getPropertyType()) || (descriptor.getReadMethod() == null) ||
+ (descriptor.getWriteMethod() == null)) {
continue; // Must be a read-write primitive or String
}
String key = descriptor.getName();
@@ -164,8 +157,7 @@ public class ConnectorStoreAppender extends StoreAppender {
}
// Add the properties for the socket
final String socketName = "socket.";
- descriptors = Introspector.getBeanInfo(
- SocketProperties.class).getPropertyDescriptors();
+ descriptors = Introspector.getBeanInfo(SocketProperties.class).getPropertyDescriptors();
if (descriptors == null) {
descriptors = new PropertyDescriptor[0];
}
@@ -173,9 +165,8 @@ public class ConnectorStoreAppender extends StoreAppender {
if (descriptor instanceof IndexedPropertyDescriptor) {
continue; // Indexed properties are not persisted
}
- if (!isPersistable(descriptor.getPropertyType())
- || (descriptor.getReadMethod() == null)
- || (descriptor.getWriteMethod() == null)) {
+ if (!isPersistable(descriptor.getPropertyType()) || (descriptor.getReadMethod() == null) ||
+ (descriptor.getWriteMethod() == null)) {
continue; // Must be a read-write primitive or String
}
String key = descriptor.getName();
@@ -195,21 +186,21 @@ public class ConnectorStoreAppender extends StoreAppender {
* Print Attributes for the connector
*
* @param aWriter Current writer
- * @param indent Indentation level
- * @param bean The connector bean
- * @param aDesc The connector description
+ * @param indent Indentation level
+ * @param bean The connector bean
+ * @param aDesc The connector description
+ *
* @throws Exception Store error occurred
*/
- protected void storeConnectorAttributes(PrintWriter aWriter, int indent,
- Object bean, StoreDescription aDesc) throws Exception {
+ protected void storeConnectorAttributes(PrintWriter aWriter, int indent, Object bean, StoreDescription aDesc)
+ throws Exception {
if (aDesc.isAttributes()) {
printAttributes(aWriter, indent, false, bean, aDesc);
}
}
@Override
- public void printOpenTag(PrintWriter aWriter, int indent, Object bean,
- StoreDescription aDesc) throws Exception {
+ public void printOpenTag(PrintWriter aWriter, int indent, Object bean, StoreDescription aDesc) throws Exception {
aWriter.print("<");
aWriter.print(aDesc.getTag());
storeConnectorAttributes(aWriter, indent, bean, aDesc);
@@ -217,8 +208,7 @@ public class ConnectorStoreAppender extends StoreAppender {
}
@Override
- public void printTag(PrintWriter aWriter, int indent, Object bean,
- StoreDescription aDesc) throws Exception {
+ public void printTag(PrintWriter aWriter, int indent, Object bean, StoreDescription aDesc) throws Exception {
aWriter.print("<");
aWriter.print(aDesc.getTag());
storeConnectorAttributes(aWriter, indent, bean, aDesc);
@@ -226,8 +216,7 @@ public class ConnectorStoreAppender extends StoreAppender {
}
@Override
- public void printValue(PrintWriter writer, int indent, String name,
- Object value) {
+ public void printValue(PrintWriter writer, int indent, String name, Object value) {
String repl = name;
if (replacements.get(name) != null) {
repl = replacements.get(name);
@@ -236,22 +225,23 @@ public class ConnectorStoreAppender extends StoreAppender {
}
/**
- * Print Connector Values. <ul><li> Special handling to default jkHome.
- * </li><li> Don't save catalina.base path at server.xml</li><li></ul>
+ * Print Connector Values.
+ * <ul>
+ * <li>Special handling to default jkHome.</li>
+ * <li>Don't save catalina.base path at server.xml</li>
+ * <li>
+ * </ul>
*
- * @see org.apache.catalina.storeconfig.StoreAppender#isPrintValue(Object,
- * Object, String, StoreDescription)
+ * @see org.apache.catalina.storeconfig.StoreAppender#isPrintValue(Object, Object, String, StoreDescription)
*/
@Override
- public boolean isPrintValue(Object bean, Object bean2, String attrName,
- StoreDescription desc) {
+ public boolean isPrintValue(Object bean, Object bean2, String attrName, StoreDescription desc) {
boolean isPrint = super.isPrintValue(bean, bean2, attrName, desc);
if (isPrint) {
if ("jkHome".equals(attrName)) {
Connector connector = (Connector) bean;
File catalinaBase = getCatalinaBase();
- File jkHomeBase = getJkHomeBase((String) connector
- .getProperty("jkHome"), catalinaBase);
+ File jkHomeBase = getJkHomeBase((String) connector.getProperty("jkHome"), catalinaBase);
isPrint = !catalinaBase.equals(jkHomeBase);
}
diff --git a/java/org/apache/catalina/storeconfig/CredentialHandlerSF.java b/java/org/apache/catalina/storeconfig/CredentialHandlerSF.java
index 8685b72c5e..852e0eafaf 100644
--- a/java/org/apache/catalina/storeconfig/CredentialHandlerSF.java
+++ b/java/org/apache/catalina/storeconfig/CredentialHandlerSF.java
@@ -31,27 +31,22 @@ public class CredentialHandlerSF extends StoreFactoryBase {
private static Log log = LogFactory.getLog(CredentialHandlerSF.class);
@Override
- public void store(PrintWriter aWriter, int indent, Object aElement)
- throws Exception {
+ public void store(PrintWriter aWriter, int indent, Object aElement) throws Exception {
if (aElement instanceof NestedCredentialHandler) {
- StoreDescription elementDesc = getRegistry().findDescription(
- aElement.getClass());
+ StoreDescription elementDesc = getRegistry().findDescription(aElement.getClass());
if (elementDesc != null) {
if (log.isTraceEnabled()) {
- log.trace(sm.getString("factory.storeTag",
- elementDesc.getTag(), aElement));
+ log.trace(sm.getString("factory.storeTag", elementDesc.getTag(), aElement));
}
getStoreAppender().printIndent(aWriter, indent + 2);
- getStoreAppender().printOpenTag(aWriter, indent + 2, aElement,
- elementDesc);
+ getStoreAppender().printOpenTag(aWriter, indent + 2, aElement, elementDesc);
storeChildren(aWriter, indent + 2, aElement, elementDesc);
getStoreAppender().printIndent(aWriter, indent + 2);
getStoreAppender().printCloseTag(aWriter, elementDesc);
} else {
if (log.isWarnEnabled()) {
- log.warn(sm.getString("factory.storeNoDescriptor",
- aElement.getClass()));
+ log.warn(sm.getString("factory.storeNoDescriptor", aElement.getClass()));
}
}
} else {
@@ -61,11 +56,12 @@ public class CredentialHandlerSF extends StoreFactoryBase {
/**
* Store the specified CredentialHandler properties and child (CredentialHandler)
+ * <p>
* {@inheritDoc}
*/
@Override
- public void storeChildren(PrintWriter aWriter, int indent, Object aCredentialHandler,
- StoreDescription parentDesc) throws Exception {
+ public void storeChildren(PrintWriter aWriter, int indent, Object aCredentialHandler, StoreDescription parentDesc)
+ throws Exception {
if (aCredentialHandler instanceof NestedCredentialHandler) {
NestedCredentialHandler nestedCredentialHandler = (NestedCredentialHandler) aCredentialHandler;
diff --git a/java/org/apache/catalina/storeconfig/GlobalNamingResourcesSF.java b/java/org/apache/catalina/storeconfig/GlobalNamingResourcesSF.java
index 1a7ca97245..25ac3bd73b 100644
--- a/java/org/apache/catalina/storeconfig/GlobalNamingResourcesSF.java
+++ b/java/org/apache/catalina/storeconfig/GlobalNamingResourcesSF.java
@@ -29,25 +29,20 @@ public class GlobalNamingResourcesSF extends StoreFactoryBase {
private static Log log = LogFactory.getLog(GlobalNamingResourcesSF.class);
@Override
- public void store(PrintWriter aWriter, int indent, Object aElement)
- throws Exception {
+ public void store(PrintWriter aWriter, int indent, Object aElement) throws Exception {
if (aElement instanceof NamingResourcesImpl) {
- StoreDescription elementDesc = getRegistry().findDescription(
- NamingResourcesImpl.class.getName()
- + ".[GlobalNamingResources]");
+ StoreDescription elementDesc =
+ getRegistry().findDescription(NamingResourcesImpl.class.getName() + ".[GlobalNamingResources]");
if (elementDesc != null) {
getStoreAppender().printIndent(aWriter, indent + 2);
- getStoreAppender().printOpenTag(aWriter, indent + 2, aElement,
- elementDesc);
+ getStoreAppender().printOpenTag(aWriter, indent + 2, aElement, elementDesc);
NamingResourcesImpl resources = (NamingResourcesImpl) aElement;
- StoreDescription resourcesdesc = getRegistry().findDescription(
- NamingResourcesImpl.class.getName());
+ StoreDescription resourcesdesc = getRegistry().findDescription(NamingResourcesImpl.class.getName());
if (resourcesdesc != null) {
- resourcesdesc.getStoreFactory().store(aWriter, indent + 2,
- resources);
+ resourcesdesc.getStoreFactory().store(aWriter, indent + 2, resources);
} else {
log.warn(sm.getString("globalNamingResourcesSF.noFactory"));
}
diff --git a/java/org/apache/catalina/storeconfig/IStoreConfig.java b/java/org/apache/catalina/storeconfig/IStoreConfig.java
index 2d96b47ea2..a6a9e7698d 100644
--- a/java/org/apache/catalina/storeconfig/IStoreConfig.java
+++ b/java/org/apache/catalina/storeconfig/IStoreConfig.java
@@ -35,8 +35,7 @@ public interface IStoreConfig {
/**
* Set Configuration Registry
*
- * @param aRegistry
- * aregistry that handle the store operations
+ * @param aRegistry aregistry that handle the store operations
*/
void setRegistry(StoreRegistry aRegistry);
@@ -60,10 +59,10 @@ public interface IStoreConfig {
void storeConfig();
/**
- * Write the configuration information for this entire <code>Server</code>
- * out to the server.xml configuration file.
+ * Write the configuration information for this entire <code>Server</code> out to the server.xml configuration file.
*
* @param aServer Server instance
+ *
* @return <code>true</code> if the store operation was successful
*/
boolean store(Server aServer);
@@ -71,12 +70,10 @@ public interface IStoreConfig {
/**
* Store the specified Server properties.
*
- * @param aWriter
- * PrintWriter to which we are storing
- * @param indent
- * Number of spaces to indent this element
- * @param aServer
- * Object to be stored
+ * @param aWriter PrintWriter to which we are storing
+ * @param indent Number of spaces to indent this element
+ * @param aServer Object to be stored
+ *
* @throws Exception Store error occurred
*/
void store(PrintWriter aWriter, int indent, Server aServer) throws Exception;
@@ -84,12 +81,10 @@ public interface IStoreConfig {
/**
* Store the specified Service properties.
*
- * @param aWriter
- * PrintWriter to which we are storing
- * @param indent
- * Number of spaces to indent this element
- * @param aService
- * Object to be stored
+ * @param aWriter PrintWriter to which we are storing
+ * @param indent Number of spaces to indent this element
+ * @param aService Object to be stored
+ *
* @throws Exception Store error occurred
*/
void store(PrintWriter aWriter, int indent, Service aService) throws Exception;
@@ -97,12 +92,10 @@ public interface IStoreConfig {
/**
* Store the specified Host properties.
*
- * @param aWriter
- * PrintWriter to which we are storing
- * @param indent
- * Number of spaces to indent this element
- * @param aHost
- * Object to be stored
+ * @param aWriter PrintWriter to which we are storing
+ * @param indent Number of spaces to indent this element
+ * @param aHost Object to be stored
+ *
* @throws Exception Store error occurred
*/
void store(PrintWriter aWriter, int indent, Host aHost) throws Exception;
@@ -110,8 +103,8 @@ public interface IStoreConfig {
/**
* Store the specified Context properties.
*
- * @param aContext
- * Object to be stored
+ * @param aContext Object to be stored
+ *
* @return <code>true</code> if the store operation was successful
*/
boolean store(Context aContext);
@@ -119,12 +112,10 @@ public interface IStoreConfig {
/**
* Store the specified Context properties.
*
- * @param aWriter
- * PrintWriter to which we are storing
- * @param indent
- * Number of spaces to indent this element
- * @param aContext
- * Object to be stored
+ * @param aWriter PrintWriter to which we are storing
+ * @param indent Number of spaces to indent this element
+ * @param aContext Object to be stored
+ *
* @throws Exception Store error occurred
*/
void store(PrintWriter aWriter, int indent, Context aContext) throws Exception;
diff --git a/java/org/apache/catalina/storeconfig/IStoreFactory.java b/java/org/apache/catalina/storeconfig/IStoreFactory.java
index 6f1d95bdd4..678092d4db 100644
--- a/java/org/apache/catalina/storeconfig/IStoreFactory.java
+++ b/java/org/apache/catalina/storeconfig/IStoreFactory.java
@@ -27,12 +27,14 @@ public interface IStoreFactory {
/**
* Set the store appender.
+ *
* @param storeWriter the writer
*/
void setStoreAppender(StoreAppender storeWriter);
/**
* Set the registry.
+ *
* @param aRegistry the registry to be associated with
*/
void setRegistry(StoreRegistry aRegistry);
@@ -45,16 +47,17 @@ public interface IStoreFactory {
/**
* Store a server.xml element with attributes and children.
*
- * @param aWriter the writer to write to
- * @param indent the indentation
+ * @param aWriter the writer to write to
+ * @param indent the indentation
* @param aElement the element to write
+ *
* @throws Exception if an error occurs
*/
- void store(PrintWriter aWriter, int indent, Object aElement)
- throws Exception;
+ void store(PrintWriter aWriter, int indent, Object aElement) throws Exception;
/**
* Store XML header.
+ *
* @param aWriter the writer to write to
*/
void storeXMLHead(PrintWriter aWriter);
diff --git a/java/org/apache/catalina/storeconfig/InterceptorSF.java b/java/org/apache/catalina/storeconfig/InterceptorSF.java
index 06b155d43d..08b231b1f5 100644
--- a/java/org/apache/catalina/storeconfig/InterceptorSF.java
+++ b/java/org/apache/catalina/storeconfig/InterceptorSF.java
@@ -31,27 +31,22 @@ public class InterceptorSF extends StoreFactoryBase {
private static Log log = LogFactory.getLog(InterceptorSF.class);
@Override
- public void store(PrintWriter aWriter, int indent, Object aElement)
- throws Exception {
+ public void store(PrintWriter aWriter, int indent, Object aElement) throws Exception {
if (aElement instanceof StaticMembershipInterceptor) {
- StoreDescription elementDesc = getRegistry().findDescription(
- aElement.getClass());
+ StoreDescription elementDesc = getRegistry().findDescription(aElement.getClass());
if (elementDesc != null) {
if (log.isTraceEnabled()) {
- log.trace(sm.getString("factory.storeTag",
- elementDesc.getTag(), aElement));
+ log.trace(sm.getString("factory.storeTag", elementDesc.getTag(), aElement));
}
getStoreAppender().printIndent(aWriter, indent + 2);
- getStoreAppender().printOpenTag(aWriter, indent + 2, aElement,
- elementDesc);
+ getStoreAppender().printOpenTag(aWriter, indent + 2, aElement, elementDesc);
storeChildren(aWriter, indent + 2, aElement, elementDesc);
getStoreAppender().printIndent(aWriter, indent + 2);
getStoreAppender().printCloseTag(aWriter, elementDesc);
} else {
if (log.isWarnEnabled()) {
- log.warn(sm.getString("factory.storeNoDescriptor",
- aElement.getClass()));
+ log.warn(sm.getString("factory.storeNoDescriptor", aElement.getClass()));
}
}
} else {
@@ -61,15 +56,16 @@ public class InterceptorSF extends StoreFactoryBase {
/**
* Store the specified Interceptor child.
+ * <p>
* {@inheritDoc}
*/
@Override
- public void storeChildren(PrintWriter aWriter, int indent, Object aInterceptor,
- StoreDescription parentDesc) throws Exception {
+ public void storeChildren(PrintWriter aWriter, int indent, Object aInterceptor, StoreDescription parentDesc)
+ throws Exception {
if (aInterceptor instanceof StaticMembershipInterceptor) {
ChannelInterceptor interceptor = (ChannelInterceptor) aInterceptor;
// Store nested <Member> elements
storeElementArray(aWriter, indent + 2, interceptor.getMembers());
- }
+ }
}
}
\ No newline at end of file
diff --git a/java/org/apache/catalina/storeconfig/JarScannerSF.java b/java/org/apache/catalina/storeconfig/JarScannerSF.java
index f863e49e2f..78e949a141 100644
--- a/java/org/apache/catalina/storeconfig/JarScannerSF.java
+++ b/java/org/apache/catalina/storeconfig/JarScannerSF.java
@@ -27,13 +27,13 @@ import org.apache.tomcat.JarScanner;
public class JarScannerSF extends StoreFactoryBase {
/**
- * Store the specified JarScanner properties and children
- * (JarScannerFilter)
+ * Store the specified JarScanner properties and children (JarScannerFilter)
+ * <p>
* {@inheritDoc}
*/
@Override
- public void storeChildren(PrintWriter aWriter, int indent, Object aJarScanner,
- StoreDescription parentDesc) throws Exception {
+ public void storeChildren(PrintWriter aWriter, int indent, Object aJarScanner, StoreDescription parentDesc)
+ throws Exception {
if (aJarScanner instanceof JarScanner) {
JarScanner jarScanner = (JarScanner) aJarScanner;
// Store nested <JarScanFilter> element
diff --git a/java/org/apache/catalina/storeconfig/LoaderSF.java b/java/org/apache/catalina/storeconfig/LoaderSF.java
index dae8acd114..be19e094a3 100644
--- a/java/org/apache/catalina/storeconfig/LoaderSF.java
+++ b/java/org/apache/catalina/storeconfig/LoaderSF.java
@@ -31,10 +31,8 @@ public class LoaderSF extends StoreFactoryBase {
private static Log log = LogFactory.getLog(LoaderSF.class);
@Override
- public void store(PrintWriter aWriter, int indent, Object aElement)
- throws Exception {
- StoreDescription elementDesc = getRegistry().findDescription(
- aElement.getClass());
+ public void store(PrintWriter aWriter, int indent, Object aElement) throws Exception {
+ StoreDescription elementDesc = getRegistry().findDescription(aElement.getClass());
if (elementDesc != null) {
Loader loader = (Loader) aElement;
if (!isDefaultLoader(loader)) {
@@ -42,25 +40,22 @@ public class LoaderSF extends StoreFactoryBase {
log.trace("store " + elementDesc.getTag() + "( " + aElement + " )");
}
getStoreAppender().printIndent(aWriter, indent + 2);
- getStoreAppender().printTag(aWriter, indent + 2, loader,
- elementDesc);
+ getStoreAppender().printTag(aWriter, indent + 2, loader, elementDesc);
}
} else {
if (log.isWarnEnabled()) {
if (log.isWarnEnabled()) {
- log.warn(sm.getString("factory.storeNoDescriptor", aElement
- .getClass()));
+ log.warn(sm.getString("factory.storeNoDescriptor", aElement.getClass()));
}
}
}
}
/**
- * Is this an instance of the default <code>Loader</code> configuration,
- * with all-default properties?
+ * Is this an instance of the default <code>Loader</code> configuration, with all-default properties?
+ *
+ * @param loader Loader to be tested
*
- * @param loader
- * Loader to be tested
* @return <code>true</code> if this is an instance of the default loader
*/
protected boolean isDefaultLoader(Loader loader) {
@@ -69,9 +64,8 @@ public class LoaderSF extends StoreFactoryBase {
return false;
}
WebappLoader wloader = (WebappLoader) loader;
- if ((wloader.getDelegate() != false)
- || !wloader.getLoaderClass().equals(
- "org.apache.catalina.loader.WebappClassLoader")) {
+ if ((wloader.getDelegate() != false) ||
+ !wloader.getLoaderClass().equals("org.apache.catalina.loader.WebappClassLoader")) {
return false;
}
return true;
diff --git a/java/org/apache/catalina/storeconfig/ManagerSF.java b/java/org/apache/catalina/storeconfig/ManagerSF.java
index 3d4781929b..06397f6576 100644
--- a/java/org/apache/catalina/storeconfig/ManagerSF.java
+++ b/java/org/apache/catalina/storeconfig/ManagerSF.java
@@ -32,17 +32,14 @@ public class ManagerSF extends StoreFactoryBase {
private static Log log = LogFactory.getLog(ManagerSF.class);
@Override
- public void store(PrintWriter aWriter, int indent, Object aElement)
- throws Exception {
- StoreDescription elementDesc = getRegistry().findDescription(
- aElement.getClass());
+ public void store(PrintWriter aWriter, int indent, Object aElement) throws Exception {
+ StoreDescription elementDesc = getRegistry().findDescription(aElement.getClass());
if (elementDesc != null) {
if (aElement instanceof StandardManager) {
StandardManager manager = (StandardManager) aElement;
if (!isDefaultManager(manager)) {
if (log.isTraceEnabled()) {
- log.trace(sm.getString("factory.storeTag", elementDesc
- .getTag(), aElement));
+ log.trace(sm.getString("factory.storeTag", elementDesc.getTag(), aElement));
}
super.store(aWriter, indent, aElement);
}
@@ -51,24 +48,21 @@ public class ManagerSF extends StoreFactoryBase {
}
} else {
if (log.isWarnEnabled()) {
- log.warn(sm.getString("factory.storeNoDescriptor", aElement
- .getClass()));
+ log.warn(sm.getString("factory.storeNoDescriptor", aElement.getClass()));
}
}
}
/**
- * Is this an instance of the default <code>Manager</code> configuration,
- * with all-default properties?
+ * Is this an instance of the default <code>Manager</code> configuration, with all-default properties?
+ *
+ * @param smanager Manager to be tested
*
- * @param smanager
- * Manager to be tested
* @return <code>true</code> if this is an instance of the default manager
*/
protected boolean isDefaultManager(StandardManager smanager) {
- if (!"SESSIONS.ser".equals(smanager.getPathname())
- || (smanager.getMaxActiveSessions() != -1)) {
+ if (!"SESSIONS.ser".equals(smanager.getPathname()) || (smanager.getMaxActiveSessions() != -1)) {
return false;
}
return true;
@@ -76,8 +70,8 @@ public class ManagerSF extends StoreFactoryBase {
}
@Override
- public void storeChildren(PrintWriter aWriter, int indent, Object aManager,
- StoreDescription parentDesc) throws Exception {
+ public void storeChildren(PrintWriter aWriter, int indent, Object aManager, StoreDescription parentDesc)
+ throws Exception {
if (aManager instanceof Manager) {
Manager manager = (Manager) aManager;
// Store nested <SessionIdGenerator> element;
diff --git a/java/org/apache/catalina/storeconfig/NamingResourcesSF.java b/java/org/apache/catalina/storeconfig/NamingResourcesSF.java
index 1a33aa58e4..f7f610bc02 100644
--- a/java/org/apache/catalina/storeconfig/NamingResourcesSF.java
+++ b/java/org/apache/catalina/storeconfig/NamingResourcesSF.java
@@ -35,10 +35,8 @@ public class NamingResourcesSF extends StoreFactoryBase {
private static Log log = LogFactory.getLog(NamingResourcesSF.class);
@Override
- public void store(PrintWriter aWriter, int indent, Object aElement)
- throws Exception {
- StoreDescription elementDesc = getRegistry().findDescription(
- aElement.getClass());
+ public void store(PrintWriter aWriter, int indent, Object aElement) throws Exception {
+ StoreDescription elementDesc = getRegistry().findDescription(aElement.getClass());
if (elementDesc != null) {
if (log.isTraceEnabled()) {
log.trace("store " + elementDesc.getTag() + "( " + aElement + " )");
@@ -51,11 +49,12 @@ public class NamingResourcesSF extends StoreFactoryBase {
/**
* Store the specified NamingResources properties.
+ * <p>
* {@inheritDoc}
*/
@Override
- public void storeChildren(PrintWriter aWriter, int indent, Object aElement,
- StoreDescription elementDesc) throws Exception {
+ public void storeChildren(PrintWriter aWriter, int indent, Object aElement, StoreDescription elementDesc)
+ throws Exception {
if (aElement instanceof NamingResourcesImpl) {
NamingResourcesImpl resources = (NamingResourcesImpl) aElement;
diff --git a/java/org/apache/catalina/storeconfig/OpenSSLConfSF.java b/java/org/apache/catalina/storeconfig/OpenSSLConfSF.java
index 8fcd6e729b..b0362757fa 100644
--- a/java/org/apache/catalina/storeconfig/OpenSSLConfSF.java
+++ b/java/org/apache/catalina/storeconfig/OpenSSLConfSF.java
@@ -28,11 +28,12 @@ public class OpenSSLConfSF extends StoreFactoryBase {
/**
* Store nested OpenSSLConfCmd elements.
+ * <p>
* {@inheritDoc}
*/
@Override
- public void storeChildren(PrintWriter aWriter, int indent, Object aOpenSSLConf,
- StoreDescription parentDesc) throws Exception {
+ public void storeChildren(PrintWriter aWriter, int indent, Object aOpenSSLConf, StoreDescription parentDesc)
+ throws Exception {
if (aOpenSSLConf instanceof OpenSSLConf) {
OpenSSLConf openSslConf = (OpenSSLConf) aOpenSSLConf;
// Store nested <OpenSSLConfCmd> elements
diff --git a/java/org/apache/catalina/storeconfig/PersistentManagerSF.java b/java/org/apache/catalina/storeconfig/PersistentManagerSF.java
index 88129d31c2..6e237871f1 100644
--- a/java/org/apache/catalina/storeconfig/PersistentManagerSF.java
+++ b/java/org/apache/catalina/storeconfig/PersistentManagerSF.java
@@ -29,11 +29,12 @@ public class PersistentManagerSF extends StoreFactoryBase {
/**
* Store the specified PersistentManager properties.
+ * <p>
* {@inheritDoc}
*/
@Override
- public void storeChildren(PrintWriter aWriter, int indent, Object aManager,
- StoreDescription parentDesc) throws Exception {
+ public void storeChildren(PrintWriter aWriter, int indent, Object aManager, StoreDescription parentDesc)
+ throws Exception {
if (aManager instanceof PersistentManager) {
PersistentManager manager = (PersistentManager) aManager;
diff --git a/java/org/apache/catalina/storeconfig/RealmSF.java b/java/org/apache/catalina/storeconfig/RealmSF.java
index 84ce263cae..7afdf02c3c 100644
--- a/java/org/apache/catalina/storeconfig/RealmSF.java
+++ b/java/org/apache/catalina/storeconfig/RealmSF.java
@@ -32,27 +32,22 @@ public class RealmSF extends StoreFactoryBase {
private static Log log = LogFactory.getLog(RealmSF.class);
@Override
- public void store(PrintWriter aWriter, int indent, Object aElement)
- throws Exception {
+ public void store(PrintWriter aWriter, int indent, Object aElement) throws Exception {
if (aElement instanceof CombinedRealm) {
- StoreDescription elementDesc = getRegistry().findDescription(
- aElement.getClass());
+ StoreDescription elementDesc = getRegistry().findDescription(aElement.getClass());
if (elementDesc != null) {
if (log.isTraceEnabled()) {
- log.trace(sm.getString("factory.storeTag",
- elementDesc.getTag(), aElement));
+ log.trace(sm.getString("factory.storeTag", elementDesc.getTag(), aElement));
}
getStoreAppender().printIndent(aWriter, indent + 2);
- getStoreAppender().printOpenTag(aWriter, indent + 2, aElement,
- elementDesc);
+ getStoreAppender().printOpenTag(aWriter, indent + 2, aElement, elementDesc);
storeChildren(aWriter, indent + 2, aElement, elementDesc);
getStoreAppender().printIndent(aWriter, indent + 2);
getStoreAppender().printCloseTag(aWriter, elementDesc);
} else {
if (log.isWarnEnabled()) {
- log.warn(sm.getString("factory.storeNoDescriptor",
- aElement.getClass()));
+ log.warn(sm.getString("factory.storeNoDescriptor", aElement.getClass()));
}
}
} else {
@@ -61,12 +56,11 @@ public class RealmSF extends StoreFactoryBase {
}
/**
- * Store the specified Realm properties and child (Realm)
- * {@inheritDoc}
+ * Store the specified Realm properties and child (Realm) {@inheritDoc}
*/
@Override
- public void storeChildren(PrintWriter aWriter, int indent, Object aRealm,
- StoreDescription parentDesc) throws Exception {
+ public void storeChildren(PrintWriter aWriter, int indent, Object aRealm, StoreDescription parentDesc)
+ throws Exception {
if (aRealm instanceof CombinedRealm) {
CombinedRealm combinedRealm = (CombinedRealm) aRealm;
@@ -76,8 +70,8 @@ public class RealmSF extends StoreFactoryBase {
}
// Store nested <CredentialHandler> element
CredentialHandler credentialHandler = ((Realm) aRealm).getCredentialHandler();
- if (credentialHandler != null
- && !(credentialHandler.getClass().getName().equals("org.apache.catalina.realm.CombinedRealm$CombinedRealmCredentialHandler"))) {
+ if (credentialHandler != null && !(credentialHandler.getClass().getName()
+ .equals("org.apache.catalina.realm.CombinedRealm$CombinedRealmCredentialHandler"))) {
storeElement(aWriter, indent, credentialHandler);
}
}
diff --git a/java/org/apache/catalina/storeconfig/SSLHostConfigSF.java b/java/org/apache/catalina/storeconfig/SSLHostConfigSF.java
index 2efdc050f0..44bad1d973 100644
--- a/java/org/apache/catalina/storeconfig/SSLHostConfigSF.java
+++ b/java/org/apache/catalina/storeconfig/SSLHostConfigSF.java
@@ -31,15 +31,17 @@ public class SSLHostConfigSF extends StoreFactoryBase {
/**
* Store nested SSLHostConfigCertificate elements.
+ * <p>
* {@inheritDoc}
*/
@Override
- public void storeChildren(PrintWriter aWriter, int indent, Object aSSLHostConfig,
- StoreDescription parentDesc) throws Exception {
+ public void storeChildren(PrintWriter aWriter, int indent, Object aSSLHostConfig, StoreDescription parentDesc)
+ throws Exception {
if (aSSLHostConfig instanceof SSLHostConfig) {
SSLHostConfig sslHostConfig = (SSLHostConfig) aSSLHostConfig;
// Store nested <SSLHostConfigCertificate> elements
- SSLHostConfigCertificate[] hostConfigsCertificates = sslHostConfig.getCertificates().toArray(new SSLHostConfigCertificate[0]);
+ SSLHostConfigCertificate[] hostConfigsCertificates =
+ sslHostConfig.getCertificates().toArray(new SSLHostConfigCertificate[0]);
// Remove a possible default UNDEFINED certificate
if (hostConfigsCertificates.length > 1) {
ArrayList<SSLHostConfigCertificate> certificates = new ArrayList<>();
diff --git a/java/org/apache/catalina/storeconfig/SenderSF.java b/java/org/apache/catalina/storeconfig/SenderSF.java
index 7ce5e1e5ab..58c9d74714 100644
--- a/java/org/apache/catalina/storeconfig/SenderSF.java
+++ b/java/org/apache/catalina/storeconfig/SenderSF.java
@@ -28,11 +28,12 @@ public class SenderSF extends StoreFactoryBase {
/**
* Store the specified Sender child.
+ * <p>
* {@inheritDoc}
*/
@Override
- public void storeChildren(PrintWriter aWriter, int indent, Object aSender,
- StoreDescription parentDesc) throws Exception {
+ public void storeChildren(PrintWriter aWriter, int indent, Object aSender, StoreDescription parentDesc)
+ throws Exception {
if (aSender instanceof ReplicationTransmitter) {
ReplicationTransmitter transmitter = (ReplicationTransmitter) aSender;
// Store nested <Transport> element
@@ -40,6 +41,6 @@ public class SenderSF extends StoreFactoryBase {
if (transport != null) {
storeElement(aWriter, indent, transport);
}
- }
+ }
}
}
\ No newline at end of file
diff --git a/java/org/apache/catalina/storeconfig/StandardContextSF.java b/java/org/apache/catalina/storeconfig/StandardContextSF.java
index 1c3a41ddc7..cb826a7f69 100644
--- a/java/org/apache/catalina/storeconfig/StandardContextSF.java
+++ b/java/org/apache/catalina/storeconfig/StandardContextSF.java
@@ -59,29 +59,24 @@ public class StandardContextSF extends StoreFactoryBase {
private static Log log = LogFactory.getLog(StandardContextSF.class);
/**
- * Store a Context as Separate file as configFile value from context exists.
- * filename can be relative to catalina.base.
+ * Store a Context as Separate file as configFile value from context exists. filename can be relative to
+ * catalina.base.
*
- * @see org.apache.catalina.storeconfig.IStoreFactory#store(java.io.PrintWriter,
- * int, java.lang.Object)
+ * @see org.apache.catalina.storeconfig.IStoreFactory#store(java.io.PrintWriter, int, java.lang.Object)
*/
@Override
- public void store(PrintWriter aWriter, int indent, Object aContext)
- throws Exception {
+ public void store(PrintWriter aWriter, int indent, Object aContext) throws Exception {
if (aContext instanceof StandardContext) {
- StoreDescription desc = getRegistry().findDescription(
- aContext.getClass());
+ StoreDescription desc = getRegistry().findDescription(aContext.getClass());
if (desc != null && desc.isStoreSeparate()) {
- URL configFile = ((StandardContext) aContext)
- .getConfigFile();
+ URL configFile = ((StandardContext) aContext).getConfigFile();
if (configFile != null) {
if (desc.isExternalAllowed()) {
if (desc.isBackup()) {
storeWithBackup((StandardContext) aContext);
} else {
- storeContextSeparate(aWriter, indent,
- (StandardContext) aContext);
+ storeContextSeparate(aWriter, indent, (StandardContext) aContext);
}
return;
}
@@ -97,8 +92,7 @@ public class StandardContextSF extends StoreFactoryBase {
if (desc.isBackup()) {
storeWithBackup((StandardContext) aContext);
} else {
- storeContextSeparate(aWriter, indent,
- (StandardContext) aContext);
+ storeContextSeparate(aWriter, indent, (StandardContext) aContext);
}
return;
}
@@ -109,32 +103,29 @@ public class StandardContextSF extends StoreFactoryBase {
}
/**
- * Store a Context without backup add separate file or when configFile =
- * null a aWriter.
+ * Store a Context without backup add separate file or when configFile = null a aWriter.
*
- * @param aWriter Current output writer
- * @param indent Indentation level
+ * @param aWriter Current output writer
+ * @param indent Indentation level
* @param aContext The context which will be stored
+ *
* @throws Exception Configuration storing error
*/
- protected void storeContextSeparate(PrintWriter aWriter, int indent,
- StandardContext aContext) throws Exception {
+ protected void storeContextSeparate(PrintWriter aWriter, int indent, StandardContext aContext) throws Exception {
URL configFile = aContext.getConfigFile();
if (configFile != null) {
File config = new File(configFile.toURI());
if (!config.isAbsolute()) {
- config = new File(System.getProperty(Globals.CATALINA_BASE_PROP),
- config.getPath());
+ config = new File(System.getProperty(Globals.CATALINA_BASE_PROP), config.getPath());
}
- if( (!config.isFile()) || (!config.canWrite())) {
+ if ((!config.isFile()) || (!config.canWrite())) {
throw new IOException(sm.getString("standardContextSF.cannotWriteFile", configFile));
}
if (log.isInfoEnabled()) {
log.info(sm.getString("standardContextSF.storeContext", aContext.getPath(), config));
}
try (FileOutputStream fos = new FileOutputStream(config);
- PrintWriter writer = new PrintWriter(new OutputStreamWriter(
- fos , getRegistry().getEncoding()))) {
+ PrintWriter writer = new PrintWriter(new OutputStreamWriter(fos, getRegistry().getEncoding()))) {
storeXMLHead(writer);
super.store(writer, -2, aContext);
}
@@ -147,16 +138,15 @@ public class StandardContextSF extends StoreFactoryBase {
* Store the Context with a Backup.
*
* @param aContext The context which will be stored
+ *
* @throws Exception Configuration storing error
*/
protected void storeWithBackup(StandardContext aContext) throws Exception {
StoreFileMover mover = getConfigFileWriter(aContext);
if (mover != null) {
// Bugzilla 37781 Check to make sure we can write this output file
- if ((mover.getConfigOld() == null)
- || (mover.getConfigOld().isDirectory())
- || (mover.getConfigOld().exists() &&
- !mover.getConfigOld().canWrite())) {
+ if ((mover.getConfigOld() == null) || (mover.getConfigOld().isDirectory()) ||
+ (mover.getConfigOld().exists() && !mover.getConfigOld().canWrite())) {
throw new IOException(sm.getString("standardContextSF.moveFailed", mover.getConfigOld()));
}
File dir = mover.getConfigSave().getParentFile();
@@ -164,8 +154,8 @@ public class StandardContextSF extends StoreFactoryBase {
throw new IOException(sm.getString("standardContextSF.cannotWriteFile", mover.getConfigSave()));
}
if (log.isInfoEnabled()) {
- log.info(sm.getString("standardContextSF.storeContextWithBackup",
- aContext.getPath(), mover.getConfigSave()));
+ log.info(sm.getString("standardContextSF.storeContextWithBackup", aContext.getPath(),
+ mover.getConfigSave()));
}
try (PrintWriter writer = mover.getWriter()) {
storeXMLHead(writer);
@@ -179,33 +169,33 @@ public class StandardContextSF extends StoreFactoryBase {
* Get explicit writer for context (context.getConfigFile()).
*
* @param context The context which will be stored
+ *
* @return The file mover
+ *
* @throws Exception Error getting a writer for the configuration file
*/
- protected StoreFileMover getConfigFileWriter(Context context)
- throws Exception {
+ protected StoreFileMover getConfigFileWriter(Context context) throws Exception {
URL configFile = context.getConfigFile();
StoreFileMover mover = null;
if (configFile != null) {
File config = new File(configFile.toURI());
if (!config.isAbsolute()) {
- config = new File(System.getProperty(Globals.CATALINA_BASE_PROP),
- config.getPath());
+ config = new File(System.getProperty(Globals.CATALINA_BASE_PROP), config.getPath());
}
// Open an output writer for the new configuration file
- mover = new StoreFileMover("", config.getCanonicalPath(),
- getRegistry().getEncoding());
+ mover = new StoreFileMover("", config.getCanonicalPath(), getRegistry().getEncoding());
}
return mover;
}
/**
* Store the specified context element children.
+ * <p>
* {@inheritDoc}
*/
@Override
- public void storeChildren(PrintWriter aWriter, int indent, Object aContext,
- StoreDescription parentDesc) throws Exception {
+ public void storeChildren(PrintWriter aWriter, int indent, Object aContext, StoreDescription parentDesc)
+ throws Exception {
if (aContext instanceof StandardContext) {
StandardContext context = (StandardContext) aContext;
// Store nested <Listener> elements
@@ -250,16 +240,13 @@ public class StandardContextSF extends StoreFactoryBase {
// Store nested <WrapperListener> elements
String wLifecycles[] = context.findWrapperLifecycles();
- getStoreAppender().printTagArray(aWriter, "WrapperListener",
- indent + 2, wLifecycles);
+ getStoreAppender().printTagArray(aWriter, "WrapperListener", indent + 2, wLifecycles);
// Store nested <WrapperLifecycle> elements
String wListeners[] = context.findWrapperListeners();
- getStoreAppender().printTagArray(aWriter, "WrapperLifecycle",
- indent + 2, wListeners);
+ getStoreAppender().printTagArray(aWriter, "WrapperLifecycle", indent + 2, wListeners);
// Store nested <Parameter> elements
- ApplicationParameter[] appParams = context
- .findApplicationParameters();
+ ApplicationParameter[] appParams = context.findApplicationParameters();
storeElementArray(aWriter, indent, appParams);
// Store nested naming resources elements (EJB,Resource,...)
@@ -269,8 +256,7 @@ public class StandardContextSF extends StoreFactoryBase {
// Store nested watched resources <WatchedResource>
String[] wresources = context.findWatchedResources();
wresources = filterWatchedResources(context, wresources);
- getStoreAppender().printTagArray(aWriter, "WatchedResource",
- indent + 2, wresources);
+ getStoreAppender().printTagArray(aWriter, "WatchedResource", indent + 2, wresources);
// Store nested <JarScanner> elements
JarScanner jarScanner = context.getJarScanner();
@@ -283,9 +269,10 @@ public class StandardContextSF extends StoreFactoryBase {
}
/**
- * Return a File object representing the "configuration root" directory for
- * our associated Host.
+ * Return a File object representing the "configuration root" directory for our associated Host.
+ *
* @param context The context instance
+ *
* @return a file to the configuration base path
*/
protected File configBase(Context context) {
@@ -311,26 +298,30 @@ public class StandardContextSF extends StoreFactoryBase {
/**
* Filter out the default watched resources, to remove standard ones.
- *
- * @param context The context instance
- * @param wresources The raw watched resources list
- * @return The filtered watched resources
- * @throws Exception Configuration storing error
+ * <p>
* TODO relative watched resources
+ * <p>
* TODO absolute handling configFile
+ * <p>
* TODO Filename case handling for Windows?
+ * <p>
* TODO digester variable substitution $catalina.base, $catalina.home
+ *
+ * @param context The context instance
+ * @param wresources The raw watched resources list
+ *
+ * @return The filtered watched resources
+ *
+ * @throws Exception Configuration storing error
*/
- protected String[] filterWatchedResources(StandardContext context,
- String[] wresources) throws Exception {
+ protected String[] filterWatchedResources(StandardContext context, String[] wresources) throws Exception {
File configBase = configBase(context);
- String confContext = new File(System.getProperty(Globals.CATALINA_BASE_PROP),
- "conf/context.xml").getCanonicalPath();
- String confWeb = new File(System.getProperty(Globals.CATALINA_BASE_PROP),
- "conf/web.xml").getCanonicalPath();
- String confHostDefault = new File(configBase, "context.xml.default")
- .getCanonicalPath();
- String configFile = (context.getConfigFile() != null ? new File(context.getConfigFile().toURI()).getCanonicalPath() : null);
+ String confContext =
+ new File(System.getProperty(Globals.CATALINA_BASE_PROP), "conf/context.xml").getCanonicalPath();
+ String confWeb = new File(System.getProperty(Globals.CATALINA_BASE_PROP), "conf/web.xml").getCanonicalPath();
+ String confHostDefault = new File(configBase, "context.xml.default").getCanonicalPath();
+ String configFile =
+ (context.getConfigFile() != null ? new File(context.getConfigFile().toURI()).getCanonicalPath() : null);
String webxml = "WEB-INF/web.xml";
String tomcatwebxml = "WEB-INF/tomcat-web.xml";
diff --git a/java/org/apache/catalina/storeconfig/StandardEngineSF.java b/java/org/apache/catalina/storeconfig/StandardEngineSF.java
index 5b7fabaa7c..806de0f4d3 100644
--- a/java/org/apache/catalina/storeconfig/StandardEngineSF.java
+++ b/java/org/apache/catalina/storeconfig/StandardEngineSF.java
@@ -35,11 +35,12 @@ public class StandardEngineSF extends StoreFactoryBase {
/**
* Store the specified Engine properties.
+ * <p>
* {@inheritDoc}
*/
@Override
- public void storeChildren(PrintWriter aWriter, int indent, Object aEngine,
- StoreDescription parentDesc) throws Exception {
+ public void storeChildren(PrintWriter aWriter, int indent, Object aEngine, StoreDescription parentDesc)
+ throws Exception {
if (aEngine instanceof StandardEngine) {
StandardEngine engine = (StandardEngine) aEngine;
// Store nested <Listener> elements
@@ -60,8 +61,8 @@ public class StandardEngineSF extends StoreFactoryBase {
// Store nested <Valve> elements
Valve valves[] = engine.getPipeline().getValves();
- if(valves != null && valves.length > 0 ) {
- List<Valve> engineValves = new ArrayList<>() ;
+ if (valves != null && valves.length > 0) {
+ List<Valve> engineValves = new ArrayList<>();
for (Valve valve : valves) {
if (!(valve instanceof ClusterValve)) {
engineValves.add(valve);
@@ -79,6 +80,6 @@ public class StandardEngineSF extends StoreFactoryBase {
Container children[] = engine.findChildren();
storeElementArray(aWriter, indent, children);
- }
+ }
}
}
\ No newline at end of file
diff --git a/java/org/apache/catalina/storeconfig/StandardHostSF.java b/java/org/apache/catalina/storeconfig/StandardHostSF.java
index f6b610c4e4..7c51c47b31 100644
--- a/java/org/apache/catalina/storeconfig/StandardHostSF.java
+++ b/java/org/apache/catalina/storeconfig/StandardHostSF.java
@@ -34,13 +34,13 @@ import org.apache.catalina.ha.ClusterValve;
public class StandardHostSF extends StoreFactoryBase {
/**
- * Store the specified Host properties and children
- * (Listener,Alias,Realm,Valve,Cluster, Context)
+ * Store the specified Host properties and children (Listener,Alias,Realm,Valve,Cluster, Context)
+ * <p>
* {@inheritDoc}
*/
@Override
- public void storeChildren(PrintWriter aWriter, int indent, Object aHost,
- StoreDescription parentDesc) throws Exception {
+ public void storeChildren(PrintWriter aWriter, int indent, Object aHost, StoreDescription parentDesc)
+ throws Exception {
if (aHost instanceof StandardHost) {
StandardHost host = (StandardHost) aHost;
// Store nested <Listener> elements
@@ -49,8 +49,7 @@ public class StandardHostSF extends StoreFactoryBase {
// Store nested <Alias> elements
String aliases[] = host.findAliases();
- getStoreAppender().printTagArray(aWriter, "Alias", indent + 2,
- aliases);
+ getStoreAppender().printTagArray(aWriter, "Alias", indent + 2, aliases);
// Store nested <Realm> element
Realm realm = host.getRealm();
@@ -66,8 +65,8 @@ public class StandardHostSF extends StoreFactoryBase {
// Store nested <Valve> elements
Valve valves[] = host.getPipeline().getValves();
- if(valves != null && valves.length > 0 ) {
- List<Valve> hostValves = new ArrayList<>() ;
+ if (valves != null && valves.length > 0) {
+ List<Valve> hostValves = new ArrayList<>();
for (Valve valve : valves) {
if (!(valve instanceof ClusterValve)) {
hostValves.add(valve);
diff --git a/java/org/apache/catalina/storeconfig/StandardServerSF.java b/java/org/apache/catalina/storeconfig/StandardServerSF.java
index e1133f3921..213cfb3730 100644
--- a/java/org/apache/catalina/storeconfig/StandardServerSF.java
+++ b/java/org/apache/catalina/storeconfig/StandardServerSF.java
@@ -24,39 +24,35 @@ import org.apache.catalina.core.StandardServer;
import org.apache.catalina.deploy.NamingResourcesImpl;
/**
- * Store server.xml Server element and children (
- * Listener,GlobalNamingResource,Service)
+ * Store server.xml Server element and children ( Listener,GlobalNamingResource,Service)
*/
public class StandardServerSF extends StoreFactoryBase {
@Override
- public void store(PrintWriter aWriter, int indent, Object aServer)
- throws Exception {
+ public void store(PrintWriter aWriter, int indent, Object aServer) throws Exception {
storeXMLHead(aWriter);
super.store(aWriter, indent, aServer);
}
/**
* Store the specified server element children.
+ * <p>
* {@inheritDoc}
*/
@Override
- public void storeChildren(PrintWriter aWriter, int indent, Object aObject,
- StoreDescription parentDesc) throws Exception {
+ public void storeChildren(PrintWriter aWriter, int indent, Object aObject, StoreDescription parentDesc)
+ throws Exception {
if (aObject instanceof StandardServer) {
StandardServer server = (StandardServer) aObject;
// Store nested <Listener> elements
LifecycleListener listeners[] = server.findLifecycleListeners();
storeElementArray(aWriter, indent, listeners);
// Store nested <GlobalNamingResources> element
- NamingResourcesImpl globalNamingResources = server
- .getGlobalNamingResources();
- StoreDescription elementDesc = getRegistry().findDescription(
- NamingResourcesImpl.class.getName()
- + ".[GlobalNamingResources]");
+ NamingResourcesImpl globalNamingResources = server.getGlobalNamingResources();
+ StoreDescription elementDesc =
+ getRegistry().findDescription(NamingResourcesImpl.class.getName() + ".[GlobalNamingResources]");
if (elementDesc != null) {
- elementDesc.getStoreFactory().store(aWriter, indent,
- globalNamingResources);
+ elementDesc.getStoreFactory().store(aWriter, indent, globalNamingResources);
}
// Store nested <Service> elements
Service services[] = server.findServices();
diff --git a/java/org/apache/catalina/storeconfig/StandardServiceSF.java b/java/org/apache/catalina/storeconfig/StandardServiceSF.java
index b069e7b29f..907e76bb0b 100644
--- a/java/org/apache/catalina/storeconfig/StandardServiceSF.java
+++ b/java/org/apache/catalina/storeconfig/StandardServiceSF.java
@@ -31,11 +31,12 @@ public class StandardServiceSF extends StoreFactoryBase {
/**
* Store the specified service element children.
+ * <p>
* {@inheritDoc}
*/
@Override
- public void storeChildren(PrintWriter aWriter, int indent, Object aService,
- StoreDescription parentDesc) throws Exception {
+ public void storeChildren(PrintWriter aWriter, int indent, Object aService, StoreDescription parentDesc)
+ throws Exception {
if (aService instanceof StandardService) {
StandardService service = (StandardService) aService;
// Store nested <Listener> elements
diff --git a/java/org/apache/catalina/storeconfig/StoreAppender.java b/java/org/apache/catalina/storeconfig/StoreAppender.java
index 2dba031215..5c830fce56 100644
--- a/java/org/apache/catalina/storeconfig/StoreAppender.java
+++ b/java/org/apache/catalina/storeconfig/StoreAppender.java
@@ -35,11 +35,9 @@ public class StoreAppender {
/**
* The set of classes that represent persistable properties.
*/
- private static Class<?> persistables[] = { String.class, Integer.class,
- Integer.TYPE, Boolean.class, Boolean.TYPE, Byte.class, Byte.TYPE,
- Character.class, Character.TYPE, Double.class, Double.TYPE,
- Float.class, Float.TYPE, Long.class, Long.TYPE, Short.class,
- Short.TYPE, InetAddress.class };
+ private static Class<?> persistables[] = { String.class, Integer.class, Integer.TYPE, Boolean.class, Boolean.TYPE,
+ Byte.class, Byte.TYPE, Character.class, Character.TYPE, Double.class, Double.TYPE, Float.class, Float.TYPE,
+ Long.class, Long.TYPE, Short.class, Short.TYPE, InetAddress.class };
private int pos = 0;
@@ -47,11 +45,11 @@ public class StoreAppender {
* Print the closing tag.
*
* @param aWriter The output writer
- * @param aDesc Store description of the current element
+ * @param aDesc Store description of the current element
+ *
* @throws Exception A store error occurred
*/
- public void printCloseTag(PrintWriter aWriter, StoreDescription aDesc)
- throws Exception {
+ public void printCloseTag(PrintWriter aWriter, StoreDescription aDesc) throws Exception {
aWriter.print("</");
aWriter.print(aDesc.getTag());
aWriter.println(">");
@@ -61,13 +59,13 @@ public class StoreAppender {
* Print only the open tag with all attributes.
*
* @param aWriter The output writer
- * @param indent Indentation level
- * @param bean The current bean that is stored
- * @param aDesc Store description of the current element
+ * @param indent Indentation level
+ * @param bean The current bean that is stored
+ * @param aDesc Store description of the current element
+ *
* @throws Exception A store error occurred
*/
- public void printOpenTag(PrintWriter aWriter, int indent, Object bean,
- StoreDescription aDesc) throws Exception {
+ public void printOpenTag(PrintWriter aWriter, int indent, Object bean, StoreDescription aDesc) throws Exception {
aWriter.print("<");
aWriter.print(aDesc.getTag());
if (aDesc.isAttributes() && bean != null) {
@@ -80,13 +78,13 @@ public class StoreAppender {
* Print tag with all attributes
*
* @param aWriter The output writer
- * @param indent Indentation level
- * @param bean The current bean that is stored
- * @param aDesc Store description of the current element
+ * @param indent Indentation level
+ * @param bean The current bean that is stored
+ * @param aDesc Store description of the current element
+ *
* @throws Exception A store error occurred
*/
- public void printTag(PrintWriter aWriter, int indent, Object bean,
- StoreDescription aDesc) throws Exception {
+ public void printTag(PrintWriter aWriter, int indent, Object bean, StoreDescription aDesc) throws Exception {
aWriter.print("<");
aWriter.print(aDesc.getTag());
if (aDesc.isAttributes() && bean != null) {
@@ -99,12 +97,12 @@ public class StoreAppender {
* Print the value from tag as content.
*
* @param aWriter The output writer
- * @param tag The element name
+ * @param tag The element name
* @param content Element content
+ *
* @throws Exception A store error occurred
*/
- public void printTagContent(PrintWriter aWriter, String tag, String content)
- throws Exception {
+ public void printTagContent(PrintWriter aWriter, String tag, String content) throws Exception {
aWriter.print("<");
aWriter.print(tag);
aWriter.print(">");
@@ -117,13 +115,12 @@ public class StoreAppender {
/**
* Print an array of values.
*
- * @param aWriter The output writer
- * @param tag The element name
- * @param indent Indentation level
+ * @param aWriter The output writer
+ * @param tag The element name
+ * @param indent Indentation level
* @param elements Array of element values
*/
- public void printTagValueArray(PrintWriter aWriter, String tag, int indent,
- String[] elements) {
+ public void printTagValueArray(PrintWriter aWriter, String tag, int indent, String[] elements) {
if (elements != null && elements.length > 0) {
printIndent(aWriter, indent + 2);
aWriter.print("<");
@@ -146,14 +143,14 @@ public class StoreAppender {
/**
* Print an array of elements.
*
- * @param aWriter The output writer
- * @param tag The element name
- * @param indent Indentation level
+ * @param aWriter The output writer
+ * @param tag The element name
+ * @param indent Indentation level
* @param elements Array of elements
+ *
* @throws Exception Store error occurred
*/
- public void printTagArray(PrintWriter aWriter, String tag, int indent,
- String[] elements) throws Exception {
+ public void printTagArray(PrintWriter aWriter, String tag, int indent, String[] elements) throws Exception {
if (elements != null) {
for (String element : elements) {
printIndent(aWriter, indent);
@@ -166,7 +163,7 @@ public class StoreAppender {
* Print some spaces.
*
* @param aWriter The output writer
- * @param indent The number of spaces
+ * @param indent The number of spaces
*/
public void printIndent(PrintWriter aWriter, int indent) {
for (int i = 0; i < indent; i++) {
@@ -176,21 +173,17 @@ public class StoreAppender {
}
/**
- * Store the relevant attributes of the specified JavaBean, plus a
- * <code>className</code> attribute defining the fully qualified Java
- * class name of the bean.
+ * Store the relevant attributes of the specified JavaBean, plus a <code>className</code> attribute defining the
+ * fully qualified Java class name of the bean.
*
* @param writer PrintWriter to which we are storing
* @param indent Indentation level
- * @param bean
- * Bean whose properties are to be rendered as attributes,
- * @param desc Store description of the current element
+ * @param bean Bean whose properties are to be rendered as attributes,
+ * @param desc Store description of the current element
*
- * @exception Exception
- * if an exception occurs while storing
+ * @exception Exception if an exception occurs while storing
*/
- public void printAttributes(PrintWriter writer, int indent, Object bean,
- StoreDescription desc) throws Exception {
+ public void printAttributes(PrintWriter writer, int indent, Object bean, StoreDescription desc) throws Exception {
printAttributes(writer, indent, true, bean, desc);
@@ -199,20 +192,15 @@ public class StoreAppender {
/**
* Store the relevant attributes of the specified JavaBean.
*
- * @param writer PrintWriter to which we are storing
- * @param indent Indentation level
- * @param include
- * Should we include a <code>className</code> attribute?
- * @param bean
- * Bean whose properties are to be rendered as attributes,
- * @param desc
- * RegistryDescriptor from this bean
+ * @param writer PrintWriter to which we are storing
+ * @param indent Indentation level
+ * @param include Should we include a <code>className</code> attribute?
+ * @param bean Bean whose properties are to be rendered as attributes,
+ * @param desc RegistryDescriptor from this bean
*
- * @exception Exception
- * if an exception occurs while storing
+ * @exception Exception if an exception occurs while storing
*/
- public void printAttributes(PrintWriter writer, int indent,
- boolean include, Object bean, StoreDescription desc)
+ public void printAttributes(PrintWriter writer, int indent, boolean include, Object bean, StoreDescription desc)
throws Exception {
// Render a className attribute if requested
@@ -223,8 +211,7 @@ public class StoreAppender {
}
// Acquire the list of properties for this bean
- PropertyDescriptor descriptors[] = Introspector.getBeanInfo(
- bean.getClass()).getPropertyDescriptors();
+ PropertyDescriptor descriptors[] = Introspector.getBeanInfo(bean.getClass()).getPropertyDescriptors();
if (descriptors == null) {
descriptors = new PropertyDescriptor[0];
}
@@ -257,20 +244,22 @@ public class StoreAppender {
/**
* Check if the attribute should be printed.
- * @param desc RegistryDescriptor from this bean
- * @param descriptor PropertyDescriptor from this bean property
+ *
+ * @param desc RegistryDescriptor from this bean
+ * @param descriptor PropertyDescriptor from this bean property
* @param attributeName The attribute name to store
- * @param bean The current bean
- * @param bean2 A default instance of the bean for comparison
+ * @param bean The current bean
+ * @param bean2 A default instance of the bean for comparison
+ *
* @return null if the value should be skipped, the value to print otherwise
*/
- protected Object checkAttribute(StoreDescription desc, PropertyDescriptor descriptor, String attributeName, Object bean, Object bean2) {
+ protected Object checkAttribute(StoreDescription desc, PropertyDescriptor descriptor, String attributeName,
+ Object bean, Object bean2) {
if (descriptor instanceof IndexedPropertyDescriptor) {
return null; // Indexed properties are not persisted
}
- if (!isPersistable(descriptor.getPropertyType())
- || (descriptor.getReadMethod() == null)
- || (descriptor.getWriteMethod() == null)) {
+ if (!isPersistable(descriptor.getPropertyType()) || (descriptor.getReadMethod() == null) ||
+ (descriptor.getWriteMethod() == null)) {
return null; // Must be a read-write primitive or String
}
if (desc.isTransientAttribute(descriptor.getName())) {
@@ -291,15 +280,16 @@ public class StoreAppender {
/**
* Store the specified of the specified JavaBean.
*
- * @param writer PrintWriter to which we are storing
- * @param indent Indentation level
- * @param bean The current bean
- * @param desc RegistryDescriptor from this bean
+ * @param writer PrintWriter to which we are storing
+ * @param indent Indentation level
+ * @param bean The current bean
+ * @param desc RegistryDescriptor from this bean
* @param attributeName The attribute name to store
- * @param bean2 A default instance of the bean for comparison
- * @param value The attribute value
+ * @param bean2 A default instance of the bean for comparison
+ * @param value The attribute value
*/
- protected void printAttribute(PrintWriter writer, int indent, Object bean, StoreDescription desc, String attributeName, Object bean2, Object value) {
+ protected void printAttribute(PrintWriter writer, int indent, Object bean, StoreDescription desc,
+ String attributeName, Object bean2, Object value) {
if (isPrintValue(bean, bean2, attributeName, desc)) {
printValue(writer, indent, attributeName, value);
}
@@ -308,18 +298,14 @@ public class StoreAppender {
/**
* Determine if the attribute value needs to be stored.
*
- * @param bean
- * original bean
- * @param bean2
- * default bean
- * @param attrName
- * attribute name
- * @param desc
- * StoreDescription from bean
+ * @param bean original bean
+ * @param bean2 default bean
+ * @param attrName attribute name
+ * @param desc StoreDescription from bean
+ *
* @return <code>true</code> if the value should be stored
*/
- public boolean isPrintValue(Object bean, Object bean2, String attrName,
- StoreDescription desc) {
+ public boolean isPrintValue(Object bean, Object bean2, String attrName, StoreDescription desc) {
return true;
}
@@ -327,7 +313,9 @@ public class StoreAppender {
* Generate default Instance for the specified bean.
*
* @param bean The bean
+ *
* @return an object from same class as bean parameter
+ *
* @throws ReflectiveOperationException Error creating a new instance
*/
public Object defaultInstance(Object bean) throws ReflectiveOperationException {
@@ -339,11 +327,10 @@ public class StoreAppender {
*
* @param writer PrintWriter to which we are storing
* @param indent Indentation level
- * @param name Attribute name
- * @param value Attribute value
+ * @param name Attribute name
+ * @param value Attribute value
*/
- public void printValue(PrintWriter writer, int indent, String name,
- Object value) {
+ public void printValue(PrintWriter writer, int indent, String name, Object value) {
// Convert IP addresses to strings so they will be persisted
if (value instanceof InetAddress) {
value = ((InetAddress) value).getHostAddress();
@@ -367,11 +354,10 @@ public class StoreAppender {
/**
- * Is the specified property type one for which we should generate a
- * persistence attribute?
+ * Is the specified property type one for which we should generate a persistence attribute?
+ *
+ * @param clazz Java class to be tested
*
- * @param clazz
- * Java class to be tested
* @return <code>true</code> if the specified class should be stored
*/
protected boolean isPersistable(Class<?> clazz) {
diff --git a/java/org/apache/catalina/storeconfig/StoreConfig.java b/java/org/apache/catalina/storeconfig/StoreConfig.java
index e7c0e1eb0a..61d82a2dba 100644
--- a/java/org/apache/catalina/storeconfig/StoreConfig.java
+++ b/java/org/apache/catalina/storeconfig/StoreConfig.java
@@ -35,13 +35,11 @@ import org.apache.juli.logging.LogFactory;
import org.apache.tomcat.util.res.StringManager;
/**
- * Store Server/Service/Host/Context at file or PrintWriter. Default server.xml
- * is at $catalina.base/conf/server.xml
+ * Store Server/Service/Host/Context at file or PrintWriter. Default server.xml is at $catalina.base/conf/server.xml
*/
public class StoreConfig implements IStoreConfig {
private static Log log = LogFactory.getLog(StoreConfig.class);
- protected static final StringManager sm = StringManager
- .getManager(Constants.Package);
+ protected static final StringManager sm = StringManager.getManager(Constants.Package);
private String serverFilename = "conf/server.xml";
@@ -95,16 +93,15 @@ public class StoreConfig implements IStoreConfig {
/**
* Store Server from Object Name (Catalina:type=Server).
*
- * @param aServerName Server ObjectName
- * @param backup <code>true</code> to backup existing configuration files
- * before rewriting them
- * @param externalAllowed <code>true</code> to allow saving webapp
- * configuration for webapps that are not inside the host's app
- * directory
+ * @param aServerName Server ObjectName
+ * @param backup <code>true</code> to backup existing configuration files before rewriting them
+ * @param externalAllowed <code>true</code> to allow saving webapp configuration for webapps that are not inside the
+ * host's app directory
+ *
* @throws MalformedObjectNameException Bad MBean name
*/
- public synchronized void storeServer(String aServerName, boolean backup,
- boolean externalAllowed) throws MalformedObjectNameException {
+ public synchronized void storeServer(String aServerName, boolean backup, boolean externalAllowed)
+ throws MalformedObjectNameException {
if (aServerName == null || aServerName.length() == 0) {
log.error(sm.getString("config.emptyObjectName"));
return;
@@ -113,8 +110,7 @@ public class StoreConfig implements IStoreConfig {
ObjectName objectName = new ObjectName(aServerName);
if (mserver.isRegistered(objectName)) {
try {
- Server aServer = (Server) mserver.getAttribute(objectName,
- "managedResource");
+ Server aServer = (Server) mserver.getAttribute(objectName, "managedResource");
StoreDescription desc = null;
desc = getRegistry().findDescription(StandardContext.class);
if (desc != null) {
@@ -145,16 +141,15 @@ public class StoreConfig implements IStoreConfig {
/**
* Store a Context from ObjectName.
*
- * @param aContextName MBean ObjectName
- * @param backup <code>true</code> to backup existing configuration files
- * before rewriting them
- * @param externalAllowed <code>true</code> to allow saving webapp
- * configuration for webapps that are not inside the host's app
- * directory
+ * @param aContextName MBean ObjectName
+ * @param backup <code>true</code> to backup existing configuration files before rewriting them
+ * @param externalAllowed <code>true</code> to allow saving webapp configuration for webapps that are not inside the
+ * host's app directory
+ *
* @throws MalformedObjectNameException Bad MBean name
*/
- public synchronized void storeContext(String aContextName, boolean backup,
- boolean externalAllowed) throws MalformedObjectNameException {
+ public synchronized void storeContext(String aContextName, boolean backup, boolean externalAllowed)
+ throws MalformedObjectNameException {
if (aContextName == null || aContextName.length() == 0) {
log.error(sm.getString("config.emptyObjectName"));
return;
@@ -163,24 +158,20 @@ public class StoreConfig implements IStoreConfig {
ObjectName objectName = new ObjectName(aContextName);
if (mserver.isRegistered(objectName)) {
try {
- Context aContext = (Context) mserver.getAttribute(objectName,
- "managedResource");
+ Context aContext = (Context) mserver.getAttribute(objectName, "managedResource");
URL configFile = aContext.getConfigFile();
if (configFile != null) {
StoreDescription desc = null;
- desc = getRegistry().findDescription(
- aContext.getClass());
+ desc = getRegistry().findDescription(aContext.getClass());
if (desc != null) {
boolean oldSeparate = desc.isStoreSeparate();
boolean oldBackup = desc.isBackup();
- boolean oldExternalAllowed = desc
- .isExternalAllowed();
+ boolean oldExternalAllowed = desc.isExternalAllowed();
try {
desc.setStoreSeparate(true);
desc.setBackup(backup);
desc.setExternalAllowed(externalAllowed);
- desc.getStoreFactory()
- .store(null, -2, aContext);
+ desc.getStoreFactory().store(null, -2, aContext);
} finally {
desc.setStoreSeparate(oldSeparate);
desc.setBackup(oldBackup);
@@ -200,8 +191,8 @@ public class StoreConfig implements IStoreConfig {
@Override
public synchronized boolean store(Server aServer) {
- StoreFileMover mover = new StoreFileMover(Bootstrap.getCatalinaBase(),
- getServerFilename(), getRegistry().getEncoding());
+ StoreFileMover mover =
+ new StoreFileMover(Bootstrap.getCatalinaBase(), getServerFilename(), getRegistry().getEncoding());
// Open an output writer for the new configuration file
try {
try (PrintWriter writer = mover.getWriter()) {
@@ -237,8 +228,7 @@ public class StoreConfig implements IStoreConfig {
}
@Override
- public void store(PrintWriter aWriter, int indent,
- Context aContext) throws Exception {
+ public void store(PrintWriter aWriter, int indent, Context aContext) throws Exception {
boolean oldSeparate = true;
StoreDescription desc = null;
try {
@@ -258,10 +248,8 @@ public class StoreConfig implements IStoreConfig {
}
@Override
- public void store(PrintWriter aWriter, int indent, Host aHost)
- throws Exception {
- StoreDescription desc = getRegistry().findDescription(
- aHost.getClass());
+ public void store(PrintWriter aWriter, int indent, Host aHost) throws Exception {
+ StoreDescription desc = getRegistry().findDescription(aHost.getClass());
if (desc != null) {
desc.getStoreFactory().store(aWriter, indent, aHost);
} else {
@@ -270,10 +258,8 @@ public class StoreConfig implements IStoreConfig {
}
@Override
- public void store(PrintWriter aWriter, int indent,
- Service aService) throws Exception {
- StoreDescription desc = getRegistry().findDescription(
- aService.getClass());
+ public void store(PrintWriter aWriter, int indent, Service aService) throws Exception {
+ StoreDescription desc = getRegistry().findDescription(aService.getClass());
if (desc != null) {
desc.getStoreFactory().store(aWriter, indent, aService);
} else {
@@ -282,10 +268,8 @@ public class StoreConfig implements IStoreConfig {
}
@Override
- public void store(PrintWriter writer, int indent,
- Server aServer) throws Exception {
- StoreDescription desc = getRegistry().findDescription(
- aServer.getClass());
+ public void store(PrintWriter writer, int indent, Server aServer) throws Exception {
+ StoreDescription desc = getRegistry().findDescription(aServer.getClass());
if (desc != null) {
desc.getStoreFactory().store(writer, indent, aServer);
} else {
diff --git a/java/org/apache/catalina/storeconfig/StoreConfigLifecycleListener.java b/java/org/apache/catalina/storeconfig/StoreConfigLifecycleListener.java
index a55c8c99a4..384498a44a 100644
--- a/java/org/apache/catalina/storeconfig/StoreConfigLifecycleListener.java
+++ b/java/org/apache/catalina/storeconfig/StoreConfigLifecycleListener.java
@@ -31,8 +31,7 @@ import org.apache.tomcat.util.modeler.Registry;
import org.apache.tomcat.util.res.StringManager;
/**
- * Loads and registers a StoreConfig MBean with the name
- * <i>Catalina:type=StoreConfig</i>.
+ * Loads and registers a StoreConfig MBean with the name <i>Catalina:type=StoreConfig</i>.
* <p>
* This listener must only be nested within {@link Server} elements.
*/
@@ -65,8 +64,8 @@ public class StoreConfigLifecycleListener implements LifecycleListener {
if (event.getSource() instanceof Server) {
createMBean((Server) event.getSource());
} else {
- log.warn(sm.getString("storeConfigListener.notServer",
- event.getLifecycle().getClass().getSimpleName()));
+ log.warn(
+ sm.getString("storeConfigListener.notServer", event.getLifecycle().getClass().getSimpleName()));
}
} else if (Lifecycle.AFTER_STOP_EVENT.equals(event.getType())) {
if (oname != null) {
@@ -74,18 +73,17 @@ public class StoreConfigLifecycleListener implements LifecycleListener {
oname = null;
}
}
- }
+ }
/**
- * Create StoreConfig MBean and load StoreRegistry MBeans name is
- * <code>Catalina:type=StoreConfig</code>.
+ * Create StoreConfig MBean and load StoreRegistry MBeans name is <code>Catalina:type=StoreConfig</code>.
+ *
* @param server The Server instance
*/
protected void createMBean(Server server) {
StoreLoader loader = new StoreLoader();
try {
- Class<?> clazz = Class.forName(getStoreConfigClass(), true, this
- .getClass().getClassLoader());
+ Class<?> clazz = Class.forName(getStoreConfigClass(), true, this.getClass().getClassLoader());
storeConfig = (IStoreConfig) clazz.getConstructor().newInstance();
loader.load(getStoreRegistry());
// use the loader Registry
@@ -97,7 +95,7 @@ public class StoreConfigLifecycleListener implements LifecycleListener {
}
try {
// Note: Hard-coded domain used since this object is per Server/JVM
- oname = new ObjectName("Catalina:type=StoreConfig" );
+ oname = new ObjectName("Catalina:type=StoreConfig");
registry.registerComponent(storeConfig, oname, "StoreConfig");
} catch (Exception ex) {
log.error(sm.getString("storeConfigListener.registerError"), ex);
@@ -108,7 +106,9 @@ public class StoreConfigLifecycleListener implements LifecycleListener {
* Create a ManagedBean (StoreConfig).
*
* @param object The object to manage
+ *
* @return an MBean wrapping the object
+ *
* @throws Exception if an error occurred
*/
protected DynamicMBean getManagedBean(Object object) throws Exception {
@@ -124,8 +124,7 @@ public class StoreConfigLifecycleListener implements LifecycleListener {
}
/**
- * @param storeConfig
- * The storeConfig to set.
+ * @param storeConfig The storeConfig to set.
*/
public void setStoreConfig(IStoreConfig storeConfig) {
this.storeConfig = storeConfig;
@@ -139,8 +138,7 @@ public class StoreConfigLifecycleListener implements LifecycleListener {
}
/**
- * @param storeConfigClass
- * The storeConfigClass to set.
+ * @param storeConfigClass The storeConfigClass to set.
*/
public void setStoreConfigClass(String storeConfigClass) {
this.storeConfigClass = storeConfigClass;
@@ -154,8 +152,7 @@ public class StoreConfigLifecycleListener implements LifecycleListener {
}
/**
- * @param storeRegistry
- * The storeRegistry to set.
+ * @param storeRegistry The storeRegistry to set.
*/
public void setStoreRegistry(String storeRegistry) {
this.storeRegistry = storeRegistry;
diff --git a/java/org/apache/catalina/storeconfig/StoreContextAppender.java b/java/org/apache/catalina/storeconfig/StoreContextAppender.java
index f313d79409..502c700353 100644
--- a/java/org/apache/catalina/storeconfig/StoreContextAppender.java
+++ b/java/org/apache/catalina/storeconfig/StoreContextAppender.java
@@ -31,17 +31,17 @@ import org.apache.catalina.core.StandardHost;
public class StoreContextAppender extends StoreAppender {
/**
- * {@inheritDoc}
- * Adds special handling for <code>docBase</code>.
+ * {@inheritDoc} Adds special handling for <code>docBase</code>.
*/
@Override
- protected void printAttribute(PrintWriter writer, int indent, Object bean, StoreDescription desc, String attributeName, Object bean2, Object value) {
+ protected void printAttribute(PrintWriter writer, int indent, Object bean, StoreDescription desc,
+ String attributeName, Object bean2, Object value) {
if (isPrintValue(bean, bean2, attributeName, desc)) {
- if(attributeName.equals("docBase")) {
- if(bean instanceof StandardContext) {
- String docBase = ((StandardContext)bean).getOriginalDocBase() ;
- if(docBase != null) {
- value = docBase ;
+ if (attributeName.equals("docBase")) {
+ if (bean instanceof StandardContext) {
+ String docBase = ((StandardContext) bean).getOriginalDocBase();
+ if (docBase != null) {
+ value = docBase;
}
}
}
@@ -50,14 +50,17 @@ public class StoreContextAppender extends StoreAppender {
}
/**
- * Print Context Values. <ul><li> Special handling to default workDir.
- * </li><li> Don't save path at external context.xml </li><li> Don't
- * generate docBase for host.appBase webapps <LI></ul>
+ * Print Context Values.
+ * <ul>
+ * <li>Special handling to default workDir.</li>
+ * <li>Don't save path at external context.xml</li>
+ * <li>Don't generate docBase for host.appBase webapps
+ * <LI>
+ * </ul>
* {@inheritDoc}
*/
@Override
- public boolean isPrintValue(Object bean, Object bean2, String attrName,
- StoreDescription desc) {
+ public boolean isPrintValue(Object bean, Object bean2, String attrName, StoreDescription desc) {
boolean isPrint = super.isPrintValue(bean, bean2, attrName, desc);
if (isPrint) {
StandardContext context = ((StandardContext) bean);
@@ -67,14 +70,12 @@ public class StoreContextAppender extends StoreAppender {
isPrint = !defaultWorkDir.equals(context.getWorkDir());
}
} else if ("path".equals(attrName)) {
- isPrint = desc.isStoreSeparate()
- && desc.isExternalAllowed()
- && context.getConfigFile() == null;
+ isPrint = desc.isStoreSeparate() && desc.isExternalAllowed() && context.getConfigFile() == null;
} else if ("docBase".equals(attrName)) {
Container host = context.getParent();
if (host instanceof StandardHost) {
File appBase = getAppBase(((StandardHost) host));
- File docBase = getDocBase(context,appBase);
+ File docBase = getDocBase(context, appBase);
isPrint = !appBase.equals(docBase.getParentFile());
}
}
@@ -87,8 +88,7 @@ public class StoreContextAppender extends StoreAppender {
File appBase;
File file = new File(host.getAppBase());
if (!file.isAbsolute()) {
- file = new File(System.getProperty(Globals.CATALINA_BASE_PROP), host
- .getAppBase());
+ file = new File(System.getProperty(Globals.CATALINA_BASE_PROP), host.getAppBase());
}
try {
appBase = file.getCanonicalFile();
@@ -101,9 +101,9 @@ public class StoreContextAppender extends StoreAppender {
protected File getDocBase(StandardContext context, File appBase) {
File docBase;
- String contextDocBase = context.getOriginalDocBase() ;
- if(contextDocBase == null) {
- contextDocBase = context.getDocBase() ;
+ String contextDocBase = context.getOriginalDocBase();
+ if (contextDocBase == null) {
+ contextDocBase = context.getDocBase();
}
File file = new File(contextDocBase);
if (!file.isAbsolute()) {
@@ -121,6 +121,7 @@ public class StoreContextAppender extends StoreAppender {
* Make default Work Dir.
*
* @param context The context
+ *
* @return The default working directory for the context.
*/
protected String getDefaultWorkDir(StandardContext context) {
@@ -141,19 +142,21 @@ public class StoreContextAppender extends StoreAppender {
} else {
String engineName = context.getParent().getParent().getName();
String hostName = context.getParent().getName();
- defaultWorkDir = "work" + File.separator + engineName
- + File.separator + hostName + File.separator
- + contextWorkDir;
+ defaultWorkDir = "work" + File.separator + engineName + File.separator + hostName + File.separator +
+ contextWorkDir;
}
}
return defaultWorkDir;
}
/**
- * Generate a real default StandardContext TODO read and interpret the
- * default context.xml and context.xml.default TODO Cache a Default
- * StandardContext ( with reloading strategy) TODO remove really all
- * elements, but detection is hard... To Listener or Valve from same class?
+ * Generate a real default StandardContext
+ * <p>
+ * TODO read and interpret the default context.xml and context.xml.default
+ * <p>
+ * TODO Cache a Default StandardContext ( with reloading strategy)
+ * <p>
+ * TODO remove really all elements, but detection is hard... To Listener or Valve from same class?
*
* @see org.apache.catalina.storeconfig.StoreAppender#defaultInstance(java.lang.Object)
*/
@@ -161,17 +164,18 @@ public class StoreContextAppender extends StoreAppender {
public Object defaultInstance(Object bean) throws ReflectiveOperationException {
if (bean instanceof StandardContext) {
StandardContext defaultContext = new StandardContext();
+ // @formatter:off
/*
* if (!((StandardContext) bean).getOverride()) {
- * defaultContext.setParent(((StandardContext)bean).getParent());
- * ContextConfig contextConfig = new ContextConfig();
- * defaultContext.addLifecycleListener(contextConfig);
- * contextConfig.setContext(defaultContext);
- * contextConfig.processContextConfig(new File(contextConfig
- * .getBaseDir(), "conf/context.xml"));
- * contextConfig.processContextConfig(new File(contextConfig
- * .getConfigBase(), "context.xml.default")); }
+ * defaultContext.setParent(((StandardContext)bean).getParent());
+ * ContextConfig contextConfig = new ContextConfig();
+ * defaultContext.addLifecycleListener(contextConfig);
+ * contextConfig.setContext(defaultContext);
+ * contextConfig.processContextConfig(new File(contextConfig.getBaseDir(), "conf/context.xml"));
+ * contextConfig.processContextConfig(new File(contextConfig.getConfigBase(), "context.xml.default"));
+ * }
*/
+ // @formatter:on
return defaultContext;
} else {
return super.defaultInstance(bean);
diff --git a/java/org/apache/catalina/storeconfig/StoreDescription.java b/java/org/apache/catalina/storeconfig/StoreDescription.java
index d308a59ec5..f5378aa2e9 100644
--- a/java/org/apache/catalina/storeconfig/StoreDescription.java
+++ b/java/org/apache/catalina/storeconfig/StoreDescription.java
@@ -50,8 +50,6 @@ import java.util.List;
* <TransientAttribute>startupTime</TransientAttribute>
* <TransientAttribute>tldScanTime</TransientAttribute>
* </Description>
- *
- *
* </pre>
*/
public class StoreDescription {
@@ -96,8 +94,7 @@ public class StoreDescription {
}
/**
- * @param external
- * The external to set.
+ * @param external The external to set.
*/
public void setExternalAllowed(boolean external) {
this.externalAllowed = external;
@@ -119,8 +116,7 @@ public class StoreDescription {
}
/**
- * @param standard
- * The standard to set.
+ * @param standard The standard to set.
*/
public void setStandard(boolean standard) {
this.standard = standard;
@@ -134,8 +130,7 @@ public class StoreDescription {
}
/**
- * @param backup
- * The backup to set.
+ * @param backup The backup to set.
*/
public void setBackup(boolean backup) {
this.backup = backup;
@@ -149,8 +144,7 @@ public class StoreDescription {
}
/**
- * @param aDefault
- * The myDefault to set.
+ * @param aDefault The myDefault to set.
*/
public void setDefault(boolean aDefault) {
this.myDefault = aDefault;
@@ -164,8 +158,7 @@ public class StoreDescription {
}
/**
- * @param storeFactoryClass
- * The storeFactory to set.
+ * @param storeFactoryClass The storeFactory to set.
*/
public void setStoreFactoryClass(String storeFactoryClass) {
this.storeFactoryClass = storeFactoryClass;
@@ -179,8 +172,7 @@ public class StoreDescription {
}
/**
- * @param storeFactory
- * The storeFactory to set.
+ * @param storeFactory The storeFactory to set.
*/
public void setStoreFactory(IStoreFactory storeFactory) {
this.storeFactory = storeFactory;
@@ -194,8 +186,7 @@ public class StoreDescription {
}
/**
- * @param storeWriterClass
- * The storeWriterClass to set.
+ * @param storeWriterClass The storeWriterClass to set.
*/
public void setStoreWriterClass(String storeWriterClass) {
this.storeWriterClass = storeWriterClass;
@@ -209,8 +200,7 @@ public class StoreDescription {
}
/**
- * @param tag
- * The tag to set.
+ * @param tag The tag to set.
*/
public void setTag(String tag) {
this.tag = tag;
@@ -224,8 +214,7 @@ public class StoreDescription {
}
/**
- * @param tagClass
- * The tagClass to set.
+ * @param tagClass The tagClass to set.
*/
public void setTagClass(String tagClass) {
this.tagClass = tagClass;
@@ -239,8 +228,7 @@ public class StoreDescription {
}
/**
- * @param transientAttributes
- * The transientAttributes to set.
+ * @param transientAttributes The transientAttributes to set.
*/
public void setTransientAttributes(List<String> transientAttributes) {
this.transientAttributes = transientAttributes;
@@ -267,8 +255,7 @@ public class StoreDescription {
}
/**
- * @param transientChildren
- * The transientChildren to set.
+ * @param transientChildren The transientChildren to set.
*/
public void setTransientChildren(List<String> transientChildren) {
this.transientChildren = transientChildren;
@@ -291,6 +278,7 @@ public class StoreDescription {
* Is child transient, please don't save this.
*
* @param classname The class name to check
+ *
* @return is classname attribute?
*/
public boolean isTransientChild(String classname) {
@@ -304,6 +292,7 @@ public class StoreDescription {
* Is attribute transient, please don't save this.
*
* @param attribute The attribute name to check
+ *
* @return is transient attribute?
*/
public boolean isTransientAttribute(String attribute) {
@@ -327,8 +316,7 @@ public class StoreDescription {
}
/**
- * @param id
- * The id to set.
+ * @param id The id to set.
*/
public void setId(String id) {
this.id = id;
@@ -342,8 +330,7 @@ public class StoreDescription {
}
/**
- * @param attributes
- * The attributes to set.
+ * @param attributes The attributes to set.
*/
public void setAttributes(boolean attributes) {
this.attributes = attributes;
@@ -368,8 +355,7 @@ public class StoreDescription {
}
/**
- * @param children
- * The children to set.
+ * @param children The children to set.
*/
public void setChildren(boolean children) {
this.children = children;
diff --git a/java/org/apache/catalina/storeconfig/StoreFactoryBase.java b/java/org/apache/catalina/storeconfig/StoreFactoryBase.java
index 0aba266da1..fff7ca0f77 100644
--- a/java/org/apache/catalina/storeconfig/StoreFactoryBase.java
+++ b/java/org/apache/catalina/storeconfig/StoreFactoryBase.java
@@ -24,8 +24,7 @@ import org.apache.juli.logging.LogFactory;
import org.apache.tomcat.util.res.StringManager;
/**
- * StoreFactory saves special elements.
- * Output was generate with StoreAppenders.
+ * StoreFactory saves special elements. Output was generate with StoreAppenders.
*/
public class StoreFactoryBase implements IStoreFactory {
private static Log log = LogFactory.getLog(StoreFactoryBase.class);
@@ -37,8 +36,7 @@ public class StoreFactoryBase implements IStoreFactory {
/**
* The string manager for this package.
*/
- protected static final StringManager sm = StringManager
- .getManager(Constants.Package);
+ protected static final StringManager sm = StringManager.getManager(Constants.Package);
/**
* The descriptive information string for this implementation.
@@ -46,9 +44,8 @@ public class StoreFactoryBase implements IStoreFactory {
private static final String info = "org.apache.catalina.config.StoreFactoryBase/1.0";
/**
- * @return descriptive information about this Factory implementation and the
- * corresponding version number, in the format
- * <code><description>/<version></code>.
+ * @return descriptive information about this Factory implementation and the corresponding version number, in the
+ * format <code><description>/<version></code>.
*/
public String getInfo() {
return info;
@@ -85,89 +82,80 @@ public class StoreFactoryBase implements IStoreFactory {
}
@Override
- public void store(PrintWriter aWriter, int indent, Object aElement)
- throws Exception {
+ public void store(PrintWriter aWriter, int indent, Object aElement) throws Exception {
- StoreDescription elementDesc = getRegistry().findDescription(
- aElement.getClass());
+ StoreDescription elementDesc = getRegistry().findDescription(aElement.getClass());
if (elementDesc != null) {
if (log.isTraceEnabled()) {
- log.trace(sm.getString("factory.storeTag",
- elementDesc.getTag(), aElement));
+ log.trace(sm.getString("factory.storeTag", elementDesc.getTag(), aElement));
}
getStoreAppender().printIndent(aWriter, indent + 2);
if (!elementDesc.isChildren()) {
- getStoreAppender().printTag(aWriter, indent, aElement,
- elementDesc);
+ getStoreAppender().printTag(aWriter, indent, aElement, elementDesc);
} else {
- getStoreAppender().printOpenTag(aWriter, indent + 2, aElement,
- elementDesc);
+ getStoreAppender().printOpenTag(aWriter, indent + 2, aElement, elementDesc);
storeChildren(aWriter, indent + 2, aElement, elementDesc);
getStoreAppender().printIndent(aWriter, indent + 2);
getStoreAppender().printCloseTag(aWriter, elementDesc);
}
} else {
- log.warn(sm.getString("factory.storeNoDescriptor", aElement
- .getClass()));
+ log.warn(sm.getString("factory.storeNoDescriptor", aElement.getClass()));
}
}
/**
* Must Implement at subclass for custom store children handling.
*
- * @param aWriter Current output writer
- * @param indent Indentation level
- * @param aElement Current element
+ * @param aWriter Current output writer
+ * @param indent Indentation level
+ * @param aElement Current element
* @param elementDesc The element description
+ *
* @throws Exception Configuration storing error
*/
- public void storeChildren(PrintWriter aWriter, int indent, Object aElement,
- StoreDescription elementDesc) throws Exception {
+ public void storeChildren(PrintWriter aWriter, int indent, Object aElement, StoreDescription elementDesc)
+ throws Exception {
}
/**
- * Store only elements from storeChildren methods that are not a transient
- * child.
+ * Store only elements from storeChildren methods that are not a transient child.
*
- * @param aWriter Current output writer
- * @param indent Indentation level
+ * @param aWriter Current output writer
+ * @param indent Indentation level
* @param aTagElement Current element
+ *
* @throws Exception Configuration storing error
*/
- protected void storeElement(PrintWriter aWriter, int indent,
- Object aTagElement) throws Exception {
+ protected void storeElement(PrintWriter aWriter, int indent, Object aTagElement) throws Exception {
if (aTagElement != null) {
- IStoreFactory elementFactory = getRegistry().findStoreFactory(
- aTagElement.getClass());
+ IStoreFactory elementFactory = getRegistry().findStoreFactory(aTagElement.getClass());
if (elementFactory != null) {
- StoreDescription desc = getRegistry().findDescription(
- aTagElement.getClass());
+ StoreDescription desc = getRegistry().findDescription(aTagElement.getClass());
if (desc != null) {
if (!desc.isTransientChild(aTagElement.getClass().getName())) {
elementFactory.store(aWriter, indent, aTagElement);
}
} else {
- log.warn(sm.getString("factory.storeNoDescriptor", aTagElement
- .getClass()));
+ log.warn(sm.getString("factory.storeNoDescriptor", aTagElement.getClass()));
}
} else {
- log.warn(sm.getString("factory.storeNoDescriptor", aTagElement
- .getClass()));
+ log.warn(sm.getString("factory.storeNoDescriptor", aTagElement.getClass()));
}
}
}
/**
* Save an array of elements.
- * @param aWriter Current output writer
- * @param indent Indentation level
+ *
+ * @param aWriter Current output writer
+ * @param indent Indentation level
* @param elements Array of elements
+ *
* @throws Exception Configuration storing error
*/
- protected void storeElementArray(PrintWriter aWriter, int indent,
- Object[] elements) throws Exception {
+ protected void storeElementArray(PrintWriter aWriter, int indent, Object[] elements) throws Exception {
if (elements != null) {
for (Object element : elements) {
try {
diff --git a/java/org/apache/catalina/storeconfig/StoreFactoryRule.java b/java/org/apache/catalina/storeconfig/StoreFactoryRule.java
index fcd08b1a93..9dec68e612 100644
--- a/java/org/apache/catalina/storeconfig/StoreFactoryRule.java
+++ b/java/org/apache/catalina/storeconfig/StoreFactoryRule.java
@@ -21,9 +21,8 @@ import org.xml.sax.Attributes;
/**
* <p>
- * Rule that creates a new <code>IStoreFactory</code> instance, and associates
- * it with the top object on the stack (which must implement
- * <code>IStoreFactory</code>).
+ * Rule that creates a new <code>IStoreFactory</code> instance, and associates it with the top object on the stack
+ * (which must implement <code>IStoreFactory</code>).
* </p>
*/
@@ -34,18 +33,14 @@ public class StoreFactoryRule extends Rule {
/**
* Construct a new instance of this Rule.
*
- * @param storeFactoryClass
- * Default name of the StoreFactory implementation class to be
- * created
- * @param attributeName
- * Name of the attribute that optionally includes an override
- * name of the IStoreFactory class
- * @param storeAppenderClass The store appender class
- * @param appenderAttributeName The attribute name for the store
- * appender class
+ * @param storeFactoryClass Default name of the StoreFactory implementation class to be created
+ * @param attributeName Name of the attribute that optionally includes an override name of the IStoreFactory
+ * class
+ * @param storeAppenderClass The store appender class
+ * @param appenderAttributeName The attribute name for the store appender class
*/
- public StoreFactoryRule(String storeFactoryClass, String attributeName,
- String storeAppenderClass, String appenderAttributeName) {
+ public StoreFactoryRule(String storeFactoryClass, String attributeName, String storeAppenderClass,
+ String appenderAttributeName) {
this.storeFactoryClass = storeFactoryClass;
this.attributeName = attributeName;
@@ -57,8 +52,7 @@ public class StoreFactoryRule extends Rule {
// ----------------------------------------------------- Instance Variables
/**
- * The attribute name of an attribute that can override the implementation
- * class name.
+ * The attribute name of an attribute that can override the implementation class name.
*/
private String attributeName;
@@ -74,13 +68,11 @@ public class StoreFactoryRule extends Rule {
// --------------------------------------------------------- Public Methods
@Override
- public void begin(String namespace, String name, Attributes attributes)
- throws Exception {
+ public void begin(String namespace, String name, Attributes attributes) throws Exception {
- IStoreFactory factory = (IStoreFactory) newInstance(attributeName,
- storeFactoryClass, attributes);
- StoreAppender storeAppender = (StoreAppender) newInstance(
- appenderAttributeName, storeAppenderClass, attributes);
+ IStoreFactory factory = (IStoreFactory) newInstance(attributeName, storeFactoryClass, attributes);
+ StoreAppender storeAppender =
+ (StoreAppender) newInstance(appenderAttributeName, storeAppenderClass, attributes);
factory.setStoreAppender(storeAppender);
// Add this StoreFactory to our associated component
@@ -94,14 +86,16 @@ public class StoreFactoryRule extends Rule {
/**
* Create new instance from attribute className!
*
- * @param attr class Name attribute
+ * @param attr class Name attribute
* @param defaultName Default Class
- * @param attributes current digester attribute elements
+ * @param attributes current digester attribute elements
+ *
* @return new configured object instance
+ *
* @throws ReflectiveOperationException Error creating an instance
*/
- protected Object newInstance(String attr, String defaultName,
- Attributes attributes) throws ReflectiveOperationException {
+ protected Object newInstance(String attr, String defaultName, Attributes attributes)
+ throws ReflectiveOperationException {
String className = defaultName;
if (attr != null) {
String value = attributes.getValue(attr);
diff --git a/java/org/apache/catalina/storeconfig/StoreFileMover.java b/java/org/apache/catalina/storeconfig/StoreFileMover.java
index 9d68e1c1c2..9e245f5fc0 100644
--- a/java/org/apache/catalina/storeconfig/StoreFileMover.java
+++ b/java/org/apache/catalina/storeconfig/StoreFileMover.java
@@ -28,7 +28,7 @@ import org.apache.tomcat.util.res.StringManager;
/**
* Move server.xml or context.xml as backup
- *
+ * <p>
* TODO Get Encoding from Registry
*/
public class StoreFileMover {
@@ -76,8 +76,7 @@ public class StoreFileMover {
}
/**
- * @param basename
- * The basename to set.
+ * @param basename The basename to set.
*/
public void setBasename(String basename) {
this.basename = basename;
@@ -113,6 +112,7 @@ public class StoreFileMover {
/**
* Calculate file objects for the old and new configuration files.
+ *
* @param basename The base path
* @param encoding The encoding of the file
* @param filename The file name
@@ -165,18 +165,18 @@ public class StoreFileMover {
if (configOld.renameTo(configSave)) {
if (!configNew.renameTo(configOld)) {
configSave.renameTo(configOld);
- throw new IOException(sm.getString("storeFileMover.renameError",
- configNew.getAbsolutePath(), configOld.getAbsolutePath()));
+ throw new IOException(sm.getString("storeFileMover.renameError", configNew.getAbsolutePath(),
+ configOld.getAbsolutePath()));
}
} else {
if (!configOld.exists()) {
if (!configNew.renameTo(configOld)) {
- throw new IOException(sm.getString("storeFileMover.renameError",
- configNew.getAbsolutePath(), configOld.getAbsolutePath()));
+ throw new IOException(sm.getString("storeFileMover.renameError", configNew.getAbsolutePath(),
+ configOld.getAbsolutePath()));
}
} else {
- throw new IOException(sm.getString("storeFileMover.renameError",
- configOld.getAbsolutePath(), configSave.getAbsolutePath()));
+ throw new IOException(sm.getString("storeFileMover.renameError", configOld.getAbsolutePath(),
+ configSave.getAbsolutePath()));
}
}
}
@@ -185,11 +185,11 @@ public class StoreFileMover {
* Open an output writer for the new configuration file.
*
* @return The writer
+ *
* @throws IOException Failed opening a writer to the new file
*/
public PrintWriter getWriter() throws IOException {
- return new PrintWriter(new OutputStreamWriter(
- new FileOutputStream(configNew), getEncoding()));
+ return new PrintWriter(new OutputStreamWriter(new FileOutputStream(configNew), getEncoding()));
}
/**
@@ -199,8 +199,8 @@ public class StoreFileMover {
*/
protected String getTimeTag() {
String ts = (new Timestamp(System.currentTimeMillis())).toString();
- // yyyy-mm-dd hh:mm:ss
- // 0123456789012345678
+ // yyyy-mm-dd hh:mm:ss
+ // 0123456789012345678
StringBuilder sb = new StringBuilder(".");
sb.append(ts, 0, 10);
sb.append('.');
diff --git a/java/org/apache/catalina/storeconfig/StoreLoader.java b/java/org/apache/catalina/storeconfig/StoreLoader.java
index bbbfdfc988..832433338c 100644
--- a/java/org/apache/catalina/storeconfig/StoreLoader.java
+++ b/java/org/apache/catalina/storeconfig/StoreLoader.java
@@ -48,11 +48,9 @@ import org.apache.tomcat.util.file.ConfigurationSource.Resource;
* }
* </pre>
*
- *
* Convention:
* <ul>
- * <li>Factories at subpackage <i>org.apache.catalina.core.storeconfig.xxxSF
- * </i>.</li>
+ * <li>Factories at subpackage <i>org.apache.catalina.core.storeconfig.xxxSF </i>.</li>
* <li>Element name are the unique Class name</li>
* <li>SF for StoreFactory</li>
* <li>standard implementation is false</li>
@@ -61,12 +59,9 @@ import org.apache.tomcat.util.file.ConfigurationSource.Resource;
* <ul>
* <li>Registry XML format is a very good option</li>
* <li>Store format is not fix</li>
- * <li>We hope with the parent declaration we can build recursive child store
- * operation //dream</li>
- * <li>Problem is to access child data from array,collections or normal detail
- * object</li>
- * <li>Default definitions for Listener, Valve Resource? - Based on interface
- * type!</li>
+ * <li>We hope with the parent declaration we can build recursive child store operation //dream</li>
+ * <li>Problem is to access child data from array,collections or normal detail object</li>
+ * <li>Default definitions for Listener, Valve Resource? - Based on interface type!</li>
* </ul>
*/
public class StoreLoader {
@@ -78,7 +73,7 @@ public class StoreLoader {
private StoreRegistry registry;
- private URL registryResource ;
+ private URL registryResource;
/**
* @return Returns the registry.
@@ -88,16 +83,15 @@ public class StoreLoader {
}
/**
- * @param registry
- * The registry to set.
+ * @param registry The registry to set.
*/
public void setRegistry(StoreRegistry registry) {
this.registry = registry;
}
/**
- * Create and configure the Digester we will be using for setup store
- * registry.
+ * Create and configure the Digester we will be using for setup store registry.
+ *
* @return the XML digester that will be used to parse the configuration
*/
protected static Digester createDigester() {
@@ -107,24 +101,18 @@ public class StoreLoader {
digester.setClassLoader(StoreRegistry.class.getClassLoader());
// Configure the actions we will be using
- digester.addObjectCreate("Registry",
- "org.apache.catalina.storeconfig.StoreRegistry", "className");
+ digester.addObjectCreate("Registry", "org.apache.catalina.storeconfig.StoreRegistry", "className");
digester.addSetProperties("Registry");
- digester.addObjectCreate("Registry/Description",
- "org.apache.catalina.storeconfig.StoreDescription",
- "className");
+ digester.addObjectCreate("Registry/Description", "org.apache.catalina.storeconfig.StoreDescription",
+ "className");
digester.addSetProperties("Registry/Description");
- digester.addRule("Registry/Description", new StoreFactoryRule(
- "org.apache.catalina.storeconfig.StoreFactoryBase",
- "storeFactoryClass",
- "org.apache.catalina.storeconfig.StoreAppender",
- "storeAppenderClass"));
+ digester.addRule("Registry/Description",
+ new StoreFactoryRule("org.apache.catalina.storeconfig.StoreFactoryBase", "storeFactoryClass",
+ "org.apache.catalina.storeconfig.StoreAppender", "storeAppenderClass"));
digester.addSetNext("Registry/Description", "registerDescription",
"org.apache.catalina.storeconfig.StoreDescription");
- digester.addCallMethod("Registry/Description/TransientAttribute",
- "addTransientAttribute", 0);
- digester.addCallMethod("Registry/Description/TransientChild",
- "addTransientChild", 0);
+ digester.addCallMethod("Registry/Description/TransientAttribute", "addTransientAttribute", 0);
+ digester.addCallMethod("Registry/Description/TransientChild", "addTransientChild", 0);
return digester;
@@ -133,26 +121,24 @@ public class StoreLoader {
/**
* Load registry configuration.
*
- * @param path Path to the configuration file, may be null to use the default
- * name server-registry.xml
+ * @param path Path to the configuration file, may be null to use the default name server-registry.xml
+ *
* @throws Exception when the configuration file isn't found or a parse error occurs
*/
public void load(String path) throws Exception {
- try (Resource resource = (path == null) ?
- ConfigFileLoader.getSource().getConfResource("server-registry.xml")
- : ConfigFileLoader.getSource().getResource(path);
- InputStream is = resource.getInputStream()) {
+ try (Resource resource = (path == null) ? ConfigFileLoader.getSource().getConfResource("server-registry.xml") :
+ ConfigFileLoader.getSource().getResource(path); InputStream is = resource.getInputStream()) {
registryResource = resource.getURI().toURL();
synchronized (digester) {
registry = (StoreRegistry) digester.parse(is);
}
} catch (IOException e) {
// Try default classloader location
- try (InputStream is = StoreLoader.class
- .getResourceAsStream("/org/apache/catalina/storeconfig/server-registry.xml")) {
+ try (InputStream is =
+ StoreLoader.class.getResourceAsStream("/org/apache/catalina/storeconfig/server-registry.xml")) {
if (is != null) {
- registryResource = StoreLoader.class
- .getResource("/org/apache/catalina/storeconfig/server-registry.xml");
+ registryResource =
+ StoreLoader.class.getResource("/org/apache/catalina/storeconfig/server-registry.xml");
synchronized (digester) {
registry = (StoreRegistry) digester.parse(is);
}
diff --git a/java/org/apache/catalina/storeconfig/StoreRegistry.java b/java/org/apache/catalina/storeconfig/StoreRegistry.java
index 4865171d14..5829cac982 100644
--- a/java/org/apache/catalina/storeconfig/StoreRegistry.java
+++ b/java/org/apache/catalina/storeconfig/StoreRegistry.java
@@ -52,7 +52,7 @@ public class StoreRegistry {
private static Log log = LogFactory.getLog(StoreRegistry.class);
private static StringManager sm = StringManager.getManager(StoreRegistry.class);
- private Map<String, StoreDescription> descriptors = new HashMap<>();
+ private Map<String,StoreDescription> descriptors = new HashMap<>();
private String encoding = "UTF-8";
@@ -61,15 +61,11 @@ public class StoreRegistry {
private String version;
// Access Information
- private static Class<?> interfaces[] = { CatalinaCluster.class,
- ChannelSender.class, ChannelReceiver.class, Channel.class,
- MembershipService.class, ClusterDeployer.class, Realm.class,
- Manager.class, DirContext.class, LifecycleListener.class,
- Valve.class, ClusterListener.class, MessageListener.class,
- DataSender.class, ChannelInterceptor.class, Member.class,
- WebResourceRoot.class, WebResourceSet.class,
- CredentialHandler.class, UpgradeProtocol.class,
- CookieProcessor.class };
+ private static Class<?> interfaces[] = { CatalinaCluster.class, ChannelSender.class, ChannelReceiver.class,
+ Channel.class, MembershipService.class, ClusterDeployer.class, Realm.class, Manager.class, DirContext.class,
+ LifecycleListener.class, Valve.class, ClusterListener.class, MessageListener.class, DataSender.class,
+ ChannelInterceptor.class, Member.class, WebResourceRoot.class, WebResourceSet.class,
+ CredentialHandler.class, UpgradeProtocol.class, CookieProcessor.class };
/**
* @return the name
@@ -100,10 +96,10 @@ public class StoreRegistry {
}
/**
- * Find a description for id. Handle interface search when no direct match
- * found.
+ * Find a description for id. Handle interface search when no direct match found.
*
* @param id The class name
+ *
* @return the description
*/
public StoreDescription findDescription(String id) {
@@ -129,8 +125,7 @@ public class StoreRegistry {
}
if (log.isDebugEnabled()) {
if (desc != null) {
- log.trace("find descriptor " + id + "#" + desc.getTag() + "#"
- + desc.getStoreFactoryClass());
+ log.trace("find descriptor " + id + "#" + desc.getTag() + "#" + desc.getStoreFactoryClass());
} else {
log.debug(sm.getString("registry.noDescriptor", id));
}
@@ -142,6 +137,7 @@ public class StoreRegistry {
* Find Description by class.
*
* @param aClass The class
+ *
* @return the description
*/
public StoreDescription findDescription(Class<?> aClass) {
@@ -152,6 +148,7 @@ public class StoreRegistry {
* Find factory from class name.
*
* @param aClassName The class name
+ *
* @return the factory
*/
public IStoreFactory findStoreFactory(String aClassName) {
@@ -168,6 +165,7 @@ public class StoreRegistry {
* Find factory from class.
*
* @param aClass The class
+ *
* @return the factory
*/
public IStoreFactory findStoreFactory(Class<?> aClass) {
@@ -186,8 +184,7 @@ public class StoreRegistry {
}
descriptors.put(key, desc);
if (log.isTraceEnabled()) {
- log.trace("register store descriptor " + key + "#" + desc.getTag()
- + "#" + desc.getTagClass());
+ log.trace("register store descriptor " + key + "#" + desc.getTag() + "#" + desc.getTagClass());
}
}
@@ -195,6 +192,7 @@ public class StoreRegistry {
* Unregister a description.
*
* @param desc The description
+ *
* @return the description, or <code>null</code> if it was not registered
*/
public StoreDescription unregisterDescription(StoreDescription desc) {
@@ -216,6 +214,7 @@ public class StoreRegistry {
/**
* Set the encoding to use when writing the configuration files.
+ *
* @param string The encoding
*/
public void setEncoding(String string) {
diff --git a/java/org/apache/catalina/storeconfig/WatchedResourceSF.java b/java/org/apache/catalina/storeconfig/WatchedResourceSF.java
index a27c3e4965..a402f10343 100644
--- a/java/org/apache/catalina/storeconfig/WatchedResourceSF.java
+++ b/java/org/apache/catalina/storeconfig/WatchedResourceSF.java
@@ -26,19 +26,16 @@ public class WatchedResourceSF extends StoreFactoryBase {
private static Log log = LogFactory.getLog(WatchedResourceSF.class);
@Override
- public void store(PrintWriter aWriter, int indent, Object aElement)
- throws Exception {
+ public void store(PrintWriter aWriter, int indent, Object aElement) throws Exception {
if (aElement instanceof StandardContext) {
- StoreDescription elementDesc = getRegistry().findDescription(
- aElement.getClass().getName() + ".[WatchedResource]");
- String[] resources = ((StandardContext) aElement)
- .findWatchedResources();
+ StoreDescription elementDesc =
+ getRegistry().findDescription(aElement.getClass().getName() + ".[WatchedResource]");
+ String[] resources = ((StandardContext) aElement).findWatchedResources();
if (elementDesc != null) {
if (log.isTraceEnabled()) {
log.trace("store " + elementDesc.getTag() + "( " + aElement + " )");
}
- getStoreAppender().printTagArray(aWriter, "WatchedResource",
- indent, resources);
+ getStoreAppender().printTagArray(aWriter, "WatchedResource", indent, resources);
}
} else {
log.warn(sm.getString("storeFactory.noDescriptor", aElement.getClass(), "WatchedResource"));
diff --git a/java/org/apache/catalina/storeconfig/WebResourceRootSF.java b/java/org/apache/catalina/storeconfig/WebResourceRootSF.java
index a226faaf6c..6d03aab62f 100644
--- a/java/org/apache/catalina/storeconfig/WebResourceRootSF.java
+++ b/java/org/apache/catalina/storeconfig/WebResourceRootSF.java
@@ -28,47 +28,42 @@ public class WebResourceRootSF extends StoreFactoryBase {
/**
* Store the specified Resources children.
+ * <p>
* {@inheritDoc}
*/
@Override
- public void storeChildren(PrintWriter aWriter, int indent, Object aResourceRoot,
- StoreDescription parentDesc) throws Exception {
+ public void storeChildren(PrintWriter aWriter, int indent, Object aResourceRoot, StoreDescription parentDesc)
+ throws Exception {
if (aResourceRoot instanceof WebResourceRoot) {
WebResourceRoot resourceRoot = (WebResourceRoot) aResourceRoot;
// Store nested <PreResources> elements
WebResourceSet[] preResourcesArray = resourceRoot.getPreResources();
- StoreDescription preResourcesElementDesc = getRegistry().findDescription(
- WebResourceSet.class.getName()
- + ".[PreResources]");
+ StoreDescription preResourcesElementDesc =
+ getRegistry().findDescription(WebResourceSet.class.getName() + ".[PreResources]");
if (preResourcesElementDesc != null) {
for (WebResourceSet preResources : preResourcesArray) {
- preResourcesElementDesc.getStoreFactory().store(aWriter, indent,
- preResources);
+ preResourcesElementDesc.getStoreFactory().store(aWriter, indent, preResources);
}
}
// Store nested <JarResources> elements
WebResourceSet[] jarResourcesArray = resourceRoot.getJarResources();
- StoreDescription jarResourcesElementDesc = getRegistry().findDescription(
- WebResourceSet.class.getName()
- + ".[JarResources]");
+ StoreDescription jarResourcesElementDesc =
+ getRegistry().findDescription(WebResourceSet.class.getName() + ".[JarResources]");
if (jarResourcesElementDesc != null) {
for (WebResourceSet jarResources : jarResourcesArray) {
- jarResourcesElementDesc.getStoreFactory().store(aWriter, indent,
- jarResources);
+ jarResourcesElementDesc.getStoreFactory().store(aWriter, indent, jarResources);
}
}
// Store nested <PostResources> elements
WebResourceSet[] postResourcesArray = resourceRoot.getPostResources();
- StoreDescription postResourcesElementDesc = getRegistry().findDescription(
- WebResourceSet.class.getName()
- + ".[PostResources]");
+ StoreDescription postResourcesElementDesc =
+ getRegistry().findDescription(WebResourceSet.class.getName() + ".[PostResources]");
if (postResourcesElementDesc != null) {
for (WebResourceSet postResources : postResourcesArray) {
- postResourcesElementDesc.getStoreFactory().store(aWriter, indent,
- postResources);
+ postResourcesElementDesc.getStoreFactory().store(aWriter, indent, postResources);
}
}
diff --git a/java/org/apache/catalina/storeconfig/WrapperLifecycleSF.java b/java/org/apache/catalina/storeconfig/WrapperLifecycleSF.java
index 6c2839dd30..1267050cb5 100644
--- a/java/org/apache/catalina/storeconfig/WrapperLifecycleSF.java
+++ b/java/org/apache/catalina/storeconfig/WrapperLifecycleSF.java
@@ -26,19 +26,16 @@ public class WrapperLifecycleSF extends StoreFactoryBase {
private static Log log = LogFactory.getLog(WrapperLifecycleSF.class);
@Override
- public void store(PrintWriter aWriter, int indent, Object aElement)
- throws Exception {
+ public void store(PrintWriter aWriter, int indent, Object aElement) throws Exception {
if (aElement instanceof StandardContext) {
- StoreDescription elementDesc = getRegistry().findDescription(
- aElement.getClass().getName() + ".[WrapperLifecycle]");
- String[] listeners = ((StandardContext) aElement)
- .findWrapperLifecycles();
+ StoreDescription elementDesc =
+ getRegistry().findDescription(aElement.getClass().getName() + ".[WrapperLifecycle]");
+ String[] listeners = ((StandardContext) aElement).findWrapperLifecycles();
if (elementDesc != null) {
if (log.isTraceEnabled()) {
log.trace("store " + elementDesc.getTag() + "( " + aElement + " )");
}
- getStoreAppender().printTagArray(aWriter, "WrapperLifecycle",
- indent, listeners);
+ getStoreAppender().printTagArray(aWriter, "WrapperLifecycle", indent, listeners);
}
} else {
log.warn(sm.getString("storeFactory.noDescriptor", aElement.getClass(), "WrapperLifecycle"));
diff --git a/java/org/apache/catalina/storeconfig/WrapperListenerSF.java b/java/org/apache/catalina/storeconfig/WrapperListenerSF.java
index ae4d82af17..eee88e19e0 100644
--- a/java/org/apache/catalina/storeconfig/WrapperListenerSF.java
+++ b/java/org/apache/catalina/storeconfig/WrapperListenerSF.java
@@ -26,20 +26,16 @@ public class WrapperListenerSF extends StoreFactoryBase {
private static Log log = LogFactory.getLog(WrapperListenerSF.class);
@Override
- public void store(PrintWriter aWriter, int indent, Object aElement)
- throws Exception {
+ public void store(PrintWriter aWriter, int indent, Object aElement) throws Exception {
if (aElement instanceof StandardContext) {
- StoreDescription elementDesc = getRegistry().findDescription(
- aElement.getClass().getName() + ".[WrapperListener]");
- String[] listeners = ((StandardContext) aElement)
- .findWrapperListeners();
+ StoreDescription elementDesc =
+ getRegistry().findDescription(aElement.getClass().getName() + ".[WrapperListener]");
+ String[] listeners = ((StandardContext) aElement).findWrapperListeners();
if (elementDesc != null) {
if (log.isTraceEnabled()) {
- log.trace("store " + elementDesc.getTag() + "( " + aElement
- + " )");
+ log.trace("store " + elementDesc.getTag() + "( " + aElement + " )");
}
- getStoreAppender().printTagArray(aWriter, "WrapperListener",
- indent, listeners);
+ getStoreAppender().printTagArray(aWriter, "WrapperListener", indent, listeners);
}
} else {
log.warn(sm.getString("storeFactory.noDescriptor", aElement.getClass(), "WrapperListener"));
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
(tomcat) 04/04: Code clean-up - formatting - no functional change
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 942e0148ddbcb6735e17ec5037fdac2781d55ce9
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Fri May 3 08:18:29 2024 +0100
Code clean-up - formatting - no functional change
Re-applying formatting to previously formatted code
---
.../catalina/authenticator/AuthenticatorBase.java | 3 +-
.../catalina/authenticator/BasicAuthenticator.java | 4 +-
.../authenticator/SpnegoAuthenticator.java | 3 +-
java/org/apache/catalina/connector/Connector.java | 8 +-
.../org/apache/catalina/connector/InputBuffer.java | 4 +-
java/org/apache/catalina/connector/Request.java | 6 +-
java/org/apache/catalina/connector/Response.java | 1 -
.../catalina/core/ApplicationDispatcher.java | 3 +-
.../catalina/core/ApplicationFilterChain.java | 3 +-
.../catalina/core/ApplicationHttpRequest.java | 1 -
.../core/ApplicationSessionCookieConfig.java | 3 +-
.../catalina/core/OpenSSLLifecycleListener.java | 41 ++++----
.../core/PropertiesRoleMappingListener.java | 9 +-
java/org/apache/catalina/core/StandardContext.java | 7 +-
.../apache/catalina/core/StandardHostValve.java | 6 +-
java/org/apache/catalina/core/StandardServer.java | 11 +--
.../catalina/filters/CsrfPreventionFilter.java | 107 ++++++++-------------
java/org/apache/catalina/ha/CatalinaCluster.java | 1 +
java/org/apache/catalina/ha/ClusterManager.java | 7 +-
java/org/apache/catalina/ha/ClusterMessage.java | 2 +
.../apache/catalina/ha/deploy/FarmWarDeployer.java | 4 +-
.../ha/session/ClusterSessionListener.java | 1 +
.../apache/catalina/ha/session/DeltaSession.java | 2 +
.../catalina/ha/session/SessionMessageImpl.java | 1 +
.../apache/catalina/ha/tcp/ReplicationValve.java | 10 +-
.../apache/catalina/manager/StatusTransformer.java | 70 +++++++++-----
java/org/apache/catalina/mbeans/MBeanUtils.java | 5 +-
java/org/apache/catalina/realm/CombinedRealm.java | 3 +-
java/org/apache/catalina/realm/RealmBase.java | 19 ++--
.../apache/catalina/security/SecurityListener.java | 19 ++--
.../apache/catalina/session/DataSourceStore.java | 6 +-
.../startup/CatalinaBaseConfigurationSource.java | 3 +-
java/org/apache/catalina/startup/Tomcat.java | 9 +-
33 files changed, 196 insertions(+), 186 deletions(-)
diff --git a/java/org/apache/catalina/authenticator/AuthenticatorBase.java b/java/org/apache/catalina/authenticator/AuthenticatorBase.java
index e52fa2f109..fc8b13cd7a 100644
--- a/java/org/apache/catalina/authenticator/AuthenticatorBase.java
+++ b/java/org/apache/catalina/authenticator/AuthenticatorBase.java
@@ -975,7 +975,8 @@ public abstract class AuthenticatorBase extends ValveBase implements Authenticat
associate(ssoId, request.getSessionInternal(true));
if (log.isDebugEnabled()) {
- log.debug(sm.getString("authenticator.reauthentication", request.getUserPrincipal().getName(), request.getAuthType()));
+ log.debug(sm.getString("authenticator.reauthentication", request.getUserPrincipal().getName(),
+ request.getAuthType()));
}
}
diff --git a/java/org/apache/catalina/authenticator/BasicAuthenticator.java b/java/org/apache/catalina/authenticator/BasicAuthenticator.java
index 8421dc54b1..17c4a85857 100644
--- a/java/org/apache/catalina/authenticator/BasicAuthenticator.java
+++ b/java/org/apache/catalina/authenticator/BasicAuthenticator.java
@@ -145,8 +145,8 @@ public class BasicAuthenticator extends AuthenticatorBase {
/**
* Parse the HTTP Authorization header for BASIC authentication as per RFC 7617.
*
- * @param input The header value to parse in-place
- * @param charset The character set to use to convert the bytes to a string
+ * @param input The header value to parse in-place
+ * @param charset The character set to use to convert the bytes to a string
*
* @throws IllegalArgumentException If the header does not conform to RFC 7617
*/
diff --git a/java/org/apache/catalina/authenticator/SpnegoAuthenticator.java b/java/org/apache/catalina/authenticator/SpnegoAuthenticator.java
index dab5cdfed3..9e4537ce0c 100644
--- a/java/org/apache/catalina/authenticator/SpnegoAuthenticator.java
+++ b/java/org/apache/catalina/authenticator/SpnegoAuthenticator.java
@@ -266,7 +266,8 @@ public class SpnegoAuthenticator extends AuthenticatorBase {
}
// Send response token on success and failure
- response.setHeader(AUTH_HEADER_NAME, AUTH_HEADER_VALUE_NEGOTIATE + " " + Base64.getEncoder().encodeToString(outToken));
+ response.setHeader(AUTH_HEADER_NAME,
+ AUTH_HEADER_VALUE_NEGOTIATE + " " + Base64.getEncoder().encodeToString(outToken));
if (principal != null) {
register(request, response, principal, Constants.SPNEGO_METHOD, principal.getName(), null);
diff --git a/java/org/apache/catalina/connector/Connector.java b/java/org/apache/catalina/connector/Connector.java
index 64de9046cc..f2c6df6635 100644
--- a/java/org/apache/catalina/connector/Connector.java
+++ b/java/org/apache/catalina/connector/Connector.java
@@ -1009,14 +1009,14 @@ public class Connector extends LifecycleMBeanBase {
setParseBodyMethods(getParseBodyMethods());
}
- if (JreCompat.isJre22Available() && OpenSSLStatus.getUseOpenSSL() && OpenSSLStatus.isAvailable()
- && protocolHandler instanceof AbstractHttp11Protocol) {
+ if (JreCompat.isJre22Available() && OpenSSLStatus.getUseOpenSSL() && OpenSSLStatus.isAvailable() &&
+ protocolHandler instanceof AbstractHttp11Protocol) {
// Use FFM and OpenSSL if available
AbstractHttp11Protocol<?> jsseProtocolHandler = (AbstractHttp11Protocol<?>) protocolHandler;
if (jsseProtocolHandler.isSSLEnabled() && jsseProtocolHandler.getSslImplementationName() == null) {
// OpenSSL is compatible with the JSSE configuration, so use it if it is available
- jsseProtocolHandler.setSslImplementationName
- ("org.apache.tomcat.util.net.openssl.panama.OpenSSLImplementation");
+ jsseProtocolHandler
+ .setSslImplementationName("org.apache.tomcat.util.net.openssl.panama.OpenSSLImplementation");
}
} else if (AprStatus.isAprAvailable() && AprStatus.getUseOpenSSL() &&
protocolHandler instanceof AbstractHttp11Protocol) {
diff --git a/java/org/apache/catalina/connector/InputBuffer.java b/java/org/apache/catalina/connector/InputBuffer.java
index da8fa7fd98..45d64bc8e5 100644
--- a/java/org/apache/catalina/connector/InputBuffer.java
+++ b/java/org/apache/catalina/connector/InputBuffer.java
@@ -308,7 +308,7 @@ public class InputBuffer extends Reader implements ByteChunk.ByteInputChannel, A
if (e instanceof SocketTimeoutException) {
try {
response.sendError(HttpServletResponse.SC_REQUEST_TIMEOUT);
- } catch(IllegalStateException ex) {
+ } catch (IllegalStateException ex) {
// Response already committed
response.setStatus(HttpServletResponse.SC_REQUEST_TIMEOUT);
response.setError();
@@ -316,7 +316,7 @@ public class InputBuffer extends Reader implements ByteChunk.ByteInputChannel, A
} else {
try {
response.sendError(HttpServletResponse.SC_BAD_REQUEST);
- } catch(IllegalStateException ex) {
+ } catch (IllegalStateException ex) {
// Response already committed
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
response.setError();
diff --git a/java/org/apache/catalina/connector/Request.java b/java/org/apache/catalina/connector/Request.java
index 6bf0f0a940..b100a02414 100644
--- a/java/org/apache/catalina/connector/Request.java
+++ b/java/org/apache/catalina/connector/Request.java
@@ -901,9 +901,9 @@ public class Request implements HttpServletRequest {
/**
* {@inheritDoc}
* <p>
- * The attribute names returned will only be those for the attributes set via
- * {@link #setAttribute(String, Object)}. Tomcat internal attributes will not be included although they are
- * accessible via {@link #getAttribute(String)}. The Tomcat internal attributes include:
+ * The attribute names returned will only be those for the attributes set via {@link #setAttribute(String, Object)}.
+ * Tomcat internal attributes will not be included although they are accessible via {@link #getAttribute(String)}.
+ * The Tomcat internal attributes include:
* <ul>
* <li>{@link Globals#DISPATCHER_TYPE_ATTR}</li>
* <li>{@link Globals#DISPATCHER_REQUEST_PATH_ATTR}</li>
diff --git a/java/org/apache/catalina/connector/Response.java b/java/org/apache/catalina/connector/Response.java
index a0d7c8d932..bfbaffb123 100644
--- a/java/org/apache/catalina/connector/Response.java
+++ b/java/org/apache/catalina/connector/Response.java
@@ -153,7 +153,6 @@ public class Response implements HttpServletResponse {
}
-
// --------------------------------------------------------- Public Methods
/**
diff --git a/java/org/apache/catalina/core/ApplicationDispatcher.java b/java/org/apache/catalina/core/ApplicationDispatcher.java
index 245a1a85ea..22f0d439a2 100644
--- a/java/org/apache/catalina/core/ApplicationDispatcher.java
+++ b/java/org/apache/catalina/core/ApplicationDispatcher.java
@@ -289,8 +289,7 @@ final class ApplicationDispatcher implements AsyncDispatcher, RequestDispatcher
if (response instanceof ResponseFacade) {
finished = true;
((ResponseFacade) response).finish();
- } else if (context.getSuspendWrappedResponseAfterForward()
- && response instanceof ServletResponseWrapper) {
+ } else if (context.getSuspendWrappedResponseAfterForward() && response instanceof ServletResponseWrapper) {
ServletResponse baseResponse = response;
do {
baseResponse = ((ServletResponseWrapper) baseResponse).getResponse();
diff --git a/java/org/apache/catalina/core/ApplicationFilterChain.java b/java/org/apache/catalina/core/ApplicationFilterChain.java
index 9d4a3a3437..675aac9d65 100644
--- a/java/org/apache/catalina/core/ApplicationFilterChain.java
+++ b/java/org/apache/catalina/core/ApplicationFilterChain.java
@@ -103,8 +103,7 @@ public final class ApplicationFilterChain implements FilterChain {
try {
Filter filter = filterConfig.getFilter();
- if (request.isAsyncSupported() &&
- !(filterConfig.getFilterDef().getAsyncSupportedBoolean())) {
+ if (request.isAsyncSupported() && !(filterConfig.getFilterDef().getAsyncSupportedBoolean())) {
request.setAttribute(Globals.ASYNC_SUPPORTED_ATTR, Boolean.FALSE);
}
filter.doFilter(request, response, this);
diff --git a/java/org/apache/catalina/core/ApplicationHttpRequest.java b/java/org/apache/catalina/core/ApplicationHttpRequest.java
index 814ee277e8..3438a4bc0e 100644
--- a/java/org/apache/catalina/core/ApplicationHttpRequest.java
+++ b/java/org/apache/catalina/core/ApplicationHttpRequest.java
@@ -379,7 +379,6 @@ class ApplicationHttpRequest extends HttpServletRequestWrapper {
}
-
@Override
public String getMethod() {
return method;
diff --git a/java/org/apache/catalina/core/ApplicationSessionCookieConfig.java b/java/org/apache/catalina/core/ApplicationSessionCookieConfig.java
index 97a001b95f..732e843d20 100644
--- a/java/org/apache/catalina/core/ApplicationSessionCookieConfig.java
+++ b/java/org/apache/catalina/core/ApplicationSessionCookieConfig.java
@@ -221,8 +221,7 @@ public class ApplicationSessionCookieConfig implements SessionCookieConfig {
cookie.setHttpOnly(true);
}
- cookie.setAttribute(Constants.COOKIE_PARTITIONED_ATTR,
- Boolean.toString(context.getUsePartitioned()));
+ cookie.setAttribute(Constants.COOKIE_PARTITIONED_ATTR, Boolean.toString(context.getUsePartitioned()));
cookie.setPath(SessionConfig.getSessionCookiePath(context));
diff --git a/java/org/apache/catalina/core/OpenSSLLifecycleListener.java b/java/org/apache/catalina/core/OpenSSLLifecycleListener.java
index 477ca41317..5b0ea02531 100644
--- a/java/org/apache/catalina/core/OpenSSLLifecycleListener.java
+++ b/java/org/apache/catalina/core/OpenSSLLifecycleListener.java
@@ -29,12 +29,10 @@ import org.apache.tomcat.util.net.openssl.OpenSSLStatus;
import org.apache.tomcat.util.res.StringManager;
-
/**
- * Implementation of <code>LifecycleListener</code> that will do the global
- * initialization of OpenSSL according to specified configuration parameters.
- * Using the listener is completely optional, but is needed for configuration
- * and full cleanup of a few native memory allocations.
+ * Implementation of <code>LifecycleListener</code> that will do the global initialization of OpenSSL according to
+ * specified configuration parameters. Using the listener is completely optional, but is needed for configuration and
+ * full cleanup of a few native memory allocations.
*/
public class OpenSSLLifecycleListener implements LifecycleListener {
@@ -55,7 +53,8 @@ public class OpenSSLLifecycleListener implements LifecycleListener {
OpenSSLStatus.setInitialized(true);
} else {
try {
- Class<?> openSSLLibraryClass = Class.forName("org.apache.tomcat.util.net.openssl.panama.OpenSSLLibrary");
+ Class<?> openSSLLibraryClass =
+ Class.forName("org.apache.tomcat.util.net.openssl.panama.OpenSSLLibrary");
openSSLLibraryClass.getMethod("init").invoke(null);
} catch (Throwable t) {
t = ExceptionUtils.unwrapInvocationTargetException(t);
@@ -85,8 +84,7 @@ public class OpenSSLLifecycleListener implements LifecycleListener {
boolean initError = false;
if (Lifecycle.BEFORE_INIT_EVENT.equals(event.getType())) {
if (!(event.getLifecycle() instanceof Server)) {
- log.warn(sm.getString("listener.notServer",
- event.getLifecycle().getClass().getSimpleName()));
+ log.warn(sm.getString("listener.notServer", event.getLifecycle().getClass().getSimpleName()));
}
synchronized (lock) {
if (!JreCompat.isJre22Available()) {
@@ -95,7 +93,8 @@ public class OpenSSLLifecycleListener implements LifecycleListener {
return;
}
try {
- Class<?> openSSLLibraryClass = Class.forName("org.apache.tomcat.util.net.openssl.panama.OpenSSLLibrary");
+ Class<?> openSSLLibraryClass =
+ Class.forName("org.apache.tomcat.util.net.openssl.panama.OpenSSLLibrary");
openSSLLibraryClass.getMethod("init").invoke(null);
} catch (Throwable t) {
t = ExceptionUtils.unwrapInvocationTargetException(t);
@@ -120,7 +119,8 @@ public class OpenSSLLifecycleListener implements LifecycleListener {
}
// Note: Without the listener, destroy will never be called (which is not a significant problem)
try {
- Class<?> openSSLLibraryClass = Class.forName("org.apache.tomcat.util.net.openssl.panama.OpenSSLLibrary");
+ Class<?> openSSLLibraryClass =
+ Class.forName("org.apache.tomcat.util.net.openssl.panama.OpenSSLLibrary");
openSSLLibraryClass.getMethod("destroy").invoke(null);
} catch (Throwable t) {
t = ExceptionUtils.unwrapInvocationTargetException(t);
@@ -135,7 +135,8 @@ public class OpenSSLLifecycleListener implements LifecycleListener {
public String getSSLEngine() {
if (JreCompat.isJre22Available()) {
try {
- Class<?> openSSLLibraryClass = Class.forName("org.apache.tomcat.util.net.openssl.panama.OpenSSLLibrary");
+ Class<?> openSSLLibraryClass =
+ Class.forName("org.apache.tomcat.util.net.openssl.panama.OpenSSLLibrary");
return (String) openSSLLibraryClass.getMethod("getSSLEngine").invoke(null);
} catch (Throwable t) {
t = ExceptionUtils.unwrapInvocationTargetException(t);
@@ -148,7 +149,8 @@ public class OpenSSLLifecycleListener implements LifecycleListener {
public void setSSLEngine(String SSLEngine) {
if (JreCompat.isJre22Available()) {
try {
- Class<?> openSSLLibraryClass = Class.forName("org.apache.tomcat.util.net.openssl.panama.OpenSSLLibrary");
+ Class<?> openSSLLibraryClass =
+ Class.forName("org.apache.tomcat.util.net.openssl.panama.OpenSSLLibrary");
openSSLLibraryClass.getMethod("setSSLEngine").invoke(null, SSLEngine);
} catch (Throwable t) {
t = ExceptionUtils.unwrapInvocationTargetException(t);
@@ -160,7 +162,8 @@ public class OpenSSLLifecycleListener implements LifecycleListener {
public String getSSLRandomSeed() {
if (JreCompat.isJre22Available()) {
try {
- Class<?> openSSLLibraryClass = Class.forName("org.apache.tomcat.util.net.openssl.panama.OpenSSLLibrary");
+ Class<?> openSSLLibraryClass =
+ Class.forName("org.apache.tomcat.util.net.openssl.panama.OpenSSLLibrary");
return (String) openSSLLibraryClass.getMethod("getSSLRandomSeed").invoke(null);
} catch (Throwable t) {
t = ExceptionUtils.unwrapInvocationTargetException(t);
@@ -173,7 +176,8 @@ public class OpenSSLLifecycleListener implements LifecycleListener {
public void setSSLRandomSeed(String SSLRandomSeed) {
if (JreCompat.isJre22Available()) {
try {
- Class<?> openSSLLibraryClass = Class.forName("org.apache.tomcat.util.net.openssl.panama.OpenSSLLibrary");
+ Class<?> openSSLLibraryClass =
+ Class.forName("org.apache.tomcat.util.net.openssl.panama.OpenSSLLibrary");
openSSLLibraryClass.getMethod("setSSLRandomSeed").invoke(null, SSLRandomSeed);
} catch (Throwable t) {
t = ExceptionUtils.unwrapInvocationTargetException(t);
@@ -185,7 +189,8 @@ public class OpenSSLLifecycleListener implements LifecycleListener {
public String getFIPSMode() {
if (JreCompat.isJre22Available()) {
try {
- Class<?> openSSLLibraryClass = Class.forName("org.apache.tomcat.util.net.openssl.panama.OpenSSLLibrary");
+ Class<?> openSSLLibraryClass =
+ Class.forName("org.apache.tomcat.util.net.openssl.panama.OpenSSLLibrary");
return (String) openSSLLibraryClass.getMethod("getFIPSMode").invoke(null);
} catch (Throwable t) {
t = ExceptionUtils.unwrapInvocationTargetException(t);
@@ -198,7 +203,8 @@ public class OpenSSLLifecycleListener implements LifecycleListener {
public void setFIPSMode(String FIPSMode) {
if (JreCompat.isJre22Available()) {
try {
- Class<?> openSSLLibraryClass = Class.forName("org.apache.tomcat.util.net.openssl.panama.OpenSSLLibrary");
+ Class<?> openSSLLibraryClass =
+ Class.forName("org.apache.tomcat.util.net.openssl.panama.OpenSSLLibrary");
openSSLLibraryClass.getMethod("setFIPSMode").invoke(null, FIPSMode);
} catch (Throwable t) {
t = ExceptionUtils.unwrapInvocationTargetException(t);
@@ -210,7 +216,8 @@ public class OpenSSLLifecycleListener implements LifecycleListener {
public boolean isFIPSModeActive() {
if (JreCompat.isJre22Available()) {
try {
- Class<?> openSSLLibraryClass = Class.forName("org.apache.tomcat.util.net.openssl.panama.OpenSSLLibrary");
+ Class<?> openSSLLibraryClass =
+ Class.forName("org.apache.tomcat.util.net.openssl.panama.OpenSSLLibrary");
return ((Boolean) openSSLLibraryClass.getMethod("isFIPSModeActive").invoke(null)).booleanValue();
} catch (Throwable t) {
t = ExceptionUtils.unwrapInvocationTargetException(t);
diff --git a/java/org/apache/catalina/core/PropertiesRoleMappingListener.java b/java/org/apache/catalina/core/PropertiesRoleMappingListener.java
index 00ddc5b4af..ead567886e 100644
--- a/java/org/apache/catalina/core/PropertiesRoleMappingListener.java
+++ b/java/org/apache/catalina/core/PropertiesRoleMappingListener.java
@@ -37,8 +37,8 @@ import org.apache.tomcat.util.res.StringManager;
* This listener must only be nested within {@link Context} elements.
* <p>
* The keys represent application roles (e.g., admin, user, uservisor, etc.) while the values represent technical roles
- * (e.g., DNs, SIDs, UUIDs, etc.). A key can also be prefixed if, e.g., the properties file contains generic
- * application configuration as well: {@code app-roles.}.
+ * (e.g., DNs, SIDs, UUIDs, etc.). A key can also be prefixed if, e.g., the properties file contains generic application
+ * configuration as well: {@code app-roles.}.
* <p>
* Note: The default value for the {@code roleMappingFile} is {@code webapp:/WEB-INF/role-mapping.properties}.
*/
@@ -60,7 +60,8 @@ public class PropertiesRoleMappingListener implements LifecycleListener {
* {@link ConfigFileLoader} supports.
*
* @param roleMappingFile the role mapping properties file to load from
- * @throws NullPointerException if roleMappingFile is null
+ *
+ * @throws NullPointerException if roleMappingFile is null
* @throws IllegalArgumentException if roleMappingFile is empty
*/
public void setRoleMappingFile(String roleMappingFile) {
@@ -116,7 +117,7 @@ public class PropertiesRoleMappingListener implements LifecycleListener {
}
int linkCount = 0;
- for (Entry<Object, Object> prop : props.entrySet()) {
+ for (Entry<Object,Object> prop : props.entrySet()) {
String role = (String) prop.getKey();
if (keyPrefix != null) {
diff --git a/java/org/apache/catalina/core/StandardContext.java b/java/org/apache/catalina/core/StandardContext.java
index 4879e90244..27406d6a86 100644
--- a/java/org/apache/catalina/core/StandardContext.java
+++ b/java/org/apache/catalina/core/StandardContext.java
@@ -2129,8 +2129,8 @@ public class StandardContext extends ContainerBase implements Context, Notificat
@Override
public ServletContext getServletContext() {
/*
- * This method is called (multiple times) during context start which is single threaded so there is concurrency
- * issue here.
+ * This method is called (multiple times) during context start which is single threaded so there is concurrency
+ * issue here.
*/
if (context == null) {
context = new ApplicationContext(this);
@@ -5698,8 +5698,7 @@ public class StandardContext extends ContainerBase implements Context, Notificat
}
@Override
- public FilterRegistration.Dynamic addFilter(String filterName,
- Class<? extends Filter> filterClass) {
+ public FilterRegistration.Dynamic addFilter(String filterName, Class<? extends Filter> filterClass) {
throw new UnsupportedOperationException(sm.getString("noPluggabilityServletContext.notAllowed"));
}
diff --git a/java/org/apache/catalina/core/StandardHostValve.java b/java/org/apache/catalina/core/StandardHostValve.java
index a67ec0d2bf..ba818e9534 100644
--- a/java/org/apache/catalina/core/StandardHostValve.java
+++ b/java/org/apache/catalina/core/StandardHostValve.java
@@ -298,9 +298,9 @@ final class StandardHostValve extends ValveBase {
}
} else {
/*
- * A custom error-page has not been defined for the exception that was thrown during request processing.
- * Set the status to 500 if an error status has not already been set and check for custom error-page for
- * the status.
+ * A custom error-page has not been defined for the exception that was thrown during request processing. Set
+ * the status to 500 if an error status has not already been set and check for custom error-page for the
+ * status.
*/
if (response.getStatus() < HttpServletResponse.SC_BAD_REQUEST) {
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
diff --git a/java/org/apache/catalina/core/StandardServer.java b/java/org/apache/catalina/core/StandardServer.java
index 241c57ed1a..bc180007c6 100644
--- a/java/org/apache/catalina/core/StandardServer.java
+++ b/java/org/apache/catalina/core/StandardServer.java
@@ -931,8 +931,7 @@ public final class StandardServer extends LifecycleMBeanBase implements Server {
/**
* {@inheritDoc}
* <p>
- * This is used to allow connectors to bind to restricted ports under Unix
- * operating environments.
+ * This is used to allow connectors to bind to restricted ports under Unix operating environments.
*/
@Override
protected void initInternal() throws LifecycleException {
@@ -999,10 +998,10 @@ public final class StandardServer extends LifecycleMBeanBase implements Server {
/**
* @return the MBean domain for this server. The domain is obtained using the following search order:
- * <ol>
- * <li>Name of first {@link org.apache.catalina.Engine}.</li>
- * <li>Name of first {@link Service}.</li>
- * </ol>
+ * <ol>
+ * <li>Name of first {@link org.apache.catalina.Engine}.</li>
+ * <li>Name of first {@link Service}.</li>
+ * </ol>
*/
@Override
protected String getDomainInternal() {
diff --git a/java/org/apache/catalina/filters/CsrfPreventionFilter.java b/java/org/apache/catalina/filters/CsrfPreventionFilter.java
index 8a172702dc..93f53f18a3 100644
--- a/java/org/apache/catalina/filters/CsrfPreventionFilter.java
+++ b/java/org/apache/catalina/filters/CsrfPreventionFilter.java
@@ -49,33 +49,26 @@ import org.apache.juli.logging.LogFactory;
* <li>{@link HttpServletResponse#encodeRedirectURL(String)} and {@link HttpServletResponse#encodeURL(String)} are used
* to encode all URLs returned to the client
* </ul>
- *
* <p>
- * CSRF protection is enabled by generating random nonce values which are
- * stored in the client's HTTP session. Each URL encoded using
- * {@link HttpServletResponse#encodeURL(String)} has a URL parameter added
- * which, when sent to the server in a future request, will be checked
- * against this stored set of nonces for validity.
+ * CSRF protection is enabled by generating random nonce values which are stored in the client's HTTP session. Each URL
+ * encoded using {@link HttpServletResponse#encodeURL(String)} has a URL parameter added which, when sent to the server
+ * in a future request, will be checked against this stored set of nonces for validity.
* </p>
- *
* <p>
- * Some URLs should be accessible even without a valid nonce parameter value.
- * These URLs are known as "entry points" because clients should be able to
- * "enter" the application without first establishing any valid tokens. These
- * are configured with the <code>entryPoints</code> filter
- * <code>init-param</code>.
+ * Some URLs should be accessible even without a valid nonce parameter value. These URLs are known as "entry points"
+ * because clients should be able to "enter" the application without first establishing any valid tokens. These are
+ * configured with the <code>entryPoints</code> filter <code>init-param</code>.
* </p>
- *
* <p>
- * Some URLs should not have nonce parameters added to them at all
+ * Some URLs should not have nonce parameters added to them at all
*/
public class CsrfPreventionFilter extends CsrfPreventionFilterBase {
/**
* The default set of URL patterns for which nonces will not be appended.
*/
- private static final String DEFAULT_NO_NONCE_URL_PATTERNS
- = "*.css, *.js, *.gif, *.png, *.jpg, *.svg, *.ico, *.jpeg, *.mjs";
+ private static final String DEFAULT_NO_NONCE_URL_PATTERNS =
+ "*.css, *.js, *.gif, *.png, *.jpg, *.svg, *.ico, *.jpeg, *.mjs";
/**
* The servlet context in which this Filter is operating.
@@ -91,14 +84,12 @@ public class CsrfPreventionFilter extends CsrfPreventionFilterBase {
private String nonceRequestParameterName = Constants.CSRF_NONCE_REQUEST_PARAM;
/**
- * Flag which determines whether this Filter is in "enforcement" mode
- * (the default) or in "reporting" mode.
+ * Flag which determines whether this Filter is in "enforcement" mode (the default) or in "reporting" mode.
*/
private boolean enforce = true;
/**
- * A set of comma-separated URL patterns which will have no nonce
- * parameters added to them.
+ * A set of comma-separated URL patterns which will have no nonce parameters added to them.
*/
private String noNoncePatterns = DEFAULT_NO_NONCE_URL_PATTERNS;
@@ -139,43 +130,34 @@ public class CsrfPreventionFilter extends CsrfPreventionFilterBase {
}
/**
- * Sets the flag to enforce CSRF protection or just log failures as DEBUG
- * messages.
+ * Sets the flag to enforce CSRF protection or just log failures as DEBUG messages.
*
- * @param enforce <code>true</code> to enforce CSRF protection or
- * <code>false</code> to log DEBUG messages and allow
- * all requests.
+ * @param enforce <code>true</code> to enforce CSRF protection or <code>false</code> to log DEBUG messages and allow
+ * all requests.
*/
public void setEnforce(boolean enforce) {
this.enforce = enforce;
}
/**
- * Gets the flag to enforce CSRF protection or just log failures as DEBUG
- * messages.
+ * Gets the flag to enforce CSRF protection or just log failures as DEBUG messages.
*
- * @return <code>true</code> if CSRF protection will be enforced or
- * <code>false</code> if all requests will be allowed and
- * failures will be logged as DEBUG messages.
+ * @return <code>true</code> if CSRF protection will be enforced or <code>false</code> if all requests will be
+ * allowed and failures will be logged as DEBUG messages.
*/
public boolean isEnforce() {
return this.enforce;
}
/**
- * Sets the list of URL patterns to suppress nonce-addition for.
+ * Sets the list of URL patterns to suppress nonce-addition for. Some URLs do not need nonces added to them such as
+ * static resources. By <i>not</i> adding nonces to those URLs, HTTP caches can be more effective because the CSRF
+ * prevention filter won't generate what look like unique URLs for those commonly-reused resources.
*
- * Some URLs do not need nonces added to them such as static resources.
- * By <i>not</i> adding nonces to those URLs, HTTP caches can be more
- * effective because the CSRF prevention filter won't generate what
- * look like unique URLs for those commonly-reused resources.
- *
- * @param patterns A comma-separated list of URL patterns that will not
- * have nonces added to them. Patterns may begin or end with a
- * <code>*</code> character to denote a suffix-match or
- * prefix-match. Any matched URL will not have a CSRF nonce
- * added to it when passed through
- * {@link HttpServletResponse#encodeURL(String)}.
+ * @param patterns A comma-separated list of URL patterns that will not have nonces added to them. Patterns may
+ * begin or end with a <code>*</code> character to denote a suffix-match or prefix-match. Any
+ * matched URL will not have a CSRF nonce added to it when passed through
+ * {@link HttpServletResponse#encodeURL(String)}.
*/
public void setNoNonceURLPatterns(String patterns) {
this.noNoncePatterns = patterns;
@@ -188,7 +170,7 @@ public class CsrfPreventionFilter extends CsrfPreventionFilterBase {
/**
* Creates a collection of matchers from a comma-separated string of patterns.
*
- * @param context the Servlet context
+ * @param context the Servlet context
* @param patterns A comma-separated string of URL matching patterns.
*
* @return A collection of predicates representing the URL patterns.
@@ -222,11 +204,9 @@ public class CsrfPreventionFilter extends CsrfPreventionFilterBase {
* Creates a predicate that can match the specified type of pattern.
*
* @param context the Servlet context
- * @param pattern The pattern to match e.g. <code>*.foo</code> or
- * <code>/bar/*</code>.
+ * @param pattern The pattern to match e.g. <code>*.foo</code> or <code>/bar/*</code>.
*
- * @return A Predicate which can match the specified pattern, or
- * <code>null</code> if the pattern is null or blank.
+ * @return A Predicate which can match the specified pattern, or <code>null</code> if the pattern is null or blank.
*/
protected static Predicate<String> createNoNoncePredicate(ServletContext context, String pattern) {
if (null == pattern || 0 == pattern.trim().length()) {
@@ -246,10 +226,8 @@ public class CsrfPreventionFilter extends CsrfPreventionFilterBase {
}
/**
- * A no-nonce Predicate that evaluates a MIME type instead of a URL.
- *
- * It can be used with any other Predicate for matching
- * the actual value of the MIME type.
+ * A no-nonce Predicate that evaluates a MIME type instead of a URL. It can be used with any other Predicate for
+ * matching the actual value of the MIME type.
*/
protected static class MimePredicate implements Predicate<String> {
private final ServletContext context;
@@ -277,6 +255,7 @@ public class CsrfPreventionFilter extends CsrfPreventionFilterBase {
*/
protected static class PrefixPredicate implements Predicate<String> {
private final String prefix;
+
public PrefixPredicate(String prefix) {
this.prefix = prefix;
}
@@ -292,6 +271,7 @@ public class CsrfPreventionFilter extends CsrfPreventionFilterBase {
*/
protected static class SuffixPredicate implements Predicate<String> {
private final String suffix;
+
public SuffixPredicate(String suffix) {
this.suffix = suffix;
}
@@ -381,7 +361,8 @@ public class CsrfPreventionFilter extends CsrfPreventionFilterBase {
} else {
if (log.isTraceEnabled()) {
log.trace("Would have rejecting request for " + getRequestedPath(req) + ", session " +
- (null == session ? "(null)" : session.getId()) + " due to empty / missing nonce cache");
+ (null == session ? "(null)" : session.getId()) +
+ " due to empty / missing nonce cache");
}
}
} else if (!nonceCache.contains(previousNonce)) {
@@ -402,8 +383,8 @@ public class CsrfPreventionFilter extends CsrfPreventionFilterBase {
}
} else {
if (log.isTraceEnabled()) {
- log.trace(
- "Allowing request to " + getRequestedPath(req) + " with valid CSRF nonce " + previousNonce);
+ log.trace("Allowing request to " + getRequestedPath(req) + " with valid CSRF nonce " +
+ previousNonce);
}
}
}
@@ -448,19 +429,15 @@ public class CsrfPreventionFilter extends CsrfPreventionFilterBase {
}
/**
- * Check to see if the request and path should be enforced or only
- * observed and reported.
- *
- * Note that the <code>requestedPath</code> parameter is purely
- * a performance optimization to avoid calling
+ * Check to see if the request and path should be enforced or only observed and reported. Note that the
+ * <code>requestedPath</code> parameter is purely a performance optimization to avoid calling
* {@link #getRequestedPath(HttpServletRequest)} multiple times.
*
- * @param req The request.
+ * @param req The request.
* @param requestedPath The path of the request being evaluated.
*
- * @return <code>true</code> if the CSRF prevention should be enforced,
- * <code>false</code> if the CSRF prevention should only be
- * logged in DEBUG mode.
+ * @return <code>true</code> if the CSRF prevention should be enforced, <code>false</code> if the CSRF prevention
+ * should only be logged in DEBUG mode.
*/
protected boolean enforce(HttpServletRequest req, String requestedPath) {
return isEnforce();
@@ -556,8 +533,8 @@ public class CsrfPreventionFilter extends CsrfPreventionFilterBase {
private final String nonce;
private final Collection<Predicate<String>> noNoncePatterns;
- public CsrfResponseWrapper(HttpServletResponse response, String nonceRequestParameterName,
- String nonce, Collection<Predicate<String>> noNoncePatterns) {
+ public CsrfResponseWrapper(HttpServletResponse response, String nonceRequestParameterName, String nonce,
+ Collection<Predicate<String>> noNoncePatterns) {
super(response);
this.nonceRequestParameterName = nonceRequestParameterName;
this.nonce = nonce;
diff --git a/java/org/apache/catalina/ha/CatalinaCluster.java b/java/org/apache/catalina/ha/CatalinaCluster.java
index 11fd69996a..1c0a2a2dc5 100644
--- a/java/org/apache/catalina/ha/CatalinaCluster.java
+++ b/java/org/apache/catalina/ha/CatalinaCluster.java
@@ -133,6 +133,7 @@ public interface CatalinaCluster extends Cluster {
/**
* Set the channel associated with the cluster.
+ *
* @param channel the channel
*/
void setChannel(Channel channel);
diff --git a/java/org/apache/catalina/ha/ClusterManager.java b/java/org/apache/catalina/ha/ClusterManager.java
index c8bb510aa3..586f2c9bae 100644
--- a/java/org/apache/catalina/ha/ClusterManager.java
+++ b/java/org/apache/catalina/ha/ClusterManager.java
@@ -83,6 +83,7 @@ public interface ClusterManager extends Manager {
/**
* Set the cluster associated with this manager.
+ *
* @param cluster the cluster
*/
void setCluster(CatalinaCluster cluster);
@@ -91,7 +92,9 @@ public interface ClusterManager extends Manager {
* Open stream and use correct ClassLoader (Container), switching thread context class loader.
*
* @param data the data
+ *
* @return the object input stream
+ *
* @throws IOException An error occurred
*/
ReplicationStream getReplicationStream(byte[] data) throws IOException;
@@ -99,10 +102,12 @@ public interface ClusterManager extends Manager {
/**
* Open stream and use correct ClassLoader (Container), switching thread context class loader.
*
- * @param data the data
+ * @param data the data
* @param offset the offset in the data array
* @param length the data length
+ *
* @return the object input stream
+ *
* @throws IOException An error occurred
*/
ReplicationStream getReplicationStream(byte[] data, int offset, int length) throws IOException;
diff --git a/java/org/apache/catalina/ha/ClusterMessage.java b/java/org/apache/catalina/ha/ClusterMessage.java
index 34aed3b286..14bf5e3e43 100644
--- a/java/org/apache/catalina/ha/ClusterMessage.java
+++ b/java/org/apache/catalina/ha/ClusterMessage.java
@@ -28,6 +28,7 @@ public interface ClusterMessage extends Serializable {
/**
* Set the member associated with the message.
+ *
* @param member the member
*/
void setAddress(Member member);
@@ -44,6 +45,7 @@ public interface ClusterMessage extends Serializable {
/**
* Set the timestamp for this message.
+ *
* @param timestamp the timestamp
*/
void setTimestamp(long timestamp);
diff --git a/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java b/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java
index 212bc93dac..085404cc3c 100644
--- a/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java
+++ b/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java
@@ -228,7 +228,8 @@ public class FarmWarDeployer extends ClusterListener implements ClusterDeployer,
Files.move(factory.getFile().toPath(), deployable.toPath());
} catch (IOException ioe) {
- log.error(sm.getString("farmWarDeployer.renameFail", factory.getFile(), deployable), ioe);
+ log.error(sm.getString("farmWarDeployer.renameFail", factory.getFile(), deployable),
+ ioe);
} finally {
removeServiced(contextName);
}
@@ -305,6 +306,7 @@ public class FarmWarDeployer extends ClusterListener implements ClusterDeployer,
/**
* {@inheritDoc}
+ * <p>
* This listener accepts only FileMessage or UndeployMessage.
*/
@Override
diff --git a/java/org/apache/catalina/ha/session/ClusterSessionListener.java b/java/org/apache/catalina/ha/session/ClusterSessionListener.java
index e4a7a3e2f4..eb85f88f13 100644
--- a/java/org/apache/catalina/ha/session/ClusterSessionListener.java
+++ b/java/org/apache/catalina/ha/session/ClusterSessionListener.java
@@ -87,6 +87,7 @@ public class ClusterSessionListener extends ClusterListener {
/**
* {@inheritDoc}
+ * <p>
* This listener accepts only SessionMessage.
*/
@Override
diff --git a/java/org/apache/catalina/ha/session/DeltaSession.java b/java/org/apache/catalina/ha/session/DeltaSession.java
index f8ef3b7c7c..2cba31e3e4 100644
--- a/java/org/apache/catalina/ha/session/DeltaSession.java
+++ b/java/org/apache/catalina/ha/session/DeltaSession.java
@@ -546,7 +546,9 @@ public class DeltaSession extends StandardSession implements Externalizable, Clu
/**
* Get the request.
+ *
* @return the request
+ *
* @deprecated Unused. This method will be removed in Tomcat 12.
*/
@Deprecated
diff --git a/java/org/apache/catalina/ha/session/SessionMessageImpl.java b/java/org/apache/catalina/ha/session/SessionMessageImpl.java
index 70f8e01e44..c3b8d2713f 100644
--- a/java/org/apache/catalina/ha/session/SessionMessageImpl.java
+++ b/java/org/apache/catalina/ha/session/SessionMessageImpl.java
@@ -101,6 +101,7 @@ public class SessionMessageImpl extends ClusterMessageBase implements SessionMes
/**
* Set message send time but only the first setting works (one shot)
+ *
* @param time the timestamp
*/
@Override
diff --git a/java/org/apache/catalina/ha/tcp/ReplicationValve.java b/java/org/apache/catalina/ha/tcp/ReplicationValve.java
index 6ff8bf325a..5e2257f74c 100644
--- a/java/org/apache/catalina/ha/tcp/ReplicationValve.java
+++ b/java/org/apache/catalina/ha/tcp/ReplicationValve.java
@@ -537,7 +537,7 @@ public class ReplicationValve extends ValveBase implements ClusterValve {
*
* @param requestTime Request time
* @param clusterTime Cluster time
- * @param isAsync if the request was in async mode
+ * @param isAsync if the request was in async mode
*/
protected void updateStats(long requestTime, long clusterTime, boolean isAsync) {
long currentTime = System.currentTimeMillis();
@@ -550,9 +550,11 @@ public class ReplicationValve extends ValveBase implements ClusterValve {
if ((nrOfRequests.longValue() % 100) == 0) {
log.debug(sm.getString("ReplicationValve.stats",
new Object[] { Long.valueOf(totalRequestTime.longValue() / nrOfRequests.longValue()),
- Long.valueOf(totalSendTime.longValue() / nrOfRequests.longValue()), Long.valueOf(nrOfRequests.longValue()),
- Long.valueOf(nrOfSendRequests.longValue()), Long.valueOf(nrOfCrossContextSendRequests.longValue()),
- Long.valueOf(nrOfFilterRequests.longValue()), Long.valueOf(totalRequestTime.longValue()),
+ Long.valueOf(totalSendTime.longValue() / nrOfRequests.longValue()),
+ Long.valueOf(nrOfRequests.longValue()), Long.valueOf(nrOfSendRequests.longValue()),
+ Long.valueOf(nrOfCrossContextSendRequests.longValue()),
+ Long.valueOf(nrOfFilterRequests.longValue()),
+ Long.valueOf(totalRequestTime.longValue()),
Long.valueOf(totalSendTime.longValue()) }));
}
}
diff --git a/java/org/apache/catalina/manager/StatusTransformer.java b/java/org/apache/catalina/manager/StatusTransformer.java
index d6719d70b9..bef7f8edb7 100644
--- a/java/org/apache/catalina/manager/StatusTransformer.java
+++ b/java/org/apache/catalina/manager/StatusTransformer.java
@@ -273,8 +273,7 @@ public class StatusTransformer {
*
* @throws Exception Propagated JMX error
*/
- public static void writeConnectorsState(PrintWriter writer, MBeanServer mBeanServer,
- List<ObjectName> threadPools,
+ public static void writeConnectorsState(PrintWriter writer, MBeanServer mBeanServer, List<ObjectName> threadPools,
List<ObjectName> globalRequestProcessors, List<ObjectName> requestProcessors, int mode, Object[] args)
throws Exception {
if (mode == 2) {
@@ -292,8 +291,8 @@ public class StatusTransformer {
}
String name = objectName.getKeyProperty("name");
// use StatusTransformer to output status
- writeConnectorState(
- writer, objectName, name, mBeanServer, globalRequestProcessors, requestProcessors, mode, args);
+ writeConnectorState(writer, objectName, name, mBeanServer, globalRequestProcessors, requestProcessors, mode,
+ args);
}
if (mode == 2) {
writer.append(']');
@@ -447,9 +446,12 @@ public class StatusTransformer {
}
appendJSonValue(writer, "name", jsonName).append(',').println();
indent(writer, 3).append('"').append("threadInfo").append('"').append(':').append('{');
- appendJSonValue(writer, "maxThreads", mBeanServer.getAttribute(tpName, "maxThreads").toString()).append(',');
- appendJSonValue(writer, "currentThreadCount", mBeanServer.getAttribute(tpName, "currentThreadCount").toString()).append(',');
- appendJSonValue(writer, "currentThreadsBusy", mBeanServer.getAttribute(tpName, "currentThreadsBusy").toString());
+ appendJSonValue(writer, "maxThreads", mBeanServer.getAttribute(tpName, "maxThreads").toString())
+ .append(',');
+ appendJSonValue(writer, "currentThreadCount",
+ mBeanServer.getAttribute(tpName, "currentThreadCount").toString()).append(',');
+ appendJSonValue(writer, "currentThreadsBusy",
+ mBeanServer.getAttribute(tpName, "currentThreadsBusy").toString());
writer.append('}');
ObjectName grpName = null;
@@ -464,10 +466,14 @@ public class StatusTransformer {
writer.append(',').println();
indent(writer, 3).append('"').append("requestInfo").append('"').append(':').append('{');
appendJSonValue(writer, "maxTime", mBeanServer.getAttribute(grpName, "maxTime").toString()).append(',');
- appendJSonValue(writer, "processingTime", mBeanServer.getAttribute(grpName, "processingTime").toString()).append(',');
- appendJSonValue(writer, "requestCount", mBeanServer.getAttribute(grpName, "requestCount").toString()).append(',');
- appendJSonValue(writer, "errorCount", mBeanServer.getAttribute(grpName, "errorCount").toString()).append(',');
- appendJSonValue(writer, "bytesReceived", mBeanServer.getAttribute(grpName, "bytesReceived").toString()).append(',');
+ appendJSonValue(writer, "processingTime",
+ mBeanServer.getAttribute(grpName, "processingTime").toString()).append(',');
+ appendJSonValue(writer, "requestCount", mBeanServer.getAttribute(grpName, "requestCount").toString())
+ .append(',');
+ appendJSonValue(writer, "errorCount", mBeanServer.getAttribute(grpName, "errorCount").toString())
+ .append(',');
+ appendJSonValue(writer, "bytesReceived", mBeanServer.getAttribute(grpName, "bytesReceived").toString())
+ .append(',');
appendJSonValue(writer, "bytesSent", mBeanServer.getAttribute(grpName, "bytesSent").toString());
writer.append('}').println();
// Note: No detailed per processor info
@@ -810,8 +816,10 @@ public class StatusTransformer {
indent(writer, 2).append('{').println();
appendJSonValue(indent(writer, 3), "name", JSONFilter.escape(JSONFilter.escape(name))).append(',');
appendJSonValue(writer, "startTime",
- new Date(((Long) mBeanServer.getAttribute(objectName, "startTime")).longValue()).toString()).append(',');
- appendJSonValue(writer, "startupTime", mBeanServer.getAttribute(objectName, "startupTime").toString()).append(',');
+ new Date(((Long) mBeanServer.getAttribute(objectName, "startTime")).longValue()).toString())
+ .append(',');
+ appendJSonValue(writer, "startupTime", mBeanServer.getAttribute(objectName, "startupTime").toString())
+ .append(',');
appendJSonValue(writer, "tldScanTime", mBeanServer.getAttribute(objectName, "tldScanTime").toString());
if (managerON != null) {
writeManager(writer, managerON, mBeanServer, mode);
@@ -877,14 +885,22 @@ public class StatusTransformer {
} else if (mode == 2) {
writer.append(',').println();
indent(writer, 3).append('"').append("manager").append('"').append(':').append('{');
- appendJSonValue(writer, "activeSessions", mBeanServer.getAttribute(objectName, "activeSessions").toString()).append(',');
- appendJSonValue(writer, "sessionCounter", mBeanServer.getAttribute(objectName, "sessionCounter").toString()).append(',');
- appendJSonValue(writer, "maxActive", mBeanServer.getAttribute(objectName, "maxActive").toString()).append(',');
- appendJSonValue(writer, "rejectedSessions", mBeanServer.getAttribute(objectName, "rejectedSessions").toString()).append(',');
- appendJSonValue(writer, "expiredSessions", mBeanServer.getAttribute(objectName, "expiredSessions").toString()).append(',');
- appendJSonValue(writer, "sessionMaxAliveTime", mBeanServer.getAttribute(objectName, "sessionMaxAliveTime").toString()).append(',');
- appendJSonValue(writer, "sessionAverageAliveTime", mBeanServer.getAttribute(objectName, "sessionAverageAliveTime").toString()).append(',');
- appendJSonValue(writer, "processingTime", mBeanServer.getAttribute(objectName, "processingTime").toString());
+ appendJSonValue(writer, "activeSessions", mBeanServer.getAttribute(objectName, "activeSessions").toString())
+ .append(',');
+ appendJSonValue(writer, "sessionCounter", mBeanServer.getAttribute(objectName, "sessionCounter").toString())
+ .append(',');
+ appendJSonValue(writer, "maxActive", mBeanServer.getAttribute(objectName, "maxActive").toString())
+ .append(',');
+ appendJSonValue(writer, "rejectedSessions",
+ mBeanServer.getAttribute(objectName, "rejectedSessions").toString()).append(',');
+ appendJSonValue(writer, "expiredSessions",
+ mBeanServer.getAttribute(objectName, "expiredSessions").toString()).append(',');
+ appendJSonValue(writer, "sessionMaxAliveTime",
+ mBeanServer.getAttribute(objectName, "sessionMaxAliveTime").toString()).append(',');
+ appendJSonValue(writer, "sessionAverageAliveTime",
+ mBeanServer.getAttribute(objectName, "sessionAverageAliveTime").toString()).append(',');
+ appendJSonValue(writer, "processingTime",
+ mBeanServer.getAttribute(objectName, "processingTime").toString());
writer.append('}');
}
@@ -983,11 +999,15 @@ public class StatusTransformer {
} else if (mode == 2) {
indent(writer, 4).append('{');
appendJSonValue(writer, "servletName", JSONFilter.escape(servletName)).append(',');
- appendJSonValue(writer, "processingTime", mBeanServer.getAttribute(objectName, "processingTime").toString()).append(',');
+ appendJSonValue(writer, "processingTime", mBeanServer.getAttribute(objectName, "processingTime").toString())
+ .append(',');
appendJSonValue(writer, "maxTime", mBeanServer.getAttribute(objectName, "maxTime").toString()).append(',');
- appendJSonValue(writer, "requestCount", mBeanServer.getAttribute(objectName, "requestCount").toString()).append(',');
- appendJSonValue(writer, "errorCount", mBeanServer.getAttribute(objectName, "errorCount").toString()).append(',');
- appendJSonValue(writer, "loadTime", mBeanServer.getAttribute(objectName, "loadTime").toString()).append(',');
+ appendJSonValue(writer, "requestCount", mBeanServer.getAttribute(objectName, "requestCount").toString())
+ .append(',');
+ appendJSonValue(writer, "errorCount", mBeanServer.getAttribute(objectName, "errorCount").toString())
+ .append(',');
+ appendJSonValue(writer, "loadTime", mBeanServer.getAttribute(objectName, "loadTime").toString())
+ .append(',');
appendJSonValue(writer, "classLoadTime", mBeanServer.getAttribute(objectName, "classLoadTime").toString());
writer.append('}');
}
diff --git a/java/org/apache/catalina/mbeans/MBeanUtils.java b/java/org/apache/catalina/mbeans/MBeanUtils.java
index c4477a8f2e..8bfa690388 100644
--- a/java/org/apache/catalina/mbeans/MBeanUtils.java
+++ b/java/org/apache/catalina/mbeans/MBeanUtils.java
@@ -56,9 +56,8 @@ public class MBeanUtils {
* The set of exceptions to the normal rules used by <code>createManagedBean()</code>. The first element of each
* pair is a class name, and the second element is the managed bean name.
*/
- private static final String exceptions[][] = {
- { "org.apache.catalina.users.GenericGroup", "Group" }, { "org.apache.catalina.users.GenericRole", "Role" },
- { "org.apache.catalina.users.GenericUser", "User" } };
+ private static final String exceptions[][] = { { "org.apache.catalina.users.GenericGroup", "Group" },
+ { "org.apache.catalina.users.GenericRole", "Role" }, { "org.apache.catalina.users.GenericUser", "User" } };
/**
diff --git a/java/org/apache/catalina/realm/CombinedRealm.java b/java/org/apache/catalina/realm/CombinedRealm.java
index 0a97c340f2..902173a122 100644
--- a/java/org/apache/catalina/realm/CombinedRealm.java
+++ b/java/org/apache/catalina/realm/CombinedRealm.java
@@ -60,7 +60,8 @@ public class CombinedRealm extends RealmBase {
realms.add(theRealm);
if (log.isDebugEnabled()) {
- log.debug(sm.getString("combinedRealm.addRealm", theRealm.getClass().getName(), Integer.toString(realms.size())));
+ log.debug(sm.getString("combinedRealm.addRealm", theRealm.getClass().getName(),
+ Integer.toString(realms.size())));
}
}
diff --git a/java/org/apache/catalina/realm/RealmBase.java b/java/org/apache/catalina/realm/RealmBase.java
index 8f12552ee7..c0aaa49068 100644
--- a/java/org/apache/catalina/realm/RealmBase.java
+++ b/java/org/apache/catalina/realm/RealmBase.java
@@ -1274,9 +1274,8 @@ public abstract class RealmBase extends LifecycleMBeanBase implements Realm {
* specified, the default for the CredentialHandler will be used.</li>
* <li><b>-h</b> - The fully qualified class name of the CredentialHandler to use. If not specified, the built-in
* handlers will be tested in turn and the first one to accept the specified algorithm will be used.</li>
- * <li><b>-f</b> - The name of the file that contains passwords to encode. Each
- * line in the file should contain only one password. Using this
- * option ignores other password input.</li>
+ * <li><b>-f</b> - The name of the file that contains passwords to encode. Each line in the file should contain only
+ * one password. Using this option ignores other password input.</li>
* </ul>
* <p>
* This generation process currently supports the following CredentialHandlers, the correct one being selected based
@@ -1317,7 +1316,8 @@ public abstract class RealmBase extends LifecycleMBeanBase implements Realm {
// Note: Reducing args.length requirement to argIndex+1 so that -f works and ignores
// trailing words
- while (args.length > argIndex + 1 && args[argIndex].length() == 2 && args[argIndex].charAt(0) == '-' && !endOfList) {
+ while (args.length > argIndex + 1 && args[argIndex].length() == 2 && args[argIndex].charAt(0) == '-' &&
+ !endOfList) {
switch (args[argIndex].charAt(1)) {
case 'a': {
algorithm = args[argIndex + 1];
@@ -1348,7 +1348,7 @@ public abstract class RealmBase extends LifecycleMBeanBase implements Realm {
break;
}
case '-': {
- // When encountering -- option don't parse anything else as an option
+ // When encountering -- option don't parse anything else as an option
endOfList = true;
// The -- opt doesn't take an argument, decrement the argIndex so that it parses
// all remaining args
@@ -1436,8 +1436,7 @@ public abstract class RealmBase extends LifecycleMBeanBase implements Realm {
// A FileNotFound is the likely exception here and self-explanatory. Softly
// reporting it and exit 1 so that you can tell it failed from the command line.
if (e instanceof java.io.FileNotFoundException) {
- System.err.println("cannot stat '" + passwordFile +
- "': No such file or directory");
+ System.err.println("cannot stat '" + passwordFile + "': No such file or directory");
// Not sure if using an exit here is OK, but I wanted to return a code that
// showed failure.
System.exit(1);
@@ -1457,9 +1456,9 @@ public abstract class RealmBase extends LifecycleMBeanBase implements Realm {
}
private static void usage() {
- System.out.println("Usage: RealmBase [-a <algorithm>] [-e <encoding>]"
- + " [-i <iterations>] [-s <salt-length>] [-k <key-length>]"
- + " [-h <handler-class-name>] | <XX credentials>");
+ System.out.println("Usage: RealmBase [-a <algorithm>] [-e <encoding>]" +
+ " [-i <iterations>] [-s <salt-length>] [-k <key-length>]" +
+ " [-h <handler-class-name>] | <XX credentials>");
}
diff --git a/java/org/apache/catalina/security/SecurityListener.java b/java/org/apache/catalina/security/SecurityListener.java
index 7917b9a6a4..8873b77a10 100644
--- a/java/org/apache/catalina/security/SecurityListener.java
+++ b/java/org/apache/catalina/security/SecurityListener.java
@@ -139,28 +139,24 @@ public class SecurityListener implements LifecycleListener {
}
/**
- * Sets the number of days that may pass between the build-date of this
- * Tomcat instance before warnings are printed.
+ * Sets the number of days that may pass between the build-date of this Tomcat instance before warnings are printed.
*
- * @param ageDays The number of days a Tomcat build is allowed to age
- * before logging warnings.
+ * @param ageDays The number of days a Tomcat build is allowed to age before logging warnings.
*/
public void setBuildDateWarningAgeDays(String ageDays) {
try {
buildDateWarningAgeDays = Integer.parseInt(ageDays);
} catch (NumberFormatException nfe) {
// Just use the default and warn the user
- log.warn(sm.getString("SecurityListener.buildDateAgeUnreadable",
- ageDays, String.valueOf(DEFAULT_BUILD_DATE_WARNING_AGE_DAYS)));
+ log.warn(sm.getString("SecurityListener.buildDateAgeUnreadable", ageDays,
+ String.valueOf(DEFAULT_BUILD_DATE_WARNING_AGE_DAYS)));
}
}
/**
- * Gets the number of days that may pass between the build-date of this
- * Tomcat instance before warnings are printed.
+ * Gets the number of days that may pass between the build-date of this Tomcat instance before warnings are printed.
*
- * @return The number of days a Tomcat build is allowed to age
- * before logging warnings.
+ * @return The number of days a Tomcat build is allowed to age before logging warnings.
*/
public int getBuildDateWarningAgeDays() {
return buildDateWarningAgeDays;
@@ -226,7 +222,8 @@ public class SecurityListener implements LifecycleListener {
if (allowedAgeDays >= 0) {
String buildDateString = ServerInfo.getServerBuiltISO();
- if (null == buildDateString || buildDateString.length() < 1 || !Character.isDigit(buildDateString.charAt(0))) {
+ if (null == buildDateString || buildDateString.length() < 1 ||
+ !Character.isDigit(buildDateString.charAt(0))) {
log.warn(sm.getString("SecurityListener.buildDateUnreadable", buildDateString));
} else {
try {
diff --git a/java/org/apache/catalina/session/DataSourceStore.java b/java/org/apache/catalina/session/DataSourceStore.java
index 9406f5a25a..3a0806cd79 100644
--- a/java/org/apache/catalina/session/DataSourceStore.java
+++ b/java/org/apache/catalina/session/DataSourceStore.java
@@ -599,13 +599,11 @@ public class DataSourceStore extends StoreBase {
manager.getContext().getLogger().info(sm.getString("dataSourceStore.checkConnectionDBClosed"));
conn = open();
if (conn == null || conn.isClosed()) {
- manager.getContext().getLogger()
- .info(sm.getString("dataSourceStore.checkConnectionDBReOpenFail"));
+ manager.getContext().getLogger().info(sm.getString("dataSourceStore.checkConnectionDBReOpenFail"));
}
}
} catch (SQLException ex) {
- manager.getContext().getLogger()
- .error(sm.getString("dataSourceStore.checkConnectionSQLException", ex));
+ manager.getContext().getLogger().error(sm.getString("dataSourceStore.checkConnectionSQLException", ex));
}
return conn;
diff --git a/java/org/apache/catalina/startup/CatalinaBaseConfigurationSource.java b/java/org/apache/catalina/startup/CatalinaBaseConfigurationSource.java
index cd31f0fd1e..5f600d6b01 100644
--- a/java/org/apache/catalina/startup/CatalinaBaseConfigurationSource.java
+++ b/java/org/apache/catalina/startup/CatalinaBaseConfigurationSource.java
@@ -63,7 +63,8 @@ public class CatalinaBaseConfigurationSource implements ConfigurationSource {
InputStream stream = getClass().getClassLoader().getResourceAsStream(LEGACY_SERVER_EMBED_XML);
if (stream != null) {
try {
- result = new Resource(stream, getClass().getClassLoader().getResource(LEGACY_SERVER_EMBED_XML).toURI());
+ result = new Resource(stream,
+ getClass().getClassLoader().getResource(LEGACY_SERVER_EMBED_XML).toURI());
} catch (URISyntaxException e) {
stream.close();
}
diff --git a/java/org/apache/catalina/startup/Tomcat.java b/java/org/apache/catalina/startup/Tomcat.java
index 2da827d3bc..d4b4bb9006 100644
--- a/java/org/apache/catalina/startup/Tomcat.java
+++ b/java/org/apache/catalina/startup/Tomcat.java
@@ -835,11 +835,10 @@ public class Tomcat {
System.setProperty(Globals.CATALINA_HOME_PROP, server.getCatalinaHome().getPath());
}
- static final String[] silences =
- new String[] { "org.apache.coyote.http11.Http11NioProtocol", "org.apache.catalina.core.StandardService",
- "org.apache.catalina.core.StandardEngine", "org.apache.catalina.startup.ContextConfig",
- "org.apache.catalina.core.ApplicationContext", "org.apache.catalina.core.AprLifecycleListener",
- "org.apache.catalina.core.OpenSSLLifecycleListener" };
+ static final String[] silences = new String[] { "org.apache.coyote.http11.Http11NioProtocol",
+ "org.apache.catalina.core.StandardService", "org.apache.catalina.core.StandardEngine",
+ "org.apache.catalina.startup.ContextConfig", "org.apache.catalina.core.ApplicationContext",
+ "org.apache.catalina.core.AprLifecycleListener", "org.apache.catalina.core.OpenSSLLifecycleListener" };
private boolean silent = false;
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org