You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2026/05/06 12:11:52 UTC
(tomcat) branch 10.1.x updated: Javadoc fixes and improvements
This is an automated email from the ASF dual-hosted git repository.
rmaucher pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new 9b28fb2580 Javadoc fixes and improvements
9b28fb2580 is described below
commit 9b28fb25801ba7e19409e4c404451f212493436c
Author: remm <re...@apache.org>
AuthorDate: Wed May 6 11:45:34 2026 +0200
Javadoc fixes and improvements
Coauthored by OpenCode.
Part 1 obviously.
---
java/org/apache/catalina/AsyncDispatcher.java | 3 +
java/org/apache/catalina/Authenticator.java | 14 +
java/org/apache/catalina/Context.java | 222 ++++++--
java/org/apache/catalina/Engine.java | 12 +-
java/org/apache/catalina/Executor.java | 5 +
java/org/apache/catalina/Globals.java | 15 +
java/org/apache/catalina/Group.java | 10 +
java/org/apache/catalina/Host.java | 77 ++-
java/org/apache/catalina/Manager.java | 2 +
java/org/apache/catalina/Pipeline.java | 16 +-
java/org/apache/catalina/Realm.java | 4 +-
java/org/apache/catalina/Role.java | 16 +-
java/org/apache/catalina/Session.java | 94 +++-
java/org/apache/catalina/Store.java | 12 +-
java/org/apache/catalina/TomcatPrincipal.java | 8 +-
java/org/apache/catalina/User.java | 12 +
java/org/apache/catalina/UserDatabase.java | 31 +-
java/org/apache/catalina/WebResourceRoot.java | 4 +-
java/org/apache/catalina/WebResourceSet.java | 15 +
.../catalina/ant/AbstractCatalinaCommandTask.java | 6 +
.../apache/catalina/ant/AbstractCatalinaTask.java | 56 ++
.../catalina/ant/BaseRedirectorHelperTask.java | 6 +
java/org/apache/catalina/ant/DeployTask.java | 57 ++
java/org/apache/catalina/ant/FindLeaksTask.java | 6 +
.../apache/catalina/ant/JKStatusUpdateTask.java | 106 +++-
java/org/apache/catalina/ant/JMXGetTask.java | 6 +
java/org/apache/catalina/ant/JMXQueryTask.java | 6 +
java/org/apache/catalina/ant/JMXSetTask.java | 6 +
java/org/apache/catalina/ant/jmx/Arg.java | 29 +
.../catalina/ant/jmx/JMXAccessorCondition.java | 30 +-
.../catalina/ant/jmx/JMXAccessorConditionBase.java | 83 ++-
.../catalina/ant/jmx/JMXAccessorCreateTask.java | 36 +-
.../ant/jmx/JMXAccessorEqualsCondition.java | 6 +
.../catalina/ant/jmx/JMXAccessorGetTask.java | 14 +-
.../catalina/ant/jmx/JMXAccessorInvokeTask.java | 27 +-
.../catalina/ant/jmx/JMXAccessorQueryTask.java | 21 +-
.../catalina/ant/jmx/JMXAccessorSetTask.java | 38 +-
.../apache/catalina/ant/jmx/JMXAccessorTask.java | 123 ++++-
.../ant/jmx/JMXAccessorUnregisterTask.java | 6 +
.../catalina/authenticator/AuthenticatorBase.java | 90 ++++
.../catalina/authenticator/BasicAuthenticator.java | 16 +
.../apache/catalina/authenticator/Constants.java | 49 ++
.../authenticator/DigestAuthenticator.java | 176 +++++-
.../catalina/authenticator/FormAuthenticator.java | 13 +
.../catalina/authenticator/SingleSignOn.java | 9 +
.../jaspic/AuthConfigFactoryImpl.java | 6 +
java/org/apache/catalina/connector/Connector.java | 203 ++++++-
.../apache/catalina/connector/CoyoteAdapter.java | 3 +
.../catalina/connector/CoyoteInputStream.java | 11 +
.../catalina/connector/CoyoteOutputStream.java | 11 +
.../apache/catalina/connector/CoyotePrincipal.java | 5 +
.../apache/catalina/connector/CoyoteReader.java | 11 +
.../apache/catalina/connector/CoyoteWriter.java | 12 +
.../org/apache/catalina/connector/InputBuffer.java | 62 +++
.../org/apache/catalina/core/AccessLogAdapter.java | 10 +
.../apache/catalina/core/ApplicationContext.java | 13 +
.../catalina/core/ApplicationFilterChain.java | 4 +
.../catalina/core/ApplicationFilterConfig.java | 7 +
.../core/ApplicationFilterRegistration.java | 9 +
.../apache/catalina/core/ApplicationMapping.java | 16 +
java/org/apache/catalina/core/ApplicationPart.java | 14 +
.../core/ApplicationServletRegistration.java | 9 +
.../core/ApplicationSessionCookieConfig.java | 8 +
.../apache/catalina/core/AprLifecycleListener.java | 67 +++
.../org/apache/catalina/core/AsyncContextImpl.java | 45 ++
.../apache/catalina/core/AsyncListenerWrapper.java | 60 ++-
java/org/apache/catalina/core/Constants.java | 18 +
java/org/apache/catalina/core/ContainerBase.java | 45 +-
.../catalina/core/ContextNamingInfoListener.java | 6 +
.../catalina/core/DefaultInstanceManager.java | 51 ++
.../apache/catalina/core/FrameworkListener.java | 39 ++
.../apache/catalina/core/JniLifecycleListener.java | 30 ++
.../core/JreMemoryLeakPreventionListener.java | 56 ++
.../catalina/filters/AddDefaultCharsetFilter.java | 14 +
java/org/apache/catalina/filters/Constants.java | 15 +
java/org/apache/catalina/filters/CorsFilter.java | 6 +
.../catalina/filters/CsrfPreventionFilter.java | 72 +++
.../catalina/filters/CsrfPreventionFilterBase.java | 20 +-
.../org/apache/catalina/filters/ExpiresFilter.java | 140 ++++-
java/org/apache/catalina/filters/FilterBase.java | 19 +-
.../catalina/filters/HttpHeaderSecurityFilter.java | 88 +++
java/org/apache/catalina/ha/ClusterDeployer.java | 4 +-
java/org/apache/catalina/ha/ClusterListener.java | 16 +
java/org/apache/catalina/ha/ClusterManager.java | 6 +
java/org/apache/catalina/ha/ClusterMessage.java | 15 +-
.../org/apache/catalina/ha/ClusterMessageBase.java | 13 +
java/org/apache/catalina/ha/ClusterSession.java | 3 +
.../ha/authenticator/ClusterSingleSignOn.java | 46 ++
.../authenticator/ClusterSingleSignOnListener.java | 5 +
.../apache/catalina/ha/backend/CollectedInfo.java | 31 ++
.../catalina/ha/backend/HeartbeatListener.java | 68 ++-
.../apache/catalina/ha/deploy/FarmWarDeployer.java | 92 +++-
.../catalina/ha/deploy/FileChangeListener.java | 3 +
.../org/apache/catalina/ha/deploy/FileMessage.java | 53 ++
.../catalina/ha/deploy/FileMessageFactory.java | 21 +
.../apache/catalina/ha/session/BackupManager.java | 56 ++
.../catalina/ha/session/ClusterManagerBase.java | 50 ++
.../ha/session/ClusterSessionListener.java | 3 +
.../apache/catalina/ha/session/DeltaManager.java | 264 ++++++---
.../apache/catalina/ha/session/DeltaRequest.java | 147 ++++++
.../apache/catalina/ha/session/DeltaSession.java | 135 ++++-
java/org/apache/catalina/ha/tcp/Constants.java | 9 +
.../apache/catalina/loader/JdbcLeakPrevention.java | 12 +
.../catalina/loader/WebappClassLoaderBase.java | 20 +-
java/org/apache/catalina/manager/Constants.java | 51 ++
.../apache/catalina/manager/DummyProxySession.java | 8 +
.../catalina/manager/HTMLManagerServlet.java | 76 +++
.../apache/catalina/manager/JMXProxyServlet.java | 31 ++
java/org/apache/catalina/manager/JspHelper.java | 48 ++
.../apache/catalina/manager/host/Constants.java | 33 ++
.../manager/host/HTMLHostManagerServlet.java | 6 +
.../catalina/manager/host/HostManagerServlet.java | 6 +
java/org/apache/catalina/mapper/Constants.java | 9 +
.../apache/catalina/mbeans/BaseCatalinaMBean.java | 24 +
.../org/apache/catalina/mbeans/ClassNameMBean.java | 7 +
.../org/apache/catalina/mbeans/ConnectorMBean.java | 7 +
.../org/apache/catalina/mbeans/ContainerMBean.java | 9 +
.../catalina/mbeans/ContextEnvironmentMBean.java | 6 +
java/org/apache/catalina/mbeans/ContextMBean.java | 10 +
.../catalina/mbeans/ContextResourceLinkMBean.java | 6 +
.../catalina/mbeans/ContextResourceMBean.java | 6 +
.../mbeans/DataSourceUserDatabaseMBean.java | 19 +-
.../mbeans/GlobalResourcesLifecycleListener.java | 9 +
java/org/apache/catalina/mbeans/GroupMBean.java | 14 +-
.../catalina/realm/AuthenticatedUserRealm.java | 6 +
java/org/apache/catalina/realm/CombinedRealm.java | 14 +-
.../org/apache/catalina/realm/DataSourceRealm.java | 34 +-
.../realm/DigestCredentialHandlerBase.java | 25 +
.../apache/catalina/realm/GenericPrincipal.java | 10 +
.../catalina/realm/JAASMemoryLoginModule.java | 3 +
java/org/apache/catalina/realm/JAASRealm.java | 31 +-
java/org/apache/catalina/realm/JNDIRealm.java | 241 ++++++++-
java/org/apache/catalina/realm/MemoryRealm.java | 9 +-
java/org/apache/catalina/realm/RealmBase.java | 10 +-
java/org/apache/catalina/security/Constants.java | 15 +
.../catalina/servlets/DataSourcePropertyStore.java | 25 +-
.../apache/catalina/servlets/DefaultServlet.java | 77 +++
java/org/apache/catalina/session/Constants.java | 6 +
.../apache/catalina/session/DataSourceStore.java | 46 +-
java/org/apache/catalina/session/FileStore.java | 15 +-
java/org/apache/catalina/session/ManagerBase.java | 14 +
.../apache/catalina/session/StandardSession.java | 9 +-
java/org/apache/catalina/session/StoreBase.java | 4 +-
.../catalina/ssi/ByteArrayServletOutputStream.java | 4 +-
.../apache/catalina/ssi/ExpressionTokenizer.java | 35 +-
.../apache/catalina/startup/AddPortOffsetRule.java | 4 +
java/org/apache/catalina/startup/Bootstrap.java | 12 +
.../catalina/startup/ClassLoaderFactory.java | 26 +-
.../catalina/startup/ConnectorCreateRule.java | 11 +
java/org/apache/catalina/startup/Constants.java | 40 ++
.../org/apache/catalina/startup/ContextConfig.java | 231 ++++++++
java/org/apache/catalina/startup/EngineConfig.java | 7 +
java/org/apache/catalina/startup/ExpandWar.java | 7 +
.../org/apache/catalina/startup/FailedContext.java | 29 +
.../apache/catalina/startup/HomesUserDatabase.java | 10 +-
java/org/apache/catalina/startup/HostConfig.java | 56 +-
java/org/apache/catalina/startup/UserDatabase.java | 13 +-
.../org/apache/catalina/storeconfig/ChannelSF.java | 6 +
.../apache/catalina/storeconfig/ConnectorSF.java | 33 +-
.../storeconfig/ConnectorStoreAppender.java | 24 +
.../org/apache/catalina/storeconfig/Constants.java | 12 +
.../catalina/storeconfig/CredentialHandlerSF.java | 6 +
.../storeconfig/GlobalNamingResourcesSF.java | 7 +
.../apache/catalina/storeconfig/IStoreConfig.java | 3 +
.../apache/catalina/storeconfig/IStoreFactory.java | 7 +
.../apache/catalina/storeconfig/InterceptorSF.java | 6 +
.../apache/catalina/storeconfig/JarScannerSF.java | 6 +
.../apache/catalina/tribes/ChannelInterceptor.java | 18 +
.../apache/catalina/tribes/ChannelReceiver.java | 3 +
java/org/apache/catalina/tribes/JmxChannel.java | 3 +
.../apache/catalina/tribes/MembershipProvider.java | 2 +
.../apache/catalina/tribes/MembershipService.java | 12 +-
.../tribes/group/ChannelInterceptorBase.java | 13 +
.../apache/catalina/tribes/group/GroupChannel.java | 32 +-
.../catalina/tribes/group/GroupChannelMBean.java | 85 +++
.../catalina/tribes/group/InterceptorPayload.java | 19 +
.../interceptors/DomainFilterInterceptor.java | 32 ++
.../interceptors/DomainFilterInterceptorMBean.java | 23 +
.../group/interceptors/EncryptInterceptor.java | 22 +-
.../interceptors/EncryptInterceptorMBean.java | 44 +-
.../interceptors/FragmentationInterceptor.java | 90 ++++
.../FragmentationInterceptorMBean.java | 24 +
.../tribes/group/interceptors/GzipInterceptor.java | 31 +-
.../group/interceptors/GzipInterceptorMBean.java | 87 ++-
java/org/apache/catalina/tribes/io/BufferPool.java | 37 +-
.../tribes/io/DirectByteArrayOutputStream.java | 20 +
.../apache/catalina/tribes/jmx/JmxRegistry.java | 30 ++
.../catalina/tribes/membership/Constants.java | 16 +
.../membership/cloud/AbstractStreamProvider.java | 33 ++
.../membership/cloud/CloudMembershipProvider.java | 42 ++
.../membership/cloud/CloudMembershipService.java | 36 +-
.../cloud/CloudMembershipServiceMBean.java | 40 ++
.../membership/cloud/DNSMembershipProvider.java | 7 +
.../membership/cloud/InsecureStreamProvider.java | 3 +
.../tribes/tipis/AbstractReplicatedMap.java | 579 +++++++++++++++++++-
.../catalina/tribes/tipis/ReplicatedMapEntry.java | 4 +-
.../catalina/tribes/transport/AbstractRxTask.java | 56 ++
.../catalina/tribes/transport/AbstractSender.java | 209 +++++++-
.../catalina/tribes/transport/Constants.java | 32 ++
.../catalina/tribes/transport/DataSender.java | 9 +
java/org/apache/catalina/tribes/util/Arrays.java | 174 ++++++
.../catalina/tribes/util/ExceptionUtils.java | 7 +
.../catalina/tribes/util/ExecutorFactory.java | 34 ++
java/org/apache/catalina/users/AbstractGroup.java | 6 +
java/org/apache/catalina/users/AbstractRole.java | 6 +
java/org/apache/catalina/users/AbstractUser.java | 7 +-
java/org/apache/catalina/users/Constants.java | 9 +
.../catalina/users/DataSourceUserDatabase.java | 159 +++++-
.../users/DataSourceUserDatabaseFactory.java | 6 +
java/org/apache/catalina/util/ContextName.java | 28 +
java/org/apache/catalina/util/DOMWriter.java | 5 +
.../org/apache/catalina/util/ErrorPageSupport.java | 37 ++
.../org/apache/catalina/util/ExactRateLimiter.java | 7 +
java/org/apache/catalina/util/FastRateLimiter.java | 6 +
java/org/apache/catalina/util/FilterUtil.java | 7 +
java/org/apache/catalina/util/IOTools.java | 3 +
java/org/apache/catalina/util/Introspection.java | 6 +
java/org/apache/catalina/util/RateLimiter.java | 17 +-
.../catalina/valves/AbstractAccessLogValve.java | 109 +++-
.../org/apache/catalina/valves/AccessLogValve.java | 22 +
java/org/apache/catalina/valves/Constants.java | 31 ++
.../valves/CrawlerSessionManagerValve.java | 32 +-
.../apache/catalina/valves/ErrorReportValve.java | 29 +
.../catalina/valves/ExtendedAccessLogValve.java | 162 ++++++
.../apache/catalina/valves/HealthCheckValve.java | 30 ++
.../apache/catalina/valves/JsonAccessLogValve.java | 11 +
.../catalina/valves/JsonErrorReportValve.java | 3 +
.../valves/rewrite/InternalRewriteMap.java | 51 ++
.../webresources/AbstractArchiveResource.java | 7 +-
.../webresources/AbstractArchiveResourceSet.java | 7 +
.../webresources/AbstractFileResourceSet.java | 40 ++
.../catalina/webresources/AbstractResource.java | 60 +++
.../catalina/webresources/AbstractResourceSet.java | 115 ++++
.../AbstractSingleArchiveResource.java | 18 +-
.../AbstractSingleArchiveResourceSet.java | 8 +
java/org/apache/catalina/webresources/Cache.java | 91 ++++
.../webresources/ClasspathURLStreamHandler.java | 9 +
.../catalina/webresources/EmptyResource.java | 17 +
.../catalina/webresources/EmptyResourceSet.java | 5 +
.../catalina/webresources/ExtractingRoot.java | 6 +
.../apache/catalina/webresources/FileResource.java | 20 +
.../apache/catalina/webresources/JarResource.java | 8 +
.../catalina/webresources/JarResourceRoot.java | 11 +
.../catalina/webresources/JarWarResource.java | 9 +
.../catalina/webresources/JarWarResourceSet.java | 3 +
.../apache/catalina/webresources/StandardRoot.java | 4 +-
.../apache/catalina/webresources/war/Handler.java | 9 +
java/org/apache/coyote/AbstractProcessor.java | 72 ++-
java/org/apache/coyote/AbstractProcessorLight.java | 33 ++
java/org/apache/coyote/AbstractProtocol.java | 40 ++
java/org/apache/coyote/AsyncContextCallback.java | 3 +
java/org/apache/coyote/CloseNowException.java | 19 +
java/org/apache/coyote/CompressionConfig.java | 45 ++
java/org/apache/coyote/Constants.java | 57 ++
java/org/apache/coyote/ContinueResponseTiming.java | 7 +
java/org/apache/coyote/ErrorState.java | 18 +
java/org/apache/coyote/Processor.java | 6 +
java/org/apache/coyote/ajp/AjpMessage.java | 46 ++
java/org/apache/coyote/ajp/AjpNioProtocol.java | 1 +
java/org/apache/coyote/ajp/AjpProcessor.java | 20 +
java/org/apache/coyote/ajp/Constants.java | 242 ++++++++-
.../coyote/http11/AbstractHttp11Protocol.java | 307 ++++++++++-
java/org/apache/coyote/http11/Constants.java | 43 ++
.../coyote/http11/HeadersTooLargeException.java | 23 +-
.../apache/coyote/http11/Http11InputBuffer.java | 8 +
.../apache/coyote/http11/Http11NioProtocol.java | 28 +
.../apache/coyote/http11/Http11OutputBuffer.java | 40 ++
java/org/apache/coyote/http11/Http11Processor.java | 9 +
.../org/apache/coyote/http11/HttpOutputBuffer.java | 4 +
.../coyote/http11/filters/BufferedInputFilter.java | 5 +
.../coyote/http11/filters/ChunkedInputFilter.java | 15 +
.../coyote/http11/filters/ChunkedOutputFilter.java | 9 +
.../coyote/http11/filters/GzipOutputFilter.java | 23 +-
.../coyote/http11/filters/IdentityInputFilter.java | 11 +
.../http11/filters/IdentityOutputFilter.java | 6 +
.../http11/upgrade/InternalHttpUpgradeHandler.java | 4 +
java/org/apache/coyote/http2/AbstractStream.java | 8 +
java/org/apache/coyote/http2/Constants.java | 34 ++
java/org/apache/coyote/http2/HPackHuffman.java | 31 ++
.../coyote/http2/Http2AsyncUpgradeHandler.java | 29 +
.../org/apache/coyote/http2/Http2OutputBuffer.java | 10 +
java/org/apache/coyote/http2/Http2Parser.java | 21 +
java/org/apache/coyote/http2/Http2Protocol.java | 240 +++++++++
.../apache/coyote/http2/Http2UpgradeHandler.java | 144 ++++-
java/org/apache/el/ExpressionFactoryImpl.java | 6 +
java/org/apache/el/lang/ELArithmetic.java | 158 ++++++
java/org/apache/el/lang/ELSupport.java | 107 +++-
java/org/apache/el/lang/EvaluationContext.java | 29 +
java/org/apache/el/lang/ExpressionBuilder.java | 32 ++
java/org/apache/el/lang/FunctionMapperFactory.java | 20 +
java/org/apache/el/lang/FunctionMapperImpl.java | 49 ++
java/org/apache/el/parser/ELParser.java | 11 +-
java/org/apache/el/parser/NodeVisitor.java | 10 +-
java/org/apache/el/util/ConcurrentCache.java | 27 +
java/org/apache/el/util/ExceptionUtils.java | 7 +
java/org/apache/jasper/Constants.java | 9 +
java/org/apache/jasper/EmbeddedServletOptions.java | 27 +
java/org/apache/jasper/JasperException.java | 5 +
java/org/apache/jasper/JspC.java | 245 ++++++++-
java/org/apache/jasper/JspCompilationContext.java | 217 +++++++-
java/org/apache/jasper/Options.java | 75 ++-
java/org/apache/jasper/compiler/AntCompiler.java | 42 +-
.../org/apache/jasper/compiler/BeanRepository.java | 22 +
java/org/apache/jasper/compiler/Compiler.java | 52 ++
.../apache/jasper/compiler/ELFunctionMapper.java | 6 +
.../jasper/compiler/ELInterpreterFactory.java | 12 +
java/org/apache/jasper/compiler/ELNode.java | 187 ++++++-
java/org/apache/jasper/compiler/ELParser.java | 11 +
java/org/apache/jasper/compiler/JDTCompiler.java | 6 +
java/org/apache/jasper/compiler/JavaCompiler.java | 6 +
java/org/apache/jasper/compiler/JspConfig.java | 109 ++++
java/org/apache/jasper/el/ELContextImpl.java | 15 +
java/org/apache/jasper/el/ELContextWrapper.java | 6 +
java/org/apache/jasper/el/JasperELResolver.java | 12 +
java/org/apache/jasper/el/JspELException.java | 9 +
java/org/apache/jasper/el/JspMethodExpression.java | 13 +
.../jasper/el/JspMethodNotFoundException.java | 9 +
.../optimizations/ELInterpreterTagSetters.java | 6 +
java/org/apache/jasper/runtime/ExceptionUtils.java | 7 +
java/org/apache/jasper/runtime/HttpJspBase.java | 9 +
.../jasper/runtime/InstanceManagerFactory.java | 9 +
.../jasper/runtime/JspApplicationContextImpl.java | 21 +
.../apache/jasper/runtime/JspContextWrapper.java | 10 +
java/org/apache/jasper/runtime/JspFactoryImpl.java | 7 +
.../apache/jasper/runtime/JspFragmentHelper.java | 27 +
.../apache/jasper/servlet/JasperInitializer.java | 15 +
.../apache/jasper/tagplugins/jstl/core/Choose.java | 9 +
.../jasper/tagplugins/jstl/core/ForEach.java | 9 +
.../jasper/tagplugins/jstl/core/ForTokens.java | 9 +
.../org/apache/jasper/tagplugins/jstl/core/If.java | 9 +
.../apache/jasper/tagplugins/jstl/core/Import.java | 9 +
.../org/apache/jasper/util/FastRemovalDequeue.java | 13 +
java/org/apache/juli/AsyncFileHandler.java | 55 ++
java/org/apache/juli/ClassLoaderLogManager.java | 34 ++
java/org/apache/juli/DateFormatCache.java | 22 +
java/org/apache/juli/FileHandler.java | 48 ++
java/org/apache/juli/JdkLoggerFormatter.java | 25 +-
java/org/apache/juli/JsonFormatter.java | 3 +
java/org/apache/naming/AbstractRef.java | 22 +
.../org/apache/naming/ContextAccessController.java | 5 +
java/org/apache/naming/ContextBindings.java | 5 +
java/org/apache/naming/HandlerRef.java | 14 +
java/org/apache/naming/factory/BeanFactory.java | 3 +
java/org/apache/naming/factory/Constants.java | 43 ++
.../naming/factory/DataSourceLinkFactory.java | 37 ++
java/org/apache/naming/factory/EjbFactory.java | 7 +
java/org/apache/naming/factory/FactoryBase.java | 6 +
.../apache/naming/java/javaURLContextFactory.java | 9 +
java/org/apache/tomcat/ContextBind.java | 4 +
java/org/apache/tomcat/InstanceManager.java | 63 +++
.../org/apache/tomcat/InstanceManagerBindings.java | 27 +
java/org/apache/tomcat/Jar.java | 2 +
java/org/apache/tomcat/JarScanFilter.java | 8 +-
java/org/apache/tomcat/JarScanType.java | 12 +
java/org/apache/tomcat/JarScanner.java | 10 +
java/org/apache/tomcat/buildutil/CheckEol.java | 6 +
.../apache/tomcat/buildutil/ForceUtcTimeZone.java | 9 +
.../tomcat/buildutil/translate/BackportBase.java | 35 ++
.../buildutil/translate/BackportEnglish.java | 14 +
.../buildutil/translate/BackportTranslations.java | 14 +
.../tomcat/buildutil/translate/Constants.java | 31 ++
.../apache/tomcat/buildutil/translate/Import.java | 15 +
.../dbcp/dbcp2/managed/BasicManagedDataSource.java | 3 +
java/org/apache/tomcat/jni/AprStatus.java | 50 ++
java/org/apache/tomcat/jni/Buffer.java | 3 +
java/org/apache/tomcat/util/Diagnostics.java | 10 +
java/org/apache/tomcat/util/ExceptionUtils.java | 7 +
.../org/apache/tomcat/util/IntrospectionUtils.java | 93 +++-
java/org/apache/tomcat/util/bcel/Const.java | 6 +
.../bcel/classfile/AnnotationElementValue.java | 3 +
.../util/bcel/classfile/ArrayElementValue.java | 8 +
.../util/bcel/classfile/ClassElementValue.java | 3 +
.../tomcat/util/bcel/classfile/ConstantDouble.java | 4 +-
.../tomcat/util/bcel/classfile/ConstantFloat.java | 4 +-
.../util/bcel/classfile/ConstantInteger.java | 4 +-
.../tomcat/util/bcel/classfile/ConstantLong.java | 4 +-
.../tomcat/util/bcel/classfile/ConstantUtf8.java | 4 +-
.../tomcat/util/bcel/classfile/ElementValue.java | 47 ++
.../util/bcel/classfile/ElementValuePair.java | 10 +
.../util/bcel/classfile/EnumElementValue.java | 3 +
.../tomcat/util/bcel/classfile/JavaClass.java | 12 +-
java/org/apache/tomcat/util/buf/AbstractChunk.java | 52 ++
java/org/apache/tomcat/util/buf/Ascii.java | 6 +
java/org/apache/tomcat/util/buf/Asn1Parser.java | 91 ++++
java/org/apache/tomcat/util/buf/Asn1Writer.java | 34 ++
java/org/apache/tomcat/util/buf/B2CConverter.java | 17 +
.../apache/tomcat/util/buf/ByteBufferHolder.java | 21 +
.../apache/tomcat/util/buf/ByteBufferUtils.java | 1 +
java/org/apache/tomcat/util/buf/ByteChunk.java | 123 ++++-
java/org/apache/tomcat/util/buf/C2BConverter.java | 20 +
java/org/apache/tomcat/util/buf/CharChunk.java | 91 +++-
java/org/apache/tomcat/util/buf/CharsetCache.java | 13 +
java/org/apache/tomcat/util/buf/CharsetUtil.java | 10 +
.../tomcat/util/buf/EncodedSolidusHandling.java | 29 +
java/org/apache/tomcat/util/buf/HexUtils.java | 44 ++
.../tomcat/util/collections/ConcurrentCache.java | 27 +
.../util/collections/ConcurrentLruCache.java | 39 ++
.../tomcat/util/collections/SynchronizedStack.java | 15 +
.../org/apache/tomcat/util/compat/Jre22Compat.java | 9 +
java/org/apache/tomcat/util/compat/JreCompat.java | 21 +
.../org/apache/tomcat/util/compat/JrePlatform.java | 15 +
java/org/apache/tomcat/util/compat/JreVendor.java | 15 +
.../apache/tomcat/util/descriptor/Constants.java | 13 +
.../tomcat/util/descriptor/DigesterFactory.java | 6 +
.../tomcat/util/descriptor/InputSourceUtil.java | 8 +
.../util/descriptor/tld/ImplicitTldRuleSet.java | 6 +
.../util/descriptor/web/ApplicationParameter.java | 46 ++
.../tomcat/util/descriptor/web/Constants.java | 37 ++
.../tomcat/util/descriptor/web/ContextEjb.java | 36 ++
.../util/descriptor/web/ContextEnvironment.java | 25 +
.../tomcat/util/descriptor/web/ContextHandler.java | 65 +++
.../util/descriptor/web/ContextLocalEjb.java | 36 ++
.../util/descriptor/web/ContextResource.java | 51 ++
.../util/descriptor/web/ContextResourceEnvRef.java | 16 +
.../util/descriptor/web/ContextResourceLink.java | 26 +
.../tomcat/util/descriptor/web/ContextService.java | 138 ++++-
.../util/descriptor/web/ContextTransaction.java | 10 +-
.../tomcat/util/descriptor/web/ErrorPage.java | 25 +-
.../tomcat/util/descriptor/web/FilterDef.java | 109 +++-
.../tomcat/util/descriptor/web/FilterMap.java | 85 ++-
.../descriptor/web/FragmentJarScannerCallback.java | 17 +
.../tomcat/util/descriptor/web/Injectable.java | 19 +
.../util/descriptor/web/InjectionTarget.java | 32 ++
.../descriptor/web/JspConfigDescriptorImpl.java | 9 +
.../util/descriptor/web/JspPropertyGroup.java | 142 +++++
.../tomcat/util/descriptor/web/ResourceBase.java | 5 +-
.../digester/AbstractObjectCreationFactory.java | 6 +
java/org/apache/tomcat/util/digester/Digester.java | 122 +++++
.../tomcat/util/digester/DocumentProperties.java | 7 +-
.../util/digester/EnvironmentPropertySource.java | 7 +
.../util/digester/ObjectCreationFactory.java | 2 +
.../tomcat/util/file/ConfigurationSource.java | 27 +
.../tomcat/util/http/ConcurrentDateFormat.java | 20 +
.../apache/tomcat/util/http/CookieProcessor.java | 3 +
.../tomcat/util/http/CookieProcessorBase.java | 40 ++
.../tomcat/util/http/CookiesWithoutEquals.java | 22 +
.../tomcat/util/http/FastHttpDateFormat.java | 6 +
java/org/apache/tomcat/util/http/HeaderUtil.java | 10 +
.../util/http/fileupload/FileItemIterator.java | 7 +
.../tomcat/util/http/fileupload/IOUtils.java | 6 +
.../http/fileupload/impl/FileItemIteratorImpl.java | 15 +
.../tomcat/util/http/parser/AcceptEncoding.java | 28 +
.../tomcat/util/http/parser/AcceptLanguage.java | 26 +
.../tomcat/util/http/parser/ChunkExtension.java | 39 +-
.../tomcat/util/http/parser/ContentRange.java | 34 +-
.../apache/tomcat/util/http/parser/EntityTag.java | 10 +
java/org/apache/tomcat/util/http/parser/Host.java | 3 +
.../tomcat/util/http/parser/HttpHeaderParser.java | 31 ++
.../apache/tomcat/util/http/parser/HttpParser.java | 114 ++++
.../apache/tomcat/util/modeler/AttributeInfo.java | 73 ++-
.../apache/tomcat/util/modeler/BaseModelMBean.java | 36 +-
.../util/modeler/BaseNotificationBroadcaster.java | 6 +-
.../apache/tomcat/util/modeler/FeatureInfo.java | 32 +-
.../apache/tomcat/util/net/AbstractEndpoint.java | 546 ++++++++++++++++++-
java/org/apache/tomcat/util/net/Acceptor.java | 38 ++
.../tomcat/util/net/ApplicationBufferHandler.java | 8 +
java/org/apache/tomcat/util/net/Constants.java | 37 ++
java/org/apache/tomcat/util/net/DispatchType.java | 14 +
java/org/apache/tomcat/util/net/IPv6Utils.java | 6 +
.../util/net/openssl/ciphers/Authentication.java | 78 ++-
.../tomcat/util/net/openssl/ciphers/Cipher.java | 588 ++++++++++++---------
.../util/net/openssl/ciphers/Encryption.java | 25 +
.../util/net/openssl/ciphers/EncryptionLevel.java | 10 +
.../tomcat/util/net/openssl/ciphers/Group.java | 64 ++-
.../tomcat/util/scan/AbstractInputStreamJar.java | 15 +
java/org/apache/tomcat/util/scan/Constants.java | 25 +
java/org/apache/tomcat/util/scan/JarFactory.java | 15 +
.../org/apache/tomcat/util/scan/JarFileUrlJar.java | 7 +
.../tomcat/util/scan/JarFileUrlNestedJar.java | 6 +
.../util/security/ConcurrentMessageDigest.java | 35 ++
java/org/apache/tomcat/util/threads/Constants.java | 10 +
.../tomcat/util/threads/InlineExecutorService.java | 10 +
.../tomcat/websocket/AsyncChannelGroupUtil.java | 8 +
.../tomcat/websocket/AsyncChannelWrapper.java | 49 ++
.../websocket/AsyncChannelWrapperNonSecure.java | 5 +
.../websocket/AsyncChannelWrapperSecure.java | 6 +
.../tomcat/websocket/AuthenticationType.java | 43 ++
.../org/apache/tomcat/websocket/Authenticator.java | 29 +
.../tomcat/websocket/AuthenticatorFactory.java | 6 +
.../apache/tomcat/websocket/BackgroundProcess.java | 11 +
.../tomcat/websocket/BackgroundProcessManager.java | 15 +
.../tomcat/websocket/BasicAuthenticator.java | 5 +
.../tomcat/websocket/ClientEndpointHolder.java | 17 +
java/org/apache/tomcat/websocket/Constants.java | 152 +++++-
.../tomcat/websocket/DigestAuthenticator.java | 10 +
.../tomcat/websocket/EndpointClassHolder.java | 8 +
.../apache/tomcat/websocket/EndpointHolder.java | 8 +
.../apache/tomcat/websocket/pojo/Constants.java | 3 +
.../apache/tomcat/websocket/server/Constants.java | 9 +
.../server/DefaultServerEndpointConfigurator.java | 9 +
.../jdbc/naming/GenericNamingResourcesFactory.java | 14 +
.../apache/tomcat/jdbc/pool/ClassLoaderUtil.java | 19 +
.../apache/tomcat/jdbc/pool/ConnectionPool.java | 78 +++
.../org/apache/tomcat/jdbc/pool/DataSource.java | 5 +-
.../apache/tomcat/jdbc/pool/DataSourceFactory.java | 219 ++++++++
.../apache/tomcat/jdbc/pool/DataSourceProxy.java | 77 ++-
.../jdbc/pool/DisposableConnectionFacade.java | 5 +
.../apache/tomcat/jdbc/pool/FairBlockingQueue.java | 45 ++
.../apache/tomcat/jdbc/pool/JdbcInterceptor.java | 5 +-
.../apache/tomcat/jdbc/pool/PoolConfiguration.java | 25 +-
.../AbstractCreateStatementInterceptor.java | 47 +-
.../jdbc/pool/interceptor/AbstractQueryReport.java | 18 +
.../jdbc/pool/interceptor/ConnectionState.java | 29 +
.../interceptor/StatementDecoratorInterceptor.java | 2 +
.../tomcat/jdbc/pool/jmx/ConnectionPool.java | 66 +++
.../tomcat/jdbc/pool/jmx/ConnectionPoolMBean.java | 64 +++
.../org/apache/tomcat/jdbc/pool/jmx/JmxUtil.java | 23 +
507 files changed, 16999 insertions(+), 894 deletions(-)
diff --git a/java/org/apache/catalina/AsyncDispatcher.java b/java/org/apache/catalina/AsyncDispatcher.java
index 3783fd1c69..4b280c3b6b 100644
--- a/java/org/apache/catalina/AsyncDispatcher.java
+++ b/java/org/apache/catalina/AsyncDispatcher.java
@@ -22,6 +22,9 @@ import jakarta.servlet.ServletException;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
+/**
+ * Interface for performing asynchronous dispatch operations within the container.
+ */
public interface AsyncDispatcher {
/**
diff --git a/java/org/apache/catalina/Authenticator.java b/java/org/apache/catalina/Authenticator.java
index f5f7a883e2..dcaf8edbd3 100644
--- a/java/org/apache/catalina/Authenticator.java
+++ b/java/org/apache/catalina/Authenticator.java
@@ -45,7 +45,21 @@ public interface Authenticator {
*/
boolean authenticate(Request request, HttpServletResponse response) throws IOException;
+ /**
+ * Logs in the specified user for the given request.
+ *
+ * @param userName the user name
+ * @param password the password
+ * @param request the request being processed
+ *
+ * @throws ServletException if a login error occurs
+ */
void login(String userName, String password, Request request) throws ServletException;
+ /**
+ * Logs out the user associated with the given request.
+ *
+ * @param request the request being processed
+ */
void logout(Request request);
}
diff --git a/java/org/apache/catalina/Context.java b/java/org/apache/catalina/Context.java
index 330a977270..2fa2a074a9 100644
--- a/java/org/apache/catalina/Context.java
+++ b/java/org/apache/catalina/Context.java
@@ -444,7 +444,9 @@ public interface Context extends Container, ContextBind {
/**
- * @return the login configuration descriptor for this web application.
+ * Returns the login configuration descriptor for this web application.
+ *
+ * @return the login configuration, or {@code null} if not configured
*/
LoginConfig getLoginConfig();
@@ -458,7 +460,9 @@ public interface Context extends Container, ContextBind {
/**
- * @return the naming resources associated with this web application.
+ * Returns the naming resources associated with this web application.
+ *
+ * @return the naming resources, or {@code null} if not configured
*/
NamingResourcesImpl getNamingResources();
@@ -472,7 +476,9 @@ public interface Context extends Container, ContextBind {
/**
- * @return the context path for this web application.
+ * Returns the context path for this web application.
+ *
+ * @return the context path
*/
String getPath();
@@ -486,7 +492,9 @@ public interface Context extends Container, ContextBind {
/**
- * @return the public identifier of the deployment descriptor DTD that is currently being parsed.
+ * Returns the public identifier of the deployment descriptor DTD that is currently being parsed.
+ *
+ * @return the public identifier
*/
String getPublicId();
@@ -500,7 +508,9 @@ public interface Context extends Container, ContextBind {
/**
- * @return the reloadable flag for this web application.
+ * Returns whether automatic reloading is enabled for this web application.
+ *
+ * @return {@code true} if the web application is reloadable
*/
boolean getReloadable();
@@ -514,7 +524,9 @@ public interface Context extends Container, ContextBind {
/**
- * @return the override flag for this web application.
+ * Returns whether the container's default web.xml should be overridden by this web application's web.xml.
+ *
+ * @return {@code true} if the web application's web.xml overrides the default
*/
boolean getOverride();
@@ -528,7 +540,9 @@ public interface Context extends Container, ContextBind {
/**
- * @return the privileged flag for this web application.
+ * Returns whether this web application is privileged and can access container internals.
+ *
+ * @return {@code true} if the web application is privileged
*/
boolean getPrivileged();
@@ -542,13 +556,17 @@ public interface Context extends Container, ContextBind {
/**
- * @return the Servlet context for which this Context is a facade.
+ * Returns the ServletContext instance for which this Context acts as a facade.
+ *
+ * @return the ServletContext instance, or {@code null} if not yet initialized
*/
ServletContext getServletContext();
/**
- * @return the default session timeout (in minutes) for this web application.
+ * Returns the default session timeout in minutes for this web application.
+ *
+ * @return the session timeout in minutes
*/
int getSessionTimeout();
@@ -578,7 +596,9 @@ public interface Context extends Container, ContextBind {
void setSwallowAbortedUploads(boolean swallowAbortedUploads);
/**
- * @return the value of the swallowOutput flag.
+ * Returns whether stdout and stderr are redirected to the logger during servlet execution.
+ *
+ * @return {@code true} if output is swallowed and redirected to the logger
*/
boolean getSwallowOutput();
@@ -593,7 +613,9 @@ public interface Context extends Container, ContextBind {
/**
- * @return the Java class name of the Wrapper implementation used for servlets registered in this Context.
+ * Returns the Java class name of the Wrapper implementation used for servlets in this Context.
+ *
+ * @return the Wrapper implementation class name
*/
String getWrapperClass();
@@ -689,8 +711,9 @@ public interface Context extends Container, ContextBind {
void setJarScanner(JarScanner jarScanner);
/**
- * @return the {@link Authenticator} that is used by this context. This is always non-{@code null} for a started
- * Context
+ * Returns the Authenticator used by this context for handling authentication.
+ *
+ * @return the Authenticator instance, always non-null for a started context
*/
Authenticator getAuthenticator();
@@ -709,7 +732,9 @@ public interface Context extends Container, ContextBind {
boolean getLogEffectiveWebXml();
/**
- * @return the instance manager associated with this context.
+ * Returns the instance manager associated with this context.
+ *
+ * @return the instance manager associated with this context
*/
InstanceManager getInstanceManager();
@@ -742,6 +767,8 @@ public interface Context extends Container, ContextBind {
/**
+ * Returns the value of the parallel annotation scanning flag.
+ *
* @return the value of the parallel annotation scanning flag. If true, it will dispatch scanning to the utility
* executor.
*
@@ -944,28 +971,36 @@ public interface Context extends Container, ContextBind {
/**
- * @return the array of application listener class names configured for this application.
+ * Returns the array of application listener class names configured for this application.
+ *
+ * @return the array of application listener class names configured for this application
*/
String[] findApplicationListeners();
/**
- * @return the array of application parameters for this application.
+ * Returns the array of application parameters for this application.
+ *
+ * @return the array of application parameters for this application
*/
ApplicationParameter[] findApplicationParameters();
/**
+ * Returns the array of security constraints for this web application.
+ *
* @return the array of security constraints for this web application. If there are none, a zero-length array is
- * returned.
+ * returned
*/
SecurityConstraint[] findConstraints();
/**
- * @return the error page entry for the specified HTTP error code, if any; otherwise return <code>null</code>.
+ * Returns the error page entry for the specified HTTP error code.
*
* @param errorCode Error code to look up
+ *
+ * @return the error page entry for the specified HTTP error code, if any; otherwise return <code>null</code>
*/
ErrorPage findErrorPage(int errorCode);
@@ -983,57 +1018,73 @@ public interface Context extends Container, ContextBind {
/**
- * @return the array of defined error pages for all specified error codes and exception types.
+ * Returns the array of defined error pages for all specified error codes and exception types.
+ *
+ * @return the array of defined error pages for all specified error codes and exception types
*/
ErrorPage[] findErrorPages();
/**
- * @return the filter definition for the specified filter name, if any; otherwise return <code>null</code>.
+ * Returns the filter definition for the specified filter name.
*
* @param filterName Filter name to look up
+ *
+ * @return the filter definition for the specified filter name, if any; otherwise return <code>null</code>
*/
FilterDef findFilterDef(String filterName);
/**
- * @return the array of defined filters for this Context.
+ * Returns the array of defined filters for this Context.
+ *
+ * @return the array of defined filters for this Context
*/
FilterDef[] findFilterDefs();
/**
- * @return the array of filter mappings for this Context.
+ * Returns the array of filter mappings for this Context.
+ *
+ * @return the array of filter mappings for this Context
*/
FilterMap[] findFilterMaps();
/**
- * @return the MIME type to which the specified extension is mapped, if any; otherwise return <code>null</code>.
+ * Returns the MIME type to which the specified extension is mapped.
*
* @param extension Extension to map to a MIME type
+ *
+ * @return the MIME type to which the specified extension is mapped, if any; otherwise return <code>null</code>
*/
String findMimeMapping(String extension);
/**
- * @return the extensions for which MIME mappings are defined. If there are none, a zero-length array is returned.
+ * Returns the extensions for which MIME mappings are defined.
+ *
+ * @return the extensions for which MIME mappings are defined. If there are none, a zero-length array is returned
*/
String[] findMimeMappings();
/**
- * @return the value for the specified context initialization parameter name, if any; otherwise return
- * <code>null</code>.
+ * Returns the value for the specified context initialization parameter name.
*
* @param name Name of the parameter to return
+ *
+ * @return the value for the specified context initialization parameter name, if any; otherwise return
+ * <code>null</code>
*/
String findParameter(String name);
/**
+ * Returns the names of all defined context initialization parameters for this Context.
+ *
* @return the names of all defined context initialization parameters for this Context. If no parameters are
- * defined, a zero-length array is returned.
+ * defined, a zero-length array is returned
*/
String[] findParameters();
@@ -1050,38 +1101,48 @@ public interface Context extends Container, ContextBind {
/**
- * @return <code>true</code> if the specified security role is defined for this application; otherwise return
- * <code>false</code>.
+ * Checks if the specified security role is defined for this application.
*
* @param role Security role to verify
+ *
+ * @return <code>true</code> if the specified security role is defined for this application; otherwise return
+ * <code>false</code>
*/
boolean findSecurityRole(String role);
/**
+ * Returns the security roles defined for this application.
+ *
* @return the security roles defined for this application. If none have been defined, a zero-length array is
- * returned.
+ * returned
*/
String[] findSecurityRoles();
/**
- * @return the servlet name mapped by the specified pattern (if any); otherwise return <code>null</code>.
+ * Returns the servlet name mapped by the specified pattern.
*
* @param pattern Pattern for which a mapping is requested
+ *
+ * @return the servlet name mapped by the specified pattern (if any); otherwise return <code>null</code>
*/
String findServletMapping(String pattern);
/**
+ * Returns the patterns of all defined servlet mappings for this Context.
+ *
* @return the patterns of all defined servlet mappings for this Context. If no mappings are defined, a zero-length
- * array is returned.
+ * array is returned
*/
String[] findServletMappings();
/**
- * @return the associated ThreadBindingListener.
+ * Returns the associated ThreadBindingListener.
+ *
+ * @return the associated ThreadBindingListener
*/
ThreadBindingListener getThreadBindingListener();
@@ -1096,36 +1157,46 @@ public interface Context extends Container, ContextBind {
/**
+ * Returns the array of watched resources for this Context.
+ *
* @return the array of watched resources for this Context. If none are defined, a zero length array will be
- * returned.
+ * returned
*/
String[] findWatchedResources();
/**
- * @return <code>true</code> if the specified welcome file is defined for this Context; otherwise return
- * <code>false</code>.
+ * Checks if the specified welcome file is defined for this Context.
*
* @param name the welcome file to verify
+ *
+ * @return <code>true</code> if the specified welcome file is defined for this Context; otherwise return
+ * <code>false</code>
*/
boolean findWelcomeFile(String name);
/**
+ * Returns the array of welcome files defined for this Context.
+ *
* @return the array of welcome files defined for this Context. If none are defined, a zero-length array is
- * returned.
+ * returned
*/
String[] findWelcomeFiles();
/**
- * @return the array of LifecycleListener classes that will be added to newly created Wrappers automatically.
+ * Returns the array of LifecycleListener classes that will be added to newly created Wrappers automatically.
+ *
+ * @return the array of LifecycleListener classes that will be added to newly created Wrappers automatically
*/
String[] findWrapperLifecycles();
/**
- * @return the array of ContainerListener classes that will be added to newly created Wrappers automatically.
+ * Returns the array of ContainerListener classes that will be added to newly created Wrappers automatically.
+ *
+ * @return the array of ContainerListener classes that will be added to newly created Wrappers automatically
*/
String[] findWrapperListeners();
@@ -1278,15 +1349,19 @@ public interface Context extends Container, ContextBind {
/**
- * @return the real path for a given virtual path, if possible; otherwise return <code>null</code>.
+ * Returns the real path for a given virtual path.
*
* @param path The path to the desired resource
+ *
+ * @return the real path for a given virtual path, if possible; otherwise return <code>null</code>
*/
String getRealPath(String path);
/**
- * @return the effective major version of the Servlet spec used by this context.
+ * Returns the effective major version of the Servlet spec used by this context.
+ *
+ * @return the effective major version of the Servlet spec used by this context
*/
int getEffectiveMajorVersion();
@@ -1300,7 +1375,9 @@ public interface Context extends Container, ContextBind {
/**
- * @return the effective minor version of the Servlet spec used by this context.
+ * Returns the effective minor version of the Servlet spec used by this context.
+ *
+ * @return the effective minor version of the Servlet spec used by this context
*/
int getEffectiveMinorVersion();
@@ -1314,7 +1391,9 @@ public interface Context extends Container, ContextBind {
/**
- * @return the JSP configuration for this context. Will be null if there is no JSP configuration.
+ * Returns the JSP configuration for this context.
+ *
+ * @return the JSP configuration for this context. Will be null if there is no JSP configuration
*/
JspConfigDescriptor getJspConfigDescriptor();
@@ -1389,7 +1468,9 @@ public interface Context extends Container, ContextBind {
boolean isResourceOnlyServlet(String servletName);
/**
- * @return the base name to use for WARs, directories or context.xml files for this context.
+ * Returns the base name to use for WARs, directories or context.xml files for this context.
+ *
+ * @return the base name to use for WARs, directories or context.xml files for this context
*/
String getBaseName();
@@ -1402,8 +1483,10 @@ public interface Context extends Container, ContextBind {
void setWebappVersion(String webappVersion);
/**
- * @return The version of this web application, used to differentiate different versions of the same web application
- * when using parallel deployment. If not specified, defaults to the empty string.
+ * Returns the version of this web application, used to differentiate different versions of the same web application
+ * when using parallel deployment.
+ *
+ * @return the version of this web application. If not specified, defaults to the empty string
*/
String getWebappVersion();
@@ -1415,7 +1498,9 @@ public interface Context extends Container, ContextBind {
void setFireRequestListenersOnForwards(boolean enable);
/**
- * @return whether or not requests listeners will be fired on forwards for this Context.
+ * Returns whether or not request listeners will be fired on forwards for this Context.
+ *
+ * @return whether or not request listeners will be fired on forwards for this Context
*/
boolean getFireRequestListenersOnForwards();
@@ -1428,8 +1513,11 @@ public interface Context extends Container, ContextBind {
void setPreemptiveAuthentication(boolean enable);
/**
- * @return if a user presents authentication credentials, will the context will process them when the request is for
- * a non-protected resource.
+ * Returns whether the context will process authentication credentials when the request is for a non-protected
+ * resource.
+ *
+ * @return {@code true} if a user presents authentication credentials, the context will process them when the
+ * request is for a non-protected resource
*/
boolean getPreemptiveAuthentication();
@@ -1441,12 +1529,16 @@ public interface Context extends Container, ContextBind {
void setSendRedirectBody(boolean enable);
/**
- * @return if the context is configured to include a response body as part of a redirect response.
+ * Returns whether the context is configured to include a response body as part of a redirect response.
+ *
+ * @return {@code true} if the context is configured to include a response body as part of a redirect response
*/
boolean getSendRedirectBody();
/**
- * @return the Loader with which this Context is associated.
+ * Returns the Loader with which this Context is associated.
+ *
+ * @return the Loader with which this Context is associated
*/
Loader getLoader();
@@ -1458,7 +1550,9 @@ public interface Context extends Container, ContextBind {
void setLoader(Loader loader);
/**
- * @return the Resources with which this Context is associated.
+ * Returns the Resources with which this Context is associated.
+ *
+ * @return the Resources with which this Context is associated
*/
WebResourceRoot getResources();
@@ -1470,8 +1564,10 @@ public interface Context extends Container, ContextBind {
void setResources(WebResourceRoot resources);
/**
+ * Returns the Manager with which this Context is associated.
+ *
* @return the Manager with which this Context is associated. If there is no associated Manager, return
- * <code>null</code>.
+ * <code>null</code>
*/
Manager getManager();
@@ -1492,8 +1588,11 @@ public interface Context extends Container, ContextBind {
void setAddWebinfClassesResources(boolean addWebinfClassesResources);
/**
+ * Returns the flag that indicates if /WEB-INF/classes should be treated like an exploded JAR and JAR resources made
+ * available as if they were in a JAR.
+ *
* @return the flag that indicates if /WEB-INF/classes should be treated like an exploded JAR and JAR resources made
- * available as if they were in a JAR.
+ * available as if they were in a JAR
*/
boolean getAddWebinfClassesResources();
@@ -1576,7 +1675,9 @@ public interface Context extends Container, ContextBind {
Map<String,String> findPreDestroyMethods();
/**
- * @return the token necessary for operations on the associated JNDI naming context.
+ * Returns the token necessary for operations on the associated JNDI naming context.
+ *
+ * @return the token necessary for operations on the associated JNDI naming context
*/
Object getNamingToken();
@@ -1590,7 +1691,9 @@ public interface Context extends Container, ContextBind {
void setCookieProcessor(CookieProcessor cookieProcessor);
/**
- * @return the {@link CookieProcessor} that will be used to process cookies for this Context.
+ * Returns the {@link CookieProcessor} that will be used to process cookies for this Context.
+ *
+ * @return the {@link CookieProcessor} that will be used to process cookies for this Context
*/
CookieProcessor getCookieProcessor();
@@ -1739,9 +1842,14 @@ public interface Context extends Container, ContextBind {
boolean getAllowMultipleLeadingForwardSlashInPath();
+ /**
+ * Increment the count of in-progress async requests.
+ */
void incrementInProgressAsyncCount();
-
+ /**
+ * Decrement the count of in-progress async requests.
+ */
void decrementInProgressAsyncCount();
diff --git a/java/org/apache/catalina/Engine.java b/java/org/apache/catalina/Engine.java
index 7d7727dbf3..bba5af7803 100644
--- a/java/org/apache/catalina/Engine.java
+++ b/java/org/apache/catalina/Engine.java
@@ -36,7 +36,9 @@ package org.apache.catalina;
public interface Engine extends Container {
/**
- * @return the default host name for this Engine.
+ * Returns the default host name for this Engine.
+ *
+ * @return the default host name
*/
String getDefaultHost();
@@ -50,7 +52,9 @@ public interface Engine extends Container {
/**
- * @return the JvmRouteId for this engine.
+ * Returns the JvmRouteId for this engine.
+ *
+ * @return the JVM Route ID
*/
String getJvmRoute();
@@ -64,7 +68,9 @@ public interface Engine extends Container {
/**
- * @return the <code>Service</code> with which we are associated (if any).
+ * Returns the <code>Service</code> with which we are associated (if any).
+ *
+ * @return the associated Service, or {@code null} if none
*/
Service getService();
diff --git a/java/org/apache/catalina/Executor.java b/java/org/apache/catalina/Executor.java
index bf9b5754f0..4d4664c9eb 100644
--- a/java/org/apache/catalina/Executor.java
+++ b/java/org/apache/catalina/Executor.java
@@ -18,5 +18,10 @@ package org.apache.catalina;
public interface Executor extends java.util.concurrent.Executor, Lifecycle {
+ /**
+ * Returns the name of this executor.
+ *
+ * @return the executor name
+ */
String getName();
}
\ No newline at end of file
diff --git a/java/org/apache/catalina/Globals.java b/java/org/apache/catalina/Globals.java
index 259cb4c439..039a2d2e09 100644
--- a/java/org/apache/catalina/Globals.java
+++ b/java/org/apache/catalina/Globals.java
@@ -20,12 +20,24 @@ package org.apache.catalina;
* Global constants that are applicable to multiple packages within Catalina.
*/
public final class Globals {
+ /**
+ * Default constructor for Globals.
+ */
+ public Globals() {
+ super();
+ }
// ------------------------------------------------- Request attribute names
+ /**
+ * Request attribute name indicating async is supported.
+ */
public static final String ASYNC_SUPPORTED_ATTR = "org.apache.catalina.ASYNC_SUPPORTED";
+ /**
+ * Request attribute name for the GSS credential.
+ */
public static final String GSS_CREDENTIAL_ATTR = "org.apache.catalina.realm.GSS_CREDENTIAL";
@@ -254,5 +266,8 @@ public final class Globals {
// ----------------------------------------- Specification related constants
+ /**
+ * Content type for form URL encoding.
+ */
public static final String CONTENT_TYPE_FORM_URL_ENCODING = "application/x-www-form-urlencoded";
}
diff --git a/java/org/apache/catalina/Group.java b/java/org/apache/catalina/Group.java
index 1862c9a98f..1a9cd666dd 100644
--- a/java/org/apache/catalina/Group.java
+++ b/java/org/apache/catalina/Group.java
@@ -32,6 +32,8 @@ public interface Group extends Principal {
// ------------------------------------------------------------- Properties
/**
+ * Returns the description of this group.
+ *
* @return the description of this group.
*/
String getDescription();
@@ -46,6 +48,8 @@ public interface Group extends Principal {
/**
+ * Returns the group name of this group, which must be unique within the scope of a {@link UserDatabase}.
+ *
* @return the group name of this group, which must be unique within the scope of a {@link UserDatabase}.
*/
String getGroupname();
@@ -60,18 +64,24 @@ public interface Group extends Principal {
/**
+ * Returns the set of {@link Role}s assigned specifically to this group.
+ *
* @return the set of {@link Role}s assigned specifically to this group.
*/
Iterator<Role> getRoles();
/**
+ * Returns the {@link UserDatabase} within which this Group is defined.
+ *
* @return the {@link UserDatabase} within which this Group is defined.
*/
UserDatabase getUserDatabase();
/**
+ * Returns the set of {@link User}s that are members of this group.
+ *
* @return the set of {@link User}s that are members of this group.
*/
Iterator<User> getUsers();
diff --git a/java/org/apache/catalina/Host.java b/java/org/apache/catalina/Host.java
index 2ed42c4332..45f4f8ebb9 100644
--- a/java/org/apache/catalina/Host.java
+++ b/java/org/apache/catalina/Host.java
@@ -60,8 +60,10 @@ public interface Host extends Container {
/**
- * @return the XML root for this Host. This can be an absolute pathname or a relative pathname. If null, the base
- * path defaults to ${catalina.base}/conf/<engine name>/<host name> directory
+ * Get the XML root for this Host. This can be an absolute pathname or a relative pathname. If null, the base
+ * path defaults to ${catalina.base}/conf/<engine name>/<host name> directory.
+ *
+ * @return the XML root
*/
String getXmlBase();
@@ -74,19 +76,25 @@ public interface Host extends Container {
void setXmlBase(String xmlBase);
/**
- * @return a default configuration path of this Host. The file will be canonical if possible.
+ * Get the default configuration path of this Host. The file will be canonical if possible.
+ *
+ * @return the configuration base file
*/
File getConfigBaseFile();
/**
- * @return the application root for this Host. This can be an absolute pathname, a relative pathname, or a URL.
+ * Get the application root for this Host. This can be an absolute pathname, a relative pathname, or a URL.
+ *
+ * @return the application root
*/
String getAppBase();
/**
- * @return an absolute {@link File} for the appBase of this Host. The file will be canonical if possible. There is
- * no guarantee that the appBase exists.
+ * Get an absolute {@link File} for the appBase of this Host. The file will be canonical if possible. There is
+ * no guarantee that the appBase exists.
+ *
+ * @return the application base file
*/
File getAppBaseFile();
@@ -100,15 +108,19 @@ public interface Host extends Container {
/**
- * @return the legacy (Java EE) application root for this Host. This can be an absolute pathname, a relative
- * pathname, or a URL.
+ * Get the legacy (Java EE) application root for this Host. This can be an absolute pathname, a relative
+ * pathname, or a URL.
+ *
+ * @return the legacy application root
*/
String getLegacyAppBase();
/**
- * @return an absolute {@link File} for the legacy (Java EE) appBase of this Host. The file will be canonical if
- * possible. There is no guarantee that the appBase exists.
+ * Get an absolute {@link File} for the legacy (Java EE) appBase of this Host. The file will be canonical if
+ * possible. There is no guarantee that the appBase exists.
+ *
+ * @return the legacy application base file
*/
File getLegacyAppBaseFile();
@@ -123,8 +135,10 @@ public interface Host extends Container {
/**
- * @return the value of the auto deploy flag. If true, it indicates that this host's child webapps should be
- * discovered and automatically deployed dynamically.
+ * Get the value of the auto deploy flag. If true, it indicates that this host's child webapps should be
+ * discovered and automatically deployed dynamically.
+ *
+ * @return the auto deploy flag
*/
boolean getAutoDeploy();
@@ -138,7 +152,9 @@ public interface Host extends Container {
/**
- * @return the Java class name of the context configuration class for new web applications.
+ * Get the Java class name of the context configuration class for new web applications.
+ *
+ * @return the context configuration class name
*/
String getConfigClass();
@@ -152,8 +168,10 @@ public interface Host extends Container {
/**
- * @return the value of the deploy on startup flag. If true, it indicates that this host's child webapps should be
- * discovered and automatically deployed.
+ * Get the value of the deploy on startup flag. If true, it indicates that this host's child webapps should be
+ * discovered and automatically deployed.
+ *
+ * @return the deploy on startup flag
*/
boolean getDeployOnStartup();
@@ -167,15 +185,19 @@ public interface Host extends Container {
/**
- * @return the regular expression that defines the files and directories in the host's appBase that will be ignored
- * by the automatic deployment process.
+ * Get the regular expression that defines the files and directories in the host's appBase that will be ignored
+ * by the automatic deployment process.
+ *
+ * @return the deploy ignore regular expression
*/
String getDeployIgnore();
/**
- * @return the compiled regular expression that defines the files and directories in the host's appBase that will be
- * ignored by the automatic deployment process.
+ * Get the compiled regular expression that defines the files and directories in the host's appBase that will be
+ * ignored by the automatic deployment process.
+ *
+ * @return the compiled deploy ignore pattern
*/
Pattern getDeployIgnorePattern();
@@ -190,8 +212,10 @@ public interface Host extends Container {
/**
- * @return the executor that is used for starting and stopping contexts. This is primarily for use by components
- * deploying contexts that want to do this in a multithreaded manner.
+ * Get the executor that is used for starting and stopping contexts. This is primarily for use by components
+ * deploying contexts that want to do this in a multithreaded manner.
+ *
+ * @return the start/stop executor
*/
ExecutorService getStartStopExecutor();
@@ -214,9 +238,10 @@ public interface Host extends Container {
/**
- * @return <code>true</code> of the Host is configured to automatically undeploy old versions of applications
- * deployed using parallel deployment. This only takes effect is {@link #getAutoDeploy()} also returns
- * <code>true</code>.
+ * Get whether the Host is configured to automatically undeploy old versions of applications deployed using
+ * parallel deployment. This only takes effect if {@link #getAutoDeploy()} also returns {@code true}.
+ *
+ * @return the undeploy old versions flag
*/
boolean getUndeployOldVersions();
@@ -241,7 +266,9 @@ public interface Host extends Container {
/**
- * @return the array of alias names for this Host. If none are defined, a zero length array is returned.
+ * Get the array of alias names for this Host. If none are defined, a zero length array is returned.
+ *
+ * @return the array of alias names
*/
String[] findAliases();
diff --git a/java/org/apache/catalina/Manager.java b/java/org/apache/catalina/Manager.java
index dbca6ff4b2..6c54bb371e 100644
--- a/java/org/apache/catalina/Manager.java
+++ b/java/org/apache/catalina/Manager.java
@@ -56,6 +56,8 @@ public interface Manager {
/**
+ * Returns the session id generator for this manager.
+ *
* @return the session id generator
*/
SessionIdGenerator getSessionIdGenerator();
diff --git a/java/org/apache/catalina/Pipeline.java b/java/org/apache/catalina/Pipeline.java
index 0680f96453..2098778d66 100644
--- a/java/org/apache/catalina/Pipeline.java
+++ b/java/org/apache/catalina/Pipeline.java
@@ -32,7 +32,10 @@ import java.util.Set;
public interface Pipeline extends Contained {
/**
- * @return the Valve instance that has been distinguished as the basic Valve for this Pipeline (if any).
+ * Returns the basic Valve for this Pipeline. The basic Valve is always executed last in the pipeline
+ * and is responsible for processing the request and creating the response.
+ *
+ * @return the basic Valve for this Pipeline, or {@code null} if none has been set
*/
Valve getBasic();
@@ -74,8 +77,10 @@ public interface Pipeline extends Contained {
/**
- * @return the array of Valves in the pipeline associated with this Container, including the basic Valve (if any).
- * If there are no such Valves, a zero-length array is returned.
+ * Returns all Valves in the pipeline, including the basic Valve. Valves are returned in the order
+ * they will be executed, with the basic Valve last.
+ *
+ * @return the array of Valves in the pipeline, or an empty array if no Valves are configured
*/
Valve[] getValves();
@@ -95,7 +100,10 @@ public interface Pipeline extends Contained {
/**
- * @return the Valve instance that has been distinguished as the basic Valve for this Pipeline (if any).
+ * Returns the first Valve in the pipeline. This is the Valve that will be executed first
+ * when a request enters the pipeline.
+ *
+ * @return the first Valve in the pipeline, or {@code null} if the pipeline is empty
*/
Valve getFirst();
diff --git a/java/org/apache/catalina/Realm.java b/java/org/apache/catalina/Realm.java
index eb5f24be12..2c67ae4d6b 100644
--- a/java/org/apache/catalina/Realm.java
+++ b/java/org/apache/catalina/Realm.java
@@ -36,7 +36,9 @@ import org.ietf.jgss.GSSName;
public interface Realm extends Contained {
/**
- * @return the CredentialHandler configured for this Realm.
+ * Returns the CredentialHandler configured for this Realm.
+ *
+ * @return the CredentialHandler configured for this Realm
*/
CredentialHandler getCredentialHandler();
diff --git a/java/org/apache/catalina/Role.java b/java/org/apache/catalina/Role.java
index d3d019a9c8..f760cc4fa9 100644
--- a/java/org/apache/catalina/Role.java
+++ b/java/org/apache/catalina/Role.java
@@ -35,13 +35,15 @@ public interface Role extends Principal {
/**
- * @return the description of this role.
+ * Gets the description of this role.
+ *
+ * @return The description of this role
*/
String getDescription();
/**
- * Set the description of this role.
+ * Sets the description of this role.
*
* @param description The new description
*/
@@ -49,13 +51,15 @@ public interface Role extends Principal {
/**
- * @return the role name of this role, which must be unique within the scope of a {@link UserDatabase}.
+ * Gets the role name of this role, which must be unique within the scope of a {@link UserDatabase}.
+ *
+ * @return The role name
*/
String getRolename();
/**
- * Set the role name of this role, which must be unique within the scope of a {@link UserDatabase}.
+ * Sets the role name of this role, which must be unique within the scope of a {@link UserDatabase}.
*
* @param rolename The new role name
*/
@@ -63,7 +67,9 @@ public interface Role extends Principal {
/**
- * @return the {@link UserDatabase} within which this Role is defined.
+ * Gets the {@link UserDatabase} within which this Role is defined.
+ *
+ * @return The UserDatabase within which this Role is defined
*/
UserDatabase getUserDatabase();
diff --git a/java/org/apache/catalina/Session.java b/java/org/apache/catalina/Session.java
index ed37b1e158..d6da5a0390 100644
--- a/java/org/apache/catalina/Session.java
+++ b/java/org/apache/catalina/Session.java
@@ -65,7 +65,9 @@ public interface Session {
/**
- * @return the authentication type used to authenticate our cached Principal, if any.
+ * Returns the authentication type used to authenticate the cached Principal, if any.
+ *
+ * @return the authentication type
*/
String getAuthType();
@@ -79,13 +81,17 @@ public interface Session {
/**
- * @return the creation time for this session.
+ * Returns the creation time for this session.
+ *
+ * @return the creation time in milliseconds since midnight, January 1, 1970 GMT
*/
long getCreationTime();
/**
- * @return the creation time for this session, bypassing the session validity checks.
+ * Returns the creation time for this session, bypassing the session validity checks.
+ *
+ * @return the creation time in milliseconds since midnight, January 1, 1970 GMT
*/
long getCreationTimeInternal();
@@ -100,13 +106,17 @@ public interface Session {
/**
- * @return the session identifier for this session.
+ * Returns the session identifier for this session.
+ *
+ * @return the session identifier
*/
String getId();
/**
- * @return the session identifier for this session.
+ * Returns the session identifier for this session, bypassing validity checks.
+ *
+ * @return the session identifier
*/
String getIdInternal();
@@ -131,49 +141,63 @@ public interface Session {
/**
- * @return the last time the client sent a request associated with this session, as the number of milliseconds since
- * midnight, January 1, 1970 GMT. Actions that your application takes, such as getting or setting a
- * value associated with the session, do not affect the access time. This one gets updated whenever a
- * request starts.
+ * Returns the last time the client sent a request associated with this session, as the number of milliseconds since
+ * midnight, January 1, 1970 GMT. Actions that your application takes, such as getting or setting a
+ * value associated with the session, do not affect the access time. This one gets updated whenever a
+ * request starts.
+ *
+ * @return the last access time in milliseconds
*/
long getThisAccessedTime();
/**
- * @return the last client access time without invalidation check
+ * Returns the last client access time without invalidation check.
+ *
+ * @return the last access time in milliseconds
*
* @see #getThisAccessedTime()
*/
long getThisAccessedTimeInternal();
/**
- * @return the last time the client sent a request associated with this session, as the number of milliseconds since
- * midnight, January 1, 1970 GMT. Actions that your application takes, such as getting or setting a
- * value associated with the session, do not affect the access time. This one gets updated whenever a
- * request finishes.
+ * Returns the last time the client sent a request associated with this session, as the number of milliseconds since
+ * midnight, January 1, 1970 GMT. Actions that your application takes, such as getting or setting a
+ * value associated with the session, do not affect the access time. This one gets updated whenever a
+ * request finishes.
+ *
+ * @return the last access time in milliseconds
*/
long getLastAccessedTime();
/**
- * @return the last client access time without invalidation check
+ * Returns the last client access time without invalidation check.
+ *
+ * @return the last access time in milliseconds
*
* @see #getLastAccessedTime()
*/
long getLastAccessedTimeInternal();
/**
- * @return the idle time (in milliseconds) from last client access time.
+ * Returns the idle time from last client access time.
+ *
+ * @return the idle time in milliseconds
*/
long getIdleTime();
/**
- * @return the idle time from last client access time without invalidation check
+ * Returns the idle time from last client access time without invalidation check.
+ *
+ * @return the idle time in milliseconds
*
* @see #getIdleTime()
*/
long getIdleTimeInternal();
/**
- * @return the Manager within which this Session is valid.
+ * Returns the Manager within which this Session is valid.
+ *
+ * @return the manager
*/
Manager getManager();
@@ -187,8 +211,10 @@ public interface Session {
/**
- * @return the maximum time interval, in seconds, between client requests before the servlet container will
- * invalidate the session. A negative time indicates that the session should never time out.
+ * Returns the maximum time interval, in seconds, between client requests before the servlet container will
+ * invalidate the session. A negative time indicates that the session should never time out.
+ *
+ * @return the maximum inactive interval in seconds
*/
int getMaxInactiveInterval();
@@ -211,10 +237,12 @@ public interface Session {
/**
- * @return the authenticated Principal that is associated with this Session. This provides an
- * <code>Authenticator</code> with a means to cache a previously authenticated Principal, and avoid
- * potentially expensive <code>Realm.authenticate()</code> calls on every request. If there is no
- * current associated Principal, return <code>null</code>.
+ * Returns the authenticated Principal that is associated with this Session. This provides an
+ * <code>Authenticator</code> with a means to cache a previously authenticated Principal, and avoid
+ * potentially expensive <code>Realm.authenticate()</code> calls on every request. If there is no
+ * current associated Principal, return <code>null</code>.
+ *
+ * @return the authenticated principal, or {@code null} if none
*/
Principal getPrincipal();
@@ -230,7 +258,9 @@ public interface Session {
/**
- * @return the <code>HttpSession</code> for which this object is the facade.
+ * Returns the <code>HttpSession</code> for which this object is the facade.
+ *
+ * @return the HTTP session
*/
HttpSession getSession();
@@ -244,7 +274,9 @@ public interface Session {
/**
- * @return <code>true</code> if the session is still valid
+ * Returns whether the session is still valid.
+ *
+ * @return {@code true} if the session is valid
*/
boolean isValid();
@@ -281,16 +313,20 @@ public interface Session {
/**
- * @return the object bound with the specified name to the internal notes for this session, or <code>null</code> if
- * no such binding exists.
+ * Returns the object bound with the specified name to the internal notes for this session, or <code>null</code> if
+ * no such binding exists.
*
* @param name Name of the note to be returned
+ *
+ * @return the note object, or {@code null} if not found
*/
Object getNote(String name);
/**
- * @return an Iterator containing the String names of all notes bindings that exist for this session.
+ * Returns an Iterator containing the String names of all notes bindings that exist for this session.
+ *
+ * @return the iterator of note names
*/
Iterator<String> getNoteNames();
diff --git a/java/org/apache/catalina/Store.java b/java/org/apache/catalina/Store.java
index 42d51c6fa4..095df95c9a 100644
--- a/java/org/apache/catalina/Store.java
+++ b/java/org/apache/catalina/Store.java
@@ -29,7 +29,9 @@ import java.io.IOException;
public interface Store {
/**
- * @return the Manager instance associated with this Store.
+ * Return the Manager instance associated with this Store.
+ *
+ * @return the Manager instance
*/
Manager getManager();
@@ -43,8 +45,9 @@ public interface Store {
/**
- * @return the number of Sessions present in this Store.
+ * Return the number of Sessions present in this Store.
*
+ * @return the number of Sessions
* @exception IOException if an input/output error occurs
*/
int getSize() throws IOException;
@@ -59,9 +62,10 @@ public interface Store {
/**
- * @return an array containing the session identifiers of all Sessions currently saved in this Store. If there are
- * no such Sessions, a zero-length array is returned.
+ * Return an array containing the session identifiers of all Sessions currently saved in this Store. If there are
+ * no such Sessions, a zero-length array is returned.
*
+ * @return the session identifiers
* @exception IOException if an input/output error occurred
*/
String[] keys() throws IOException;
diff --git a/java/org/apache/catalina/TomcatPrincipal.java b/java/org/apache/catalina/TomcatPrincipal.java
index 582a6b5de6..0fc083a5fc 100644
--- a/java/org/apache/catalina/TomcatPrincipal.java
+++ b/java/org/apache/catalina/TomcatPrincipal.java
@@ -28,12 +28,16 @@ import org.ietf.jgss.GSSCredential;
public interface TomcatPrincipal extends Principal {
/**
- * @return The authenticated Principal to be exposed to applications.
+ * Returns the authenticated principal to be exposed to applications.
+ *
+ * @return The authenticated principal to be exposed to applications
*/
Principal getUserPrincipal();
/**
- * @return The user's delegated credentials.
+ * Returns the user's delegated GSS credentials.
+ *
+ * @return The user's delegated credentials
*/
GSSCredential getGssCredential();
diff --git a/java/org/apache/catalina/User.java b/java/org/apache/catalina/User.java
index 6deb8f1f0a..15c729811e 100644
--- a/java/org/apache/catalina/User.java
+++ b/java/org/apache/catalina/User.java
@@ -35,6 +35,8 @@ public interface User extends Principal {
/**
+ * Returns the full name of this user.
+ *
* @return the full name of this user.
*/
String getFullName();
@@ -49,12 +51,16 @@ public interface User extends Principal {
/**
+ * Returns the set of {@link Group}s to which this user belongs.
+ *
* @return the set of {@link Group}s to which this user belongs.
*/
Iterator<Group> getGroups();
/**
+ * Returns the logon password of this user.
+ *
* @return the logon password of this user, optionally prefixed with the identifier of an encoding scheme surrounded
* by curly braces, such as <code>{md5}xxxxx</code>.
*/
@@ -71,18 +77,24 @@ public interface User extends Principal {
/**
+ * Returns the set of {@link Role}s assigned specifically to this user.
+ *
* @return the set of {@link Role}s assigned specifically to this user.
*/
Iterator<Role> getRoles();
/**
+ * Returns the {@link UserDatabase} within which this User is defined.
+ *
* @return the {@link UserDatabase} within which this User is defined.
*/
UserDatabase getUserDatabase();
/**
+ * Returns the logon username of this user.
+ *
* @return the logon username of this user, which must be unique within the scope of a {@link UserDatabase}.
*/
String getUsername();
diff --git a/java/org/apache/catalina/UserDatabase.java b/java/org/apache/catalina/UserDatabase.java
index adbda89d2b..5d2639a740 100644
--- a/java/org/apache/catalina/UserDatabase.java
+++ b/java/org/apache/catalina/UserDatabase.java
@@ -29,25 +29,33 @@ public interface UserDatabase {
// ------------------------------------------------------------- Properties
- /**
+ /**
+ * Get the set of {@link Group}s defined in this user database.
+ *
* @return the set of {@link Group}s defined in this user database.
*/
Iterator<Group> getGroups();
- /**
+ /**
+ * Get the unique global identifier of this user database.
+ *
* @return the unique global identifier of this user database.
*/
String getId();
- /**
+ /**
+ * Get the set of {@link Role}s defined in this user database.
+ *
* @return the set of {@link Role}s defined in this user database.
*/
Iterator<Role> getRoles();
- /**
+ /**
+ * Get the set of {@link User}s defined in this user database.
+ *
* @return the set of {@link User}s defined in this user database.
*/
Iterator<User> getUsers();
@@ -97,26 +105,29 @@ public interface UserDatabase {
User createUser(String username, String password, String fullName);
- /**
- * @return the {@link Group} with the specified group name, if any; otherwise return <code>null</code>.
+ /**
+ * Find the {@link Group} with the specified group name.
*
* @param groupname Name of the group to return
+ * @return the {@link Group} with the specified group name, if any; otherwise return <code>null</code>.
*/
Group findGroup(String groupname);
- /**
- * @return the {@link Role} with the specified role name, if any; otherwise return <code>null</code>.
+ /**
+ * Find the {@link Role} with the specified role name.
*
* @param rolename Name of the role to return
+ * @return the {@link Role} with the specified role name, if any; otherwise return <code>null</code>.
*/
Role findRole(String rolename);
- /**
- * @return the {@link User} with the specified username, if any; otherwise return <code>null</code>.
+ /**
+ * Find the {@link User} with the specified username.
*
* @param username Name of the user to return
+ * @return the {@link User} with the specified username, if any; otherwise return <code>null</code>.
*/
User findUser(String username);
diff --git a/java/org/apache/catalina/WebResourceRoot.java b/java/org/apache/catalina/WebResourceRoot.java
index 42820e84e9..a644cde8c4 100644
--- a/java/org/apache/catalina/WebResourceRoot.java
+++ b/java/org/apache/catalina/WebResourceRoot.java
@@ -394,7 +394,9 @@ public interface WebResourceRoot extends Lifecycle {
void deregisterTrackedResource(TrackedWebResource trackedResource);
/**
- * @return the list of {@link WebResourceSet#getBaseUrl()} for all {@link WebResourceSet}s used by this root.
+ * Get the list of {@link WebResourceSet#getBaseUrl()} for all {@link WebResourceSet}s used by this root.
+ *
+ * @return the list of {@link WebResourceSet#getBaseUrl()} for all {@link WebResourceSet}s used by this root
*/
List<URL> getBaseUrls();
diff --git a/java/org/apache/catalina/WebResourceSet.java b/java/org/apache/catalina/WebResourceSet.java
index 231434f9b6..e06f04682a 100644
--- a/java/org/apache/catalina/WebResourceSet.java
+++ b/java/org/apache/catalina/WebResourceSet.java
@@ -79,6 +79,11 @@ public interface WebResourceSet extends Lifecycle {
*/
boolean write(String path, InputStream is, boolean overwrite);
+ /**
+ * Sets the root for this resource set.
+ *
+ * @param root The root
+ */
void setRoot(WebResourceRoot root);
/**
@@ -91,6 +96,11 @@ public interface WebResourceSet extends Lifecycle {
*/
boolean getClassLoaderOnly();
+ /**
+ * Sets whether this resource set is class loader only.
+ *
+ * @param classLoaderOnly <code>true</code> if this resource set is class loader only
+ */
void setClassLoaderOnly(boolean classLoaderOnly);
/**
@@ -103,6 +113,11 @@ public interface WebResourceSet extends Lifecycle {
*/
boolean getStaticOnly();
+ /**
+ * Sets whether this resource set is static only.
+ *
+ * @param staticOnly <code>true</code> if this resource set is static only
+ */
void setStaticOnly(boolean staticOnly);
/**
diff --git a/java/org/apache/catalina/ant/AbstractCatalinaCommandTask.java b/java/org/apache/catalina/ant/AbstractCatalinaCommandTask.java
index 3f385c148a..e410cff669 100644
--- a/java/org/apache/catalina/ant/AbstractCatalinaCommandTask.java
+++ b/java/org/apache/catalina/ant/AbstractCatalinaCommandTask.java
@@ -26,6 +26,12 @@ import org.apache.tools.ant.BuildException;
*/
public abstract class AbstractCatalinaCommandTask extends AbstractCatalinaTask {
+ /**
+ * Create a new instance.
+ */
+ public AbstractCatalinaCommandTask() {
+ }
+
/**
* The context path of the web application we are managing.
*/
diff --git a/java/org/apache/catalina/ant/AbstractCatalinaTask.java b/java/org/apache/catalina/ant/AbstractCatalinaTask.java
index fab102dbcb..311377cc6d 100644
--- a/java/org/apache/catalina/ant/AbstractCatalinaTask.java
+++ b/java/org/apache/catalina/ant/AbstractCatalinaTask.java
@@ -40,6 +40,12 @@ import org.apache.tools.ant.Project;
*/
public abstract class AbstractCatalinaTask extends BaseRedirectorHelperTask {
+ /**
+ * Construct a new instance of this task.
+ */
+ protected AbstractCatalinaTask() {
+ }
+
// ----------------------------------------------------- Instance Variables
/**
@@ -55,10 +61,20 @@ public abstract class AbstractCatalinaTask extends BaseRedirectorHelperTask {
*/
protected String charset = "ISO-8859-1";
+ /**
+ * Returns the charset used during URL encoding.
+ *
+ * @return the charset
+ */
public String getCharset() {
return charset;
}
+ /**
+ * Sets the charset used during URL encoding.
+ *
+ * @param charset the charset to set
+ */
public void setCharset(String charset) {
this.charset = charset;
}
@@ -69,10 +85,20 @@ public abstract class AbstractCatalinaTask extends BaseRedirectorHelperTask {
*/
protected String password = null;
+ /**
+ * Returns the login password for the Manager application.
+ *
+ * @return the password
+ */
public String getPassword() {
return this.password;
}
+ /**
+ * Sets the login password for the Manager application.
+ *
+ * @param password the password to set
+ */
public void setPassword(String password) {
this.password = password;
}
@@ -83,10 +109,20 @@ public abstract class AbstractCatalinaTask extends BaseRedirectorHelperTask {
*/
protected String url = "http://localhost:8080/manager/text";
+ /**
+ * Returns the URL of the Manager application to be used.
+ *
+ * @return the url
+ */
public String getUrl() {
return this.url;
}
+ /**
+ * Sets the URL of the Manager application to be used.
+ *
+ * @param url the url to set
+ */
public void setUrl(String url) {
this.url = url;
}
@@ -97,10 +133,20 @@ public abstract class AbstractCatalinaTask extends BaseRedirectorHelperTask {
*/
protected String username = null;
+ /**
+ * Returns the login username for the Manager application.
+ *
+ * @return the username
+ */
public String getUsername() {
return this.username;
}
+ /**
+ * Sets the login username for the Manager application.
+ *
+ * @param username the username to set
+ */
public void setUsername(String username) {
this.username = username;
}
@@ -117,10 +163,20 @@ public abstract class AbstractCatalinaTask extends BaseRedirectorHelperTask {
*/
protected boolean ignoreResponseConstraint = false;
+ /**
+ * Returns whether the constraint on the first line of the response message is ignored.
+ *
+ * @return true if the constraint is ignored
+ */
public boolean isIgnoreResponseConstraint() {
return ignoreResponseConstraint;
}
+ /**
+ * Sets whether the constraint on the first line of the response message is ignored.
+ *
+ * @param ignoreResponseConstraint true to ignore the constraint
+ */
public void setIgnoreResponseConstraint(boolean ignoreResponseConstraint) {
this.ignoreResponseConstraint = ignoreResponseConstraint;
}
diff --git a/java/org/apache/catalina/ant/BaseRedirectorHelperTask.java b/java/org/apache/catalina/ant/BaseRedirectorHelperTask.java
index ed3a1dfafd..7443bb3df3 100644
--- a/java/org/apache/catalina/ant/BaseRedirectorHelperTask.java
+++ b/java/org/apache/catalina/ant/BaseRedirectorHelperTask.java
@@ -40,6 +40,12 @@ import org.apache.tools.ant.types.RedirectorElement;
*/
public abstract class BaseRedirectorHelperTask extends Task {
+ /**
+ * Default constructor.
+ */
+ public BaseRedirectorHelperTask() {
+ }
+
/** Redirector helper */
protected final Redirector redirector = new Redirector(this);
diff --git a/java/org/apache/catalina/ant/DeployTask.java b/java/org/apache/catalina/ant/DeployTask.java
index a8b2b43013..9b26a31a7f 100644
--- a/java/org/apache/catalina/ant/DeployTask.java
+++ b/java/org/apache/catalina/ant/DeployTask.java
@@ -36,6 +36,13 @@ import org.apache.tools.ant.BuildException;
*/
public class DeployTask extends AbstractCatalinaCommandTask {
+ /**
+ * Default constructor.
+ */
+ public DeployTask() {
+ super();
+ }
+
private static final Pattern PROTOCOL_PATTERN = Pattern.compile("\\w{3,5}\\:");
/**
@@ -43,10 +50,20 @@ public class DeployTask extends AbstractCatalinaCommandTask {
*/
protected String config = null;
+ /**
+ * Get the context configuration file URL.
+ *
+ * @return Context configuration file URL
+ */
public String getConfig() {
return this.config;
}
+ /**
+ * Set the context configuration file URL.
+ *
+ * @param config Context configuration file URL
+ */
public void setConfig(String config) {
this.config = config;
}
@@ -57,10 +74,20 @@ public class DeployTask extends AbstractCatalinaCommandTask {
*/
protected String localWar = null;
+ /**
+ * Get the local WAR file path.
+ *
+ * @return Local WAR file path
+ */
public String getLocalWar() {
return this.localWar;
}
+ /**
+ * Set the local WAR file path.
+ *
+ * @param localWar Local WAR file path
+ */
public void setLocalWar(String localWar) {
this.localWar = localWar;
}
@@ -71,10 +98,20 @@ public class DeployTask extends AbstractCatalinaCommandTask {
*/
protected String tag = null;
+ /**
+ * Get the deployment tag.
+ *
+ * @return Deployment tag
+ */
public String getTag() {
return this.tag;
}
+ /**
+ * Set the deployment tag.
+ *
+ * @param tag Deployment tag
+ */
public void setTag(String tag) {
this.tag = tag;
}
@@ -85,10 +122,20 @@ public class DeployTask extends AbstractCatalinaCommandTask {
*/
protected boolean update = false;
+ /**
+ * Check if existing webapps should be updated.
+ *
+ * @return {@code true} if existing webapps should be updated
+ */
public boolean getUpdate() {
return this.update;
}
+ /**
+ * Set whether to update existing webapps.
+ *
+ * @param update {@code true} to update existing webapps
+ */
public void setUpdate(boolean update) {
this.update = update;
}
@@ -99,10 +146,20 @@ public class DeployTask extends AbstractCatalinaCommandTask {
*/
protected String war = null;
+ /**
+ * Get the WAR file URL.
+ *
+ * @return WAR file URL
+ */
public String getWar() {
return this.war;
}
+ /**
+ * Set the WAR file URL.
+ *
+ * @param war WAR file URL
+ */
public void setWar(String war) {
this.war = war;
}
diff --git a/java/org/apache/catalina/ant/FindLeaksTask.java b/java/org/apache/catalina/ant/FindLeaksTask.java
index 3eb44df7d3..3428816326 100644
--- a/java/org/apache/catalina/ant/FindLeaksTask.java
+++ b/java/org/apache/catalina/ant/FindLeaksTask.java
@@ -22,6 +22,12 @@ import org.apache.tools.ant.BuildException;
* Ant task that implements the <code>/findleaks</code> command, supported by the Tomcat manager application.
*/
public class FindLeaksTask extends AbstractCatalinaTask {
+ /**
+ * Creates a new FindLeaksTask instance.
+ */
+ public FindLeaksTask() {
+ // Default constructor
+ }
private boolean statusLine = true;
diff --git a/java/org/apache/catalina/ant/JKStatusUpdateTask.java b/java/org/apache/catalina/ant/JKStatusUpdateTask.java
index f1d3a70f5d..1f0c136665 100644
--- a/java/org/apache/catalina/ant/JKStatusUpdateTask.java
+++ b/java/org/apache/catalina/ant/JKStatusUpdateTask.java
@@ -57,7 +57,7 @@ public class JKStatusUpdateTask extends AbstractCatalinaTask {
private String workerLb;
/**
- *
+ * Constructs a new JKStatusUpdateTask.
*/
public JKStatusUpdateTask() {
super();
@@ -65,182 +65,234 @@ public class JKStatusUpdateTask extends AbstractCatalinaTask {
}
/**
- * @return Returns the internalid.
+ * Get the internal ID.
+ *
+ * @return the internal ID
*/
public int getInternalid() {
return internalid;
}
/**
- * @param internalid The internalid to set.
+ * Set the internal ID.
+ *
+ * @param internalid the internal ID to set
*/
public void setInternalid(int internalid) {
this.internalid = internalid;
}
/**
- * @return Returns the lbForceSession.
+ * Get the lbForceSession flag.
+ *
+ * @return the lbForceSession flag
*/
public Boolean getLbForceSession() {
return lbForceSession;
}
/**
- * @param lbForceSession The lbForceSession to set.
+ * Set the lbForceSession flag.
+ *
+ * @param lbForceSession the value to set
*/
public void setLbForceSession(Boolean lbForceSession) {
this.lbForceSession = lbForceSession;
}
/**
- * @return Returns the lbRecovertime.
+ * Get the lbRecovertime value.
+ *
+ * @return the lbRecovertime value
*/
public Integer getLbRecovertime() {
return lbRecovertime;
}
/**
- * @param lbRecovertime The lbRecovertime to set.
+ * Set the lbRecovertime value.
+ *
+ * @param lbRecovertime the value to set
*/
public void setLbRecovertime(Integer lbRecovertime) {
this.lbRecovertime = lbRecovertime;
}
/**
- * @return Returns the lbRetries.
+ * Get the lbRetries value.
+ *
+ * @return the lbRetries value
*/
public Integer getLbRetries() {
return lbRetries;
}
/**
- * @param lbRetries The lbRetries to set.
+ * Set the lbRetries value.
+ *
+ * @param lbRetries the value to set
*/
public void setLbRetries(Integer lbRetries) {
this.lbRetries = lbRetries;
}
/**
- * @return Returns the lbStickySession.
+ * Get the lbStickySession flag.
+ *
+ * @return the lbStickySession flag
*/
public Boolean getLbStickySession() {
return lbStickySession;
}
/**
- * @param lbStickySession The lbStickySession to set.
+ * Set the lbStickySession flag.
+ *
+ * @param lbStickySession the value to set
*/
public void setLbStickySession(Boolean lbStickySession) {
this.lbStickySession = lbStickySession;
}
/**
- * @return Returns the worker.
+ * Get the worker name.
+ *
+ * @return the worker name
*/
public String getWorker() {
return worker;
}
/**
- * @param worker The worker to set.
+ * Set the worker name.
+ *
+ * @param worker the worker name to set
*/
public void setWorker(String worker) {
this.worker = worker;
}
/**
- * @return Returns the workerType.
+ * Get the worker type.
+ *
+ * @return the worker type
*/
public String getWorkerType() {
return workerType;
}
/**
- * @param workerType The workerType to set.
+ * Set the worker type.
+ *
+ * @param workerType the worker type to set
*/
public void setWorkerType(String workerType) {
this.workerType = workerType;
}
/**
- * @return Returns the workerLb.
+ * Get the worker load balancing configuration.
+ *
+ * @return the worker load balancing configuration
*/
public String getWorkerLb() {
return workerLb;
}
/**
- * @param workerLb The workerLb to set.
+ * Set the worker load balancing configuration.
+ *
+ * @param workerLb the value to set
*/
public void setWorkerLb(String workerLb) {
this.workerLb = workerLb;
}
/**
- * @return Returns the workerClusterDomain.
+ * Get the worker cluster domain.
+ *
+ * @return the worker cluster domain
*/
public String getWorkerClusterDomain() {
return workerClusterDomain;
}
/**
- * @param workerClusterDomain The workerClusterDomain to set.
+ * Set the worker cluster domain.
+ *
+ * @param workerClusterDomain the value to set
*/
public void setWorkerClusterDomain(String workerClusterDomain) {
this.workerClusterDomain = workerClusterDomain;
}
/**
- * @return Returns the workerDisabled.
+ * Get the worker disabled flag.
+ *
+ * @return the worker disabled flag
*/
public Boolean getWorkerDisabled() {
return workerDisabled;
}
/**
- * @param workerDisabled The workerDisabled to set.
+ * Set the worker disabled flag.
+ *
+ * @param workerDisabled the value to set
*/
public void setWorkerDisabled(Boolean workerDisabled) {
this.workerDisabled = workerDisabled;
}
/**
- * @return Returns the workerStopped.
+ * Get the worker stopped flag.
+ *
+ * @return the worker stopped flag
*/
public Boolean getWorkerStopped() {
return workerStopped;
}
/**
- * @param workerStopped The workerStopped to set.
+ * Set the worker stopped flag.
+ *
+ * @param workerStopped the value to set
*/
public void setWorkerStopped(Boolean workerStopped) {
this.workerStopped = workerStopped;
}
/**
- * @return Returns the workerLoadFactor.
+ * Get the worker load factor.
+ *
+ * @return the worker load factor
*/
public Integer getWorkerLoadFactor() {
return workerLoadFactor;
}
/**
- * @param workerLoadFactor The workerLoadFactor to set.
+ * Set the worker load factor.
+ *
+ * @param workerLoadFactor the value to set
*/
public void setWorkerLoadFactor(Integer workerLoadFactor) {
this.workerLoadFactor = workerLoadFactor;
}
/**
- * @return Returns the workerRedirect.
+ * Get the worker redirect target.
+ *
+ * @return the worker redirect target
*/
public String getWorkerRedirect() {
return workerRedirect;
}
/**
- * @param workerRedirect The workerRedirect to set.
+ * Set the worker redirect target.
+ *
+ * @param workerRedirect the value to set
*/
public void setWorkerRedirect(String workerRedirect) {
this.workerRedirect = workerRedirect;
diff --git a/java/org/apache/catalina/ant/JMXGetTask.java b/java/org/apache/catalina/ant/JMXGetTask.java
index cf1d996984..45f28d5ba1 100644
--- a/java/org/apache/catalina/ant/JMXGetTask.java
+++ b/java/org/apache/catalina/ant/JMXGetTask.java
@@ -29,6 +29,12 @@ import org.apache.tools.ant.BuildException;
*/
public class JMXGetTask extends AbstractCatalinaTask {
+ /**
+ * Constructs a new JMXGetTask.
+ */
+ public JMXGetTask() {
+ }
+
// Properties
/**
diff --git a/java/org/apache/catalina/ant/JMXQueryTask.java b/java/org/apache/catalina/ant/JMXQueryTask.java
index 6cffd3f528..a413d98338 100644
--- a/java/org/apache/catalina/ant/JMXQueryTask.java
+++ b/java/org/apache/catalina/ant/JMXQueryTask.java
@@ -29,6 +29,12 @@ import org.apache.tools.ant.BuildException;
*/
public class JMXQueryTask extends AbstractCatalinaTask {
+ /**
+ * Constructs a new JMXQueryTask.
+ */
+ public JMXQueryTask() {
+ }
+
// Properties
/**
diff --git a/java/org/apache/catalina/ant/JMXSetTask.java b/java/org/apache/catalina/ant/JMXSetTask.java
index d27d875a0a..13de5e88c6 100644
--- a/java/org/apache/catalina/ant/JMXSetTask.java
+++ b/java/org/apache/catalina/ant/JMXSetTask.java
@@ -29,6 +29,12 @@ import org.apache.tools.ant.BuildException;
*/
public class JMXSetTask extends AbstractCatalinaTask {
+ /**
+ * Constructs a new JMXSetTask.
+ */
+ public JMXSetTask() {
+ }
+
// Properties
/**
diff --git a/java/org/apache/catalina/ant/jmx/Arg.java b/java/org/apache/catalina/ant/jmx/Arg.java
index ba9059cae8..26e2d612f5 100644
--- a/java/org/apache/catalina/ant/jmx/Arg.java
+++ b/java/org/apache/catalina/ant/jmx/Arg.java
@@ -16,23 +16,52 @@
*/
package org.apache.catalina.ant.jmx;
+/**
+ * Represents a single argument for JMX operations.
+ */
public class Arg {
+ /**
+ * Constructs a new Arg.
+ */
+ public Arg() {
+ }
+
private String type;
private String value;
+ /**
+ * Sets the argument type.
+ *
+ * @param type the argument type
+ */
public void setType(String type) {
this.type = type;
}
+ /**
+ * Sets the argument value.
+ *
+ * @param value the argument value
+ */
public void setValue(String value) {
this.value = value;
}
+ /**
+ * Returns the argument value.
+ *
+ * @return the argument value
+ */
public String getValue() {
return value;
}
+ /**
+ * Returns the argument type.
+ *
+ * @return the argument type
+ */
public String getType() {
return type;
}
diff --git a/java/org/apache/catalina/ant/jmx/JMXAccessorCondition.java b/java/org/apache/catalina/ant/jmx/JMXAccessorCondition.java
index bc20178342..b09a323546 100644
--- a/java/org/apache/catalina/ant/jmx/JMXAccessorCondition.java
+++ b/java/org/apache/catalina/ant/jmx/JMXAccessorCondition.java
@@ -81,6 +81,12 @@ import org.apache.tools.ant.BuildException;
*/
public class JMXAccessorCondition extends JMXAccessorConditionBase {
+ /**
+ * Constructs a new JMXAccessorCondition.
+ */
+ public JMXAccessorCondition() {
+ }
+
// ----------------------------------------------------- Instance Variables
private String operation = "==";
@@ -92,35 +98,45 @@ public class JMXAccessorCondition extends JMXAccessorConditionBase {
// ----------------------------------------------------- Properties
/**
- * @return Returns the operation.
+ * Get the comparison operation.
+ *
+ * @return the operation
*/
public String getOperation() {
return operation;
}
/**
- * @param operation The operation to set.
+ * Set the comparison operation.
+ *
+ * @param operation the operation to set
*/
public void setOperation(String operation) {
this.operation = operation;
}
/**
- * @return Returns the type.
+ * Get the data type for comparison.
+ *
+ * @return the type
*/
public String getType() {
return type;
}
/**
- * @param type The type to set.
+ * Set the data type for comparison.
+ *
+ * @param type the type to set
*/
public void setType(String type) {
this.type = type;
}
/**
- * @return Returns the ifCondition.
+ * Get the if condition property name.
+ *
+ * @return the if condition property name
*/
public String getIf() {
return ifCondition;
@@ -136,7 +152,9 @@ public class JMXAccessorCondition extends JMXAccessorConditionBase {
}
/**
- * @return Returns the unlessCondition.
+ * Get the unless condition property name.
+ *
+ * @return the unless condition property name
*/
public String getUnless() {
return unlessCondition;
diff --git a/java/org/apache/catalina/ant/jmx/JMXAccessorConditionBase.java b/java/org/apache/catalina/ant/jmx/JMXAccessorConditionBase.java
index 1b355508a0..e114f25439 100644
--- a/java/org/apache/catalina/ant/jmx/JMXAccessorConditionBase.java
+++ b/java/org/apache/catalina/ant/jmx/JMXAccessorConditionBase.java
@@ -25,8 +25,17 @@ import javax.management.ObjectName;
import org.apache.tools.ant.ProjectComponent;
import org.apache.tools.ant.taskdefs.condition.Condition;
+/**
+ * Base class for JMX accessor conditions.
+ */
public abstract class JMXAccessorConditionBase extends ProjectComponent implements Condition {
+ /**
+ * Constructs a new JMXAccessorConditionBase.
+ */
+ public JMXAccessorConditionBase() {
+ }
+
private String url = null;
private String host = "localhost";
private String port = "8050";
@@ -38,124 +47,162 @@ public abstract class JMXAccessorConditionBase extends ProjectComponent implemen
private String ref = "jmx.server";
/**
- * @return Returns the attribute.
+ * Get the attribute name.
+ *
+ * @return the attribute name
*/
public String getAttribute() {
return attribute;
}
/**
- * @param attribute The attribute to set.
+ * Set the attribute name.
+ *
+ * @param attribute the attribute name to set
*/
public void setAttribute(String attribute) {
this.attribute = attribute;
}
/**
- * @return Returns the host.
+ * Get the JMX host.
+ *
+ * @return the JMX host
*/
public String getHost() {
return host;
}
/**
- * @param host The host to set.
+ * Set the JMX host.
+ *
+ * @param host the host to set
*/
public void setHost(String host) {
this.host = host;
}
/**
- * @return Returns the name.
+ * Get the MBean object name.
+ *
+ * @return the MBean object name
*/
public String getName() {
return name;
}
/**
- * @param objectName The name to set.
+ * Set the MBean object name.
+ *
+ * @param objectName the name to set
*/
public void setName(String objectName) {
this.name = objectName;
}
/**
- * @return Returns the password.
+ * Get the JMX password.
+ *
+ * @return the JMX password
*/
public String getPassword() {
return password;
}
/**
- * @param password The password to set.
+ * Set the JMX password.
+ *
+ * @param password the password to set
*/
public void setPassword(String password) {
this.password = password;
}
/**
- * @return Returns the port.
+ * Get the JMX port.
+ *
+ * @return the JMX port
*/
public String getPort() {
return port;
}
/**
- * @param port The port to set.
+ * Set the JMX port.
+ *
+ * @param port the port to set
*/
public void setPort(String port) {
this.port = port;
}
/**
- * @return Returns the url.
+ * Get the JMX URL.
+ *
+ * @return the JMX URL
*/
public String getUrl() {
return url;
}
/**
- * @param url The url to set.
+ * Set the JMX URL.
+ *
+ * @param url the URL to set
*/
public void setUrl(String url) {
this.url = url;
}
/**
- * @return Returns the username.
+ * Get the JMX username.
+ *
+ * @return the JMX username
*/
public String getUsername() {
return username;
}
/**
- * @param username The username to set.
+ * Set the JMX username.
+ *
+ * @param username the username to set
*/
public void setUsername(String username) {
this.username = username;
}
/**
- * @return Returns the value.
+ * Get the expected attribute value.
+ *
+ * @return the expected attribute value
*/
public String getValue() {
return value;
}
- // The setter for the "value" attribute
+ /**
+ * Set the expected attribute value.
+ *
+ * @param value the value to set
+ */
public void setValue(String value) {
this.value = value;
}
/**
- * @return Returns the ref.
+ * Get the project reference for the JMX connection.
+ *
+ * @return the project reference
*/
public String getRef() {
return ref;
}
/**
- * @param refId The ref to set.
+ * Set the project reference for the JMX connection.
+ *
+ * @param refId the reference to set
*/
public void setRef(String refId) {
this.ref = refId;
diff --git a/java/org/apache/catalina/ant/jmx/JMXAccessorCreateTask.java b/java/org/apache/catalina/ant/jmx/JMXAccessorCreateTask.java
index a70100bb9b..be1fa8ee2f 100644
--- a/java/org/apache/catalina/ant/jmx/JMXAccessorCreateTask.java
+++ b/java/org/apache/catalina/ant/jmx/JMXAccessorCreateTask.java
@@ -57,6 +57,13 @@ import org.apache.tools.ant.BuildException;
* @since 5.5.12
*/
public class JMXAccessorCreateTask extends JMXAccessorTask {
+
+ /**
+ * Constructs a new JMXAccessorCreateTask.
+ */
+ public JMXAccessorCreateTask() {
+ }
+
// ----------------------------------------------------- Instance Variables
private String className;
@@ -66,46 +73,63 @@ public class JMXAccessorCreateTask extends JMXAccessorTask {
// ------------------------------------------------------------- Properties
/**
- * @return Returns the classLoader.
+ * Get the class loader for MBean creation.
+ *
+ * @return the class loader
*/
public String getClassLoader() {
return classLoader;
}
/**
- * @param classLoaderName The classLoader to set.
+ * Set the class loader for MBean creation.
+ *
+ * @param classLoaderName the class loader to set
*/
public void setClassLoader(String classLoaderName) {
this.classLoader = classLoaderName;
}
/**
- * @return Returns the className.
+ * Get the MBean class name.
+ *
+ * @return the class name
*/
public String getClassName() {
return className;
}
/**
- * @param className The className to set.
+ * Set the MBean class name.
+ *
+ * @param className the class name to set
*/
public void setClassName(String className) {
this.className = className;
}
+ /**
+ * Add an argument for MBean creation.
+ *
+ * @param arg the argument to add
+ */
public void addArg(Arg arg) {
args.add(arg);
}
/**
- * @return Returns the args.
+ * Get the arguments for MBean creation.
+ *
+ * @return the arguments
*/
public List<Arg> getArgs() {
return args;
}
/**
- * @param args The args to set.
+ * Set the arguments for MBean creation.
+ *
+ * @param args the arguments to set
*/
public void setArgs(List<Arg> args) {
this.args = args;
diff --git a/java/org/apache/catalina/ant/jmx/JMXAccessorEqualsCondition.java b/java/org/apache/catalina/ant/jmx/JMXAccessorEqualsCondition.java
index 89d82fa741..a58fef60b4 100644
--- a/java/org/apache/catalina/ant/jmx/JMXAccessorEqualsCondition.java
+++ b/java/org/apache/catalina/ant/jmx/JMXAccessorEqualsCondition.java
@@ -58,6 +58,12 @@ import org.apache.tools.ant.BuildException;
*/
public class JMXAccessorEqualsCondition extends JMXAccessorConditionBase {
+ /**
+ * Constructs a new JMXAccessorEqualsCondition.
+ */
+ public JMXAccessorEqualsCondition() {
+ }
+
@Override
public boolean eval() {
String value = getValue();
diff --git a/java/org/apache/catalina/ant/jmx/JMXAccessorGetTask.java b/java/org/apache/catalina/ant/jmx/JMXAccessorGetTask.java
index b362bd6705..4ad5b6c011 100644
--- a/java/org/apache/catalina/ant/jmx/JMXAccessorGetTask.java
+++ b/java/org/apache/catalina/ant/jmx/JMXAccessorGetTask.java
@@ -53,6 +53,12 @@ import org.apache.tools.ant.BuildException;
*/
public class JMXAccessorGetTask extends JMXAccessorTask {
+ /**
+ * Constructs a new JMXAccessorGetTask.
+ */
+ public JMXAccessorGetTask() {
+ }
+
// ----------------------------------------------------- Instance Variables
@@ -61,14 +67,18 @@ public class JMXAccessorGetTask extends JMXAccessorTask {
// ------------------------------------------------------------- Properties
/**
- * @return Returns the attribute.
+ * Get the MBean attribute name.
+ *
+ * @return the attribute name
*/
public String getAttribute() {
return attribute;
}
/**
- * @param attribute The attribute to set.
+ * Set the MBean attribute name.
+ *
+ * @param attribute the attribute to set
*/
public void setAttribute(String attribute) {
this.attribute = attribute;
diff --git a/java/org/apache/catalina/ant/jmx/JMXAccessorInvokeTask.java b/java/org/apache/catalina/ant/jmx/JMXAccessorInvokeTask.java
index a2ae68ce23..7fa478cb35 100644
--- a/java/org/apache/catalina/ant/jmx/JMXAccessorInvokeTask.java
+++ b/java/org/apache/catalina/ant/jmx/JMXAccessorInvokeTask.java
@@ -86,6 +86,12 @@ import org.apache.tools.ant.BuildException;
*/
public class JMXAccessorInvokeTask extends JMXAccessorTask {
+ /**
+ * Constructs a new JMXAccessorInvokeTask.
+ */
+ public JMXAccessorInvokeTask() {
+ }
+
// ----------------------------------------------------- Instance Variables
@@ -95,32 +101,45 @@ public class JMXAccessorInvokeTask extends JMXAccessorTask {
// ------------------------------------------------------------- Properties
/**
- * @return Returns the operation.
+ * Get the MBean operation name.
+ *
+ * @return the operation name
*/
public String getOperation() {
return operation;
}
/**
- * @param operation The operation to set.
+ * Set the MBean operation name.
+ *
+ * @param operation the operation to set
*/
public void setOperation(String operation) {
this.operation = operation;
}
+ /**
+ * Add an argument for the MBean operation.
+ *
+ * @param arg the argument to add
+ */
public void addArg(Arg arg) {
args.add(arg);
}
/**
- * @return Returns the args.
+ * Get the arguments for the MBean operation.
+ *
+ * @return the arguments
*/
public List<Arg> getArgs() {
return args;
}
/**
- * @param args The args to set.
+ * Set the arguments for the MBean operation.
+ *
+ * @param args the arguments to set
*/
public void setArgs(List<Arg> args) {
this.args = args;
diff --git a/java/org/apache/catalina/ant/jmx/JMXAccessorQueryTask.java b/java/org/apache/catalina/ant/jmx/JMXAccessorQueryTask.java
index 8b8a531ca9..600f17751a 100644
--- a/java/org/apache/catalina/ant/jmx/JMXAccessorQueryTask.java
+++ b/java/org/apache/catalina/ant/jmx/JMXAccessorQueryTask.java
@@ -55,6 +55,12 @@ import org.apache.tools.ant.BuildException;
*/
public class JMXAccessorQueryTask extends JMXAccessorTask {
+ /**
+ * Constructs a new JMXAccessorQueryTask.
+ */
+ public JMXAccessorQueryTask() {
+ }
+
// ----------------------------------------------------- Instance Variables
private boolean attributebinding = false;
@@ -62,14 +68,18 @@ public class JMXAccessorQueryTask extends JMXAccessorTask {
// ------------------------------------------------------------- Properties
/**
- * @return Returns the attributebinding.
+ * Get the attribute binding flag.
+ *
+ * @return the attribute binding flag
*/
public boolean isAttributebinding() {
return attributebinding;
}
/**
- * @param attributeBinding The attributebinding to set.
+ * Set the attribute binding flag.
+ *
+ * @param attributeBinding the flag to set
*/
public void setAttributebinding(boolean attributeBinding) {
this.attributebinding = attributeBinding;
@@ -128,6 +138,13 @@ public class JMXAccessorQueryTask extends JMXAccessorTask {
return null;
}
+ /**
+ * Bind MBean attributes to Ant properties.
+ *
+ * @param jmxServerConnection the JMX server connection
+ * @param pname the property name prefix
+ * @param oname the MBean object name
+ */
protected void bindAttributes(MBeanServerConnection jmxServerConnection, String pname, ObjectName oname) {
try {
MBeanInfo minfo = jmxServerConnection.getMBeanInfo(oname);
diff --git a/java/org/apache/catalina/ant/jmx/JMXAccessorSetTask.java b/java/org/apache/catalina/ant/jmx/JMXAccessorSetTask.java
index dd43e75b1b..08fae8da40 100644
--- a/java/org/apache/catalina/ant/jmx/JMXAccessorSetTask.java
+++ b/java/org/apache/catalina/ant/jmx/JMXAccessorSetTask.java
@@ -59,6 +59,12 @@ import org.apache.tools.ant.BuildException;
*/
public class JMXAccessorSetTask extends JMXAccessorTask {
+ /**
+ * Constructs a new JMXAccessorSetTask.
+ */
+ public JMXAccessorSetTask() {
+ }
+
// ----------------------------------------------------- Instance Variables
private String attribute;
@@ -69,28 +75,36 @@ public class JMXAccessorSetTask extends JMXAccessorTask {
// ------------------------------------------------------------- Properties
/**
- * @return Returns the attribute.
+ * Get the MBean attribute name.
+ *
+ * @return the attribute name
*/
public String getAttribute() {
return attribute;
}
/**
- * @param attribute The attribute to set.
+ * Set the MBean attribute name.
+ *
+ * @param attribute the attribute to set
*/
public void setAttribute(String attribute) {
this.attribute = attribute;
}
/**
- * @return Returns the value.
+ * Get the attribute value.
+ *
+ * @return the value
*/
public String getValue() {
return value;
}
/**
- * @param value The value to set.
+ * Set the attribute value.
+ *
+ * @param value the value to set
*/
public void setValue(String value) {
this.value = value;
@@ -98,14 +112,18 @@ public class JMXAccessorSetTask extends JMXAccessorTask {
/**
- * @return Returns the type.
+ * Get the value type.
+ *
+ * @return the type
*/
public String getType() {
return type;
}
/**
- * @param valueType The type to set.
+ * Set the value type.
+ *
+ * @param valueType the type to set
*/
public void setType(String valueType) {
this.type = valueType;
@@ -113,14 +131,18 @@ public class JMXAccessorSetTask extends JMXAccessorTask {
/**
- * @return Returns the convert.
+ * Get the convert flag.
+ *
+ * @return the convert flag
*/
public boolean isConvert() {
return convert;
}
/**
- * @param convert The convert to set.
+ * Set the convert flag.
+ *
+ * @param convert the flag to set
*/
public void setConvert(boolean convert) {
this.convert = convert;
diff --git a/java/org/apache/catalina/ant/jmx/JMXAccessorTask.java b/java/org/apache/catalina/ant/jmx/JMXAccessorTask.java
index c7f90579e4..bee239ac2f 100644
--- a/java/org/apache/catalina/ant/jmx/JMXAccessorTask.java
+++ b/java/org/apache/catalina/ant/jmx/JMXAccessorTask.java
@@ -81,8 +81,20 @@ import org.apache.tools.ant.Project;
*/
public class JMXAccessorTask extends BaseRedirectorHelperTask {
+ /**
+ * Constructs a new JMXAccessorTask.
+ */
+ public JMXAccessorTask() {
+ }
+
+ /**
+ * JMX service URL prefix.
+ */
public static final String JMX_SERVICE_PREFIX = "service:jmx:rmi:///jndi/rmi://";
+ /**
+ * JMX service URL suffix.
+ */
public static final String JMX_SERVICE_SUFFIX = "/jmxrmi";
// ----------------------------------------------------- Instance Variables
@@ -126,144 +138,208 @@ public class JMXAccessorTask extends BaseRedirectorHelperTask {
return this.name;
}
+ /**
+ * Set the name used at remote MbeanServer.
+ *
+ * @param objectName the MBean object name
+ */
public void setName(String objectName) {
this.name = objectName;
}
/**
- * @return Returns the resultproperty.
+ * Get the result property name.
+ *
+ * @return the result property name
*/
public String getResultproperty() {
return resultproperty;
}
/**
- * @param propertyName The resultproperty to set.
+ * Set the result property name.
+ *
+ * @param propertyName the property name to set
*/
public void setResultproperty(String propertyName) {
this.resultproperty = propertyName;
}
/**
- * @return Returns the delimiter.
+ * Get the delimiter for array results.
+ *
+ * @return the delimiter
*/
public String getDelimiter() {
return delimiter;
}
/**
- * @param separator The delimiter to set.
+ * Set the delimiter for array results.
+ *
+ * @param separator the delimiter to set
*/
public void setDelimiter(String separator) {
this.delimiter = separator;
}
/**
- * @return Returns the echo.
+ * Get the echo flag.
+ *
+ * @return the echo flag
*/
public boolean isEcho() {
return echo;
}
/**
- * @param echo The echo to set.
+ * Set the echo flag.
+ *
+ * @param echo the echo flag to set
*/
public void setEcho(boolean echo) {
this.echo = echo;
}
/**
- * @return Returns the separatearrayresults.
+ * Get the separate array results flag.
+ *
+ * @return the separate array results flag
*/
public boolean isSeparatearrayresults() {
return separatearrayresults;
}
/**
- * @param separateArrayResults The separatearrayresults to set.
+ * Set the separate array results flag.
+ *
+ * @param separateArrayResults the flag to set
*/
public void setSeparatearrayresults(boolean separateArrayResults) {
this.separatearrayresults = separateArrayResults;
}
/**
- * @return The login password for the <code>Manager</code> application.
+ * Get the login password.
+ *
+ * @return the login password
*/
public String getPassword() {
return this.password;
}
+ /**
+ * Set the login password.
+ *
+ * @param password the password to set
+ */
public void setPassword(String password) {
this.password = password;
}
/**
- * @return The login username for the <code>JMX</code> MBeanServer.
+ * Get the login username.
+ *
+ * @return the login username
*/
public String getUsername() {
return this.username;
}
+ /**
+ * Set the login username.
+ *
+ * @param username the username to set
+ */
public void setUsername(String username) {
this.username = username;
}
/**
- * @return The URL of the <code>JMX JSR 160</code> MBeanServer to be used.
+ * Get the JMX MBeanServer URL.
+ *
+ * @return the JMX URL
*/
public String getUrl() {
return this.url;
}
+ /**
+ * Set the JMX MBeanServer URL.
+ *
+ * @param url the URL to set
+ */
public void setUrl(String url) {
this.url = url;
}
/**
- * @return The Host of the <code>JMX JSR 160</code> MBeanServer to be used.
+ * Get the JMX MBeanServer host.
+ *
+ * @return the host
*/
public String getHost() {
return this.host;
}
+ /**
+ * Set the JMX MBeanServer host.
+ *
+ * @param host the host to set
+ */
public void setHost(String host) {
this.host = host;
}
/**
- * @return The Port of the <code>JMX JSR 160</code> MBeanServer to be used.
+ * Get the JMX MBeanServer port.
+ *
+ * @return the port
*/
public String getPort() {
return this.port;
}
+ /**
+ * Set the JMX MBeanServer port.
+ *
+ * @param port the port to set
+ */
public void setPort(String port) {
this.port = port;
}
/**
- * @return Returns the useRef.
+ * Check if a reference is being used.
+ *
+ * @return {@code true} if a reference is set
*/
public boolean isUseRef() {
return ref != null && !ref.isEmpty();
}
/**
- * @return Returns the ref.
+ * Get the reference ID for the JMX connection.
+ *
+ * @return the reference ID
*/
public String getRef() {
return ref;
}
/**
- * @param refId The ref to set.
+ * Set the reference ID for the JMX connection.
+ *
+ * @param refId the reference ID to set
*/
public void setRef(String refId) {
this.ref = refId;
}
/**
- * @return Returns the ifCondition.
+ * Get the if condition property name.
+ *
+ * @return the if condition property name
*/
public String getIf() {
return ifCondition;
@@ -279,7 +355,9 @@ public class JMXAccessorTask extends BaseRedirectorHelperTask {
}
/**
- * @return Returns the unlessCondition.
+ * Get the unless condition property name.
+ *
+ * @return the unless condition property name
*/
public String getUnless() {
return unlessCondition;
@@ -552,6 +630,8 @@ public class JMXAccessorTask extends BaseRedirectorHelperTask {
}
/**
+ * Echo the result to the output.
+ *
* @param name context of result
* @param result The result
*/
@@ -669,10 +749,11 @@ public class JMXAccessorTask extends BaseRedirectorHelperTask {
}
/**
- * @param property The property
- * @param value The value
+ * Set a property value.
*
- * @return True if successful
+ * @param property The property name
+ * @param value The value
+ * @return {@code true} if successful
*/
public boolean setProperty(String property, Object value) {
if (property != null) {
diff --git a/java/org/apache/catalina/ant/jmx/JMXAccessorUnregisterTask.java b/java/org/apache/catalina/ant/jmx/JMXAccessorUnregisterTask.java
index 0b2bc1dc9c..ed09b0fb09 100644
--- a/java/org/apache/catalina/ant/jmx/JMXAccessorUnregisterTask.java
+++ b/java/org/apache/catalina/ant/jmx/JMXAccessorUnregisterTask.java
@@ -49,6 +49,12 @@ import org.apache.tools.ant.BuildException;
*/
public class JMXAccessorUnregisterTask extends JMXAccessorTask {
+ /**
+ * Constructs a new JMXAccessorUnregisterTask.
+ */
+ public JMXAccessorUnregisterTask() {
+ }
+
// ------------------------------------------------------ protected Methods
@Override
diff --git a/java/org/apache/catalina/authenticator/AuthenticatorBase.java b/java/org/apache/catalina/authenticator/AuthenticatorBase.java
index 8bbb8ff349..a5c650373f 100644
--- a/java/org/apache/catalina/authenticator/AuthenticatorBase.java
+++ b/java/org/apache/catalina/authenticator/AuthenticatorBase.java
@@ -111,6 +111,12 @@ public abstract class AuthenticatorBase extends ValveBase implements Authenticat
*/
protected static final String REALM_NAME = "Authentication required";
+ /**
+ * Returns the realm name for the given context.
+ *
+ * @param context the context
+ * @return the realm name
+ */
protected static String getRealmName(Context context) {
if (context == null) {
// Very unlikely
@@ -132,6 +138,9 @@ public abstract class AuthenticatorBase extends ValveBase implements Authenticat
// ------------------------------------------------------ Constructor
+ /**
+ * Constructs an AuthenticatorBase with post-work enabled.
+ */
public AuthenticatorBase() {
super(true);
}
@@ -212,6 +221,9 @@ public abstract class AuthenticatorBase extends ValveBase implements Authenticat
*/
protected boolean sendAuthInfoResponseHeaders = false;
+ /**
+ * Generator for SSO session identifiers.
+ */
protected SessionIdGeneratorBase sessionIdGenerator = null;
/**
@@ -230,27 +242,57 @@ public abstract class AuthenticatorBase extends ValveBase implements Authenticat
// ------------------------------------------------------------- Properties
+ /**
+ * Returns the SSO re-authentication mode.
+ *
+ * @return the SSO re-authentication mode
+ */
public String getSsoReauthenticationMode() {
return ssoReauthenticationMode.name().toLowerCase(Locale.ENGLISH);
}
+ /**
+ * Sets the SSO re-authentication mode.
+ *
+ * @param ssoReauthenticationMode the SSO re-authentication mode
+ */
public void setSsoReauthenticationMode(String ssoReauthenticationMode) {
this.ssoReauthenticationMode =
SsoReauthenticationMode.valueOf(ssoReauthenticationMode.trim().toUpperCase(Locale.ENGLISH));
}
+ /**
+ * Returns the CORS preflight handling mode.
+ *
+ * @return the CORS preflight handling mode
+ */
public String getAllowCorsPreflight() {
return allowCorsPreflight.name().toLowerCase(Locale.ENGLISH);
}
+ /**
+ * Sets the CORS preflight handling mode.
+ *
+ * @param allowCorsPreflight the CORS preflight handling mode
+ */
public void setAllowCorsPreflight(String allowCorsPreflight) {
this.allowCorsPreflight = AllowCorsPreflight.valueOf(allowCorsPreflight.trim().toUpperCase(Locale.ENGLISH));
}
+ /**
+ * Returns whether a session should always be used once a user is authenticated.
+ *
+ * @return {@code true} if a session should always be used
+ */
public boolean getAlwaysUseSession() {
return alwaysUseSession;
}
+ /**
+ * Sets whether a session should always be used once a user is authenticated.
+ *
+ * @param alwaysUseSession {@code true} if a session should always be used
+ */
public void setAlwaysUseSession(boolean alwaysUseSession) {
this.alwaysUseSession = alwaysUseSession;
}
@@ -614,6 +656,12 @@ public abstract class AuthenticatorBase extends ValveBase implements Authenticat
}
+ /**
+ * Determines whether a CORS preflight request should bypass authentication.
+ *
+ * @param request the request to check
+ * @return {@code true} if the CORS preflight request should bypass authentication
+ */
protected boolean allowCorsPreflightBypass(Request request) {
boolean allowBypass = false;
@@ -1179,6 +1227,13 @@ public abstract class AuthenticatorBase extends ValveBase implements Authenticat
}
+ /**
+ * Changes the session ID for the given session.
+ *
+ * @param request the request being processed
+ * @param session the session whose ID should be changed
+ * @return the new session ID
+ */
protected String changeSessionID(Request request, Session session) {
String oldId = null;
if (log.isDebugEnabled()) {
@@ -1342,23 +1397,58 @@ public abstract class AuthenticatorBase extends ValveBase implements Authenticat
}
+ /**
+ * Holds the state for a JASPIC authentication interaction.
+ */
private static class JaspicState {
public MessageInfo messageInfo = null;
public ServerAuthContext serverAuthContext = null;
}
+ /**
+ * Defines the modes for handling CORS preflight requests in the authenticator.
+ */
protected enum AllowCorsPreflight {
+ /**
+ * Never allow CORS preflight bypass.
+ */
NEVER,
+
+ /**
+ * Allow CORS preflight bypass only when a CORS filter is configured.
+ */
FILTER,
+
+ /**
+ * Always allow CORS preflight bypass.
+ */
ALWAYS
}
+ /**
+ * Defines the modes for SSO re-authentication behavior.
+ */
protected enum SsoReauthenticationMode {
+ /**
+ * Use the default re-authentication mode determined by the SSO valve configuration.
+ */
DEFAULT,
+
+ /**
+ * Re-authenticate using the cached principal.
+ */
PRINCIPAL,
+
+ /**
+ * Re-authenticate using cached user name and password.
+ */
PASSWORD,
+
+ /**
+ * Always require full re-authentication.
+ */
FULL
}
}
diff --git a/java/org/apache/catalina/authenticator/BasicAuthenticator.java b/java/org/apache/catalina/authenticator/BasicAuthenticator.java
index 61357d2c88..97e849b23a 100644
--- a/java/org/apache/catalina/authenticator/BasicAuthenticator.java
+++ b/java/org/apache/catalina/authenticator/BasicAuthenticator.java
@@ -37,6 +37,12 @@ import org.apache.tomcat.util.buf.MessageBytes;
*/
public class BasicAuthenticator extends AuthenticatorBase {
+ /**
+ * Default constructor.
+ */
+ public BasicAuthenticator() {
+ }
+
private final Log log = LogFactory.getLog(BasicAuthenticator.class); // must not be static
private Charset charset = StandardCharsets.ISO_8859_1;
@@ -44,11 +50,21 @@ public class BasicAuthenticator extends AuthenticatorBase {
private boolean trimCredentials = false;
+ /**
+ * Returns the character set used for encoding credentials.
+ *
+ * @return the character set name
+ */
public String getCharset() {
return charsetString;
}
+ /**
+ * Sets the character set used for encoding credentials.
+ *
+ * @param charsetString the character set name
+ */
public void setCharset(String charsetString) {
// Only acceptable options are null, "" or "UTF-8" (case-insensitive)
if (charsetString == null || charsetString.isEmpty()) {
diff --git a/java/org/apache/catalina/authenticator/Constants.java b/java/org/apache/catalina/authenticator/Constants.java
index 666ae89721..ecc11979c0 100644
--- a/java/org/apache/catalina/authenticator/Constants.java
+++ b/java/org/apache/catalina/authenticator/Constants.java
@@ -16,25 +16,71 @@
*/
package org.apache.catalina.authenticator;
+/**
+ * Constants used by the authentication framework.
+ */
public class Constants {
+
+ /**
+ * Prevents instantiation.
+ */
+ private Constants() {
+ }
+
// Authentication methods for login configuration
// Servlet spec schemes are defined in HttpServletRequest
// Vendor specific schemes
+ /**
+ * Vendor specific SPNEGO authentication method.
+ */
public static final String SPNEGO_METHOD = "SPNEGO";
// Form based authentication constants
+ /**
+ * The URI for the form-based authentication login action.
+ */
public static final String FORM_ACTION = "/j_security_check";
+
+ /**
+ * The parameter name for the form-based authentication password.
+ */
public static final String FORM_PASSWORD = "j_password";
+
+ /**
+ * The parameter name for the form-based authentication username.
+ */
public static final String FORM_USERNAME = "j_username";
// SPNEGO authentication constants
+ /**
+ * The system property for the Kerberos 5 configuration file path.
+ */
public static final String KRB5_CONF_PROPERTY = "java.security.krb5.conf";
+
+ /**
+ * The default Kerberos 5 configuration file path.
+ */
public static final String DEFAULT_KRB5_CONF = "conf/krb5.ini";
+
+ /**
+ * The system property for the JAAS login configuration file path.
+ */
public static final String JAAS_CONF_PROPERTY = "java.security.auth.login.config";
+
+ /**
+ * The default JAAS login configuration file path.
+ */
public static final String DEFAULT_JAAS_CONF = "conf/jaas.conf";
+
+ /**
+ * The default JAAS login module name.
+ */
public static final String DEFAULT_LOGIN_MODULE_NAME = "com.sun.security.jgss.krb5.accept";
// Cookie name for single sign on support
+ /**
+ * The cookie name used for single sign-on support.
+ */
public static final String SINGLE_SIGN_ON_COOKIE = "JSESSIONIDSSO";
/**
@@ -54,6 +100,9 @@ public class Constants {
*/
public static final String REQ_SSOID_NOTE = "org.apache.catalina.request.SSOID";
+ /**
+ * The notes key for the JASPIC subject associated with the current request.
+ */
public static final String REQ_JASPIC_SUBJECT_NOTE = "org.apache.catalina.authenticator.jaspic.SUBJECT";
diff --git a/java/org/apache/catalina/authenticator/DigestAuthenticator.java b/java/org/apache/catalina/authenticator/DigestAuthenticator.java
index ec48f56655..13050eb7e4 100644
--- a/java/org/apache/catalina/authenticator/DigestAuthenticator.java
+++ b/java/org/apache/catalina/authenticator/DigestAuthenticator.java
@@ -78,6 +78,9 @@ public class DigestAuthenticator extends AuthenticatorBase {
// ----------------------------------------------------------- Constructors
+ /**
+ * Construct a new DigestAuthenticator with caching disabled.
+ */
public DigestAuthenticator() {
super();
setCache(false);
@@ -96,6 +99,10 @@ public class DigestAuthenticator extends AuthenticatorBase {
* The last timestamp used to generate a nonce. Each nonce should get a unique timestamp.
*/
protected long lastTimestamp = 0;
+
+ /**
+ * Lock object used to ensure unique timestamps for nonce generation.
+ */
protected final Object lastTimestampLock = new Object();
@@ -144,66 +151,122 @@ public class DigestAuthenticator extends AuthenticatorBase {
// ------------------------------------------------------------- Properties
+ /**
+ * Get the window size to use to track seen nonce count values for a given nonce.
+ *
+ * @return Nonce count window size
+ */
public int getNonceCountWindowSize() {
return nonceCountWindowSize;
}
-
+ /**
+ * Set the window size to use to track seen nonce count values for a given nonce.
+ *
+ * @param nonceCountWindowSize Nonce count window size
+ */
public void setNonceCountWindowSize(int nonceCountWindowSize) {
this.nonceCountWindowSize = nonceCountWindowSize;
}
-
+ /**
+ * Get the maximum number of server nonces to keep in the cache.
+ *
+ * @return Nonce cache size
+ */
public int getNonceCacheSize() {
return nonceCacheSize;
}
-
+ /**
+ * Set the maximum number of server nonces to keep in the cache.
+ *
+ * @param nonceCacheSize Nonce cache size
+ */
public void setNonceCacheSize(int nonceCacheSize) {
this.nonceCacheSize = nonceCacheSize;
}
+ /**
+ * Get the private key used for nonce generation.
+ *
+ * @return Private key
+ */
public String getKey() {
return key;
}
+ /**
+ * Set the private key used for nonce generation.
+ *
+ * @param key Private key
+ */
public void setKey(String key) {
this.key = key;
}
-
+ /**
+ * Get how long server nonces are valid for in milliseconds.
+ *
+ * @return Nonce validity in milliseconds
+ */
public long getNonceValidity() {
return nonceValidity;
}
-
+ /**
+ * Set how long server nonces are valid for in milliseconds.
+ *
+ * @param nonceValidity Nonce validity in milliseconds
+ */
public void setNonceValidity(long nonceValidity) {
this.nonceValidity = nonceValidity;
}
-
+ /**
+ * Get the opaque string.
+ *
+ * @return Opaque string
+ */
public String getOpaque() {
return opaque;
}
-
+ /**
+ * Set the opaque string.
+ *
+ * @param opaque Opaque string
+ */
public void setOpaque(String opaque) {
this.opaque = opaque;
}
-
+ /**
+ * Get whether the URI should be validated as required by RFC2617.
+ *
+ * @return {@code true} if URI validation is enabled
+ */
public boolean isValidateUri() {
return validateUri;
}
-
+ /**
+ * Set whether the URI should be validated as required by RFC2617.
+ *
+ * @param validateUri {@code true} to enable URI validation
+ */
public void setValidateUri(boolean validateUri) {
this.validateUri = validateUri;
}
+ /**
+ * Get the configured authentication algorithms as a comma-separated list.
+ *
+ * @return Comma-separated list of algorithm names
+ */
public String getAlgorithms() {
StringBuilder result = new StringBuilder();
StringUtils.join(algorithms, ',', AuthDigest::getRfcName, result);
@@ -211,6 +274,11 @@ public class DigestAuthenticator extends AuthenticatorBase {
}
+ /**
+ * Set the configured authentication algorithms as a comma-separated list.
+ *
+ * @param algorithmsString Comma-separated list of algorithm names
+ */
public void setAlgorithms(String algorithmsString) {
String[] algorithmsArray = algorithmsString.split(",");
List<AuthDigest> algorithms = new ArrayList<>();
@@ -492,6 +560,9 @@ public class DigestAuthenticator extends AuthenticatorBase {
}
+ /**
+ * Holds the parsed and validated information from a Digest authentication request.
+ */
public static class DigestInfo {
private final String opaque;
@@ -515,6 +586,15 @@ public class DigestAuthenticator extends AuthenticatorBase {
private AuthDigest algorithm = null;
+ /**
+ * Create a new DigestInfo instance.
+ *
+ * @param opaque Opaque string
+ * @param nonceValidity Nonce validity in milliseconds
+ * @param key Private key
+ * @param nonces Map of tracked nonces
+ * @param validateUri Whether to validate the URI
+ */
public DigestInfo(String opaque, long nonceValidity, String key, Map<String,NonceInfo> nonces,
boolean validateUri) {
this.opaque = opaque;
@@ -525,11 +605,22 @@ public class DigestAuthenticator extends AuthenticatorBase {
}
+ /**
+ * Get the authenticated user name.
+ *
+ * @return User name
+ */
public String getUsername() {
return userName;
}
-
+ /**
+ * Parse the authorization header to extract digest credentials.
+ *
+ * @param request HTTP request
+ * @param authorization Authorization header value
+ * @return {@code true} if parsing succeeded
+ */
public boolean parse(Request request, String authorization) {
// Validate the authorization credentials format
if (authorization == null) {
@@ -571,6 +662,13 @@ public class DigestAuthenticator extends AuthenticatorBase {
return validate(request, fallbackList);
}
+ /**
+ * Validate the parsed digest credentials against the request and configured algorithms.
+ *
+ * @param request HTTP request
+ * @param algorithms Configured authentication algorithms
+ * @return {@code true} if validation succeeded
+ */
public boolean validate(Request request, List<AuthDigest> algorithms) {
if ((userName == null) || (realmName == null) || (nonce == null) || (uri == null) || (response == null)) {
return false;
@@ -690,10 +788,21 @@ public class DigestAuthenticator extends AuthenticatorBase {
return algorithms.contains(algorithm);
}
+ /**
+ * Check if the nonce has expired and is considered stale.
+ *
+ * @return {@code true} if the nonce is stale
+ */
public boolean isNonceStale() {
return nonceStale;
}
+ /**
+ * Authenticate the user against the given realm using the parsed digest credentials.
+ *
+ * @param realm Realm to authenticate against
+ * @return Principal if authentication succeeded, {@code null} otherwise
+ */
public Principal authenticate(Realm realm) {
String a2 = method + ":" + uri;
@@ -707,18 +816,33 @@ public class DigestAuthenticator extends AuthenticatorBase {
}
+ /**
+ * Tracks information about a server nonce, including timestamp and seen nonce counts.
+ */
public static class NonceInfo {
private final long timestamp;
private final boolean[] seen;
private final int offset;
private int count = 0;
+ /**
+ * Create a new NonceInfo instance.
+ *
+ * @param currentTime Current timestamp
+ * @param seenWindowSize Size of the window for tracking seen nonce counts
+ */
public NonceInfo(long currentTime, int seenWindowSize) {
this.timestamp = currentTime;
seen = new boolean[seenWindowSize];
offset = seenWindowSize / 2;
}
+ /**
+ * Validate the nonce count to detect replay attacks.
+ *
+ * @param nonceCount Nonce count from the client
+ * @return {@code true} if the nonce count is valid
+ */
public synchronized boolean nonceCountValid(long nonceCount) {
if ((count - offset) >= nonceCount || (nonceCount > count - offset + seen.length)) {
return false;
@@ -734,6 +858,11 @@ public class DigestAuthenticator extends AuthenticatorBase {
}
}
+ /**
+ * Get the timestamp when this nonce was created.
+ *
+ * @return Timestamp in milliseconds
+ */
public long getTimestamp() {
return timestamp;
}
@@ -745,22 +874,49 @@ public class DigestAuthenticator extends AuthenticatorBase {
*/
public enum AuthDigest {
+ /**
+ * MD5 digest algorithm.
+ */
MD5("MD5", "MD5"),
+
+ /**
+ * SHA-256 digest algorithm.
+ */
SHA_256("SHA-256", "SHA-256"),
+
+ /**
+ * SHA-512/256 digest algorithm.
+ */
SHA_512_256("SHA-512/256", "SHA-512-256");
private final String javaName;
private final String rfcName;
+ /**
+ * Create a new AuthDigest instance.
+ *
+ * @param javaName Java standard algorithm name
+ * @param rfcName RFC algorithm name
+ */
AuthDigest(String javaName, String rfcName) {
this.javaName = javaName;
this.rfcName = rfcName;
}
+ /**
+ * Get the Java standard name for this digest algorithm.
+ *
+ * @return Java algorithm name
+ */
public String getJavaName() {
return javaName;
}
+ /**
+ * Get the RFC name for this digest algorithm.
+ *
+ * @return RFC algorithm name
+ */
public String getRfcName() {
return rfcName;
}
diff --git a/java/org/apache/catalina/authenticator/FormAuthenticator.java b/java/org/apache/catalina/authenticator/FormAuthenticator.java
index 80a364855c..d604b605ca 100644
--- a/java/org/apache/catalina/authenticator/FormAuthenticator.java
+++ b/java/org/apache/catalina/authenticator/FormAuthenticator.java
@@ -50,6 +50,12 @@ import org.apache.tomcat.util.http.MimeHeaders;
* Specification.
*/
public class FormAuthenticator extends AuthenticatorBase {
+ /**
+ * Creates a new FormAuthenticator instance.
+ */
+ public FormAuthenticator() {
+ // Default constructor
+ }
private final Log log = LogFactory.getLog(FormAuthenticator.class); // must not be static
@@ -496,6 +502,13 @@ public class FormAuthenticator extends AuthenticatorBase {
}
+ /**
+ * Checks if the given request matches the saved request from a previous form authentication flow.
+ *
+ * @param request The request to check
+ *
+ * @return {@code true} if the request matches the saved one
+ */
protected boolean matchRequest(Request request) {
return matchRequest(request, true);
}
diff --git a/java/org/apache/catalina/authenticator/SingleSignOn.java b/java/org/apache/catalina/authenticator/SingleSignOn.java
index 1ae7f90f62..114be6d0ba 100644
--- a/java/org/apache/catalina/authenticator/SingleSignOn.java
+++ b/java/org/apache/catalina/authenticator/SingleSignOn.java
@@ -147,6 +147,8 @@ public class SingleSignOn extends ValveBase {
/**
+ * Returns the cookie name that will be used for the SSO cookie.
+ *
* @return the cookie name
*/
public String getCookieName() {
@@ -599,6 +601,13 @@ public class SingleSignOn extends ValveBase {
}
+ /**
+ * Returns a session listener for the specified SSO identifier.
+ *
+ * @param ssoId the SSO identifier
+ *
+ * @return the session listener
+ */
protected SessionListener getSessionListener(String ssoId) {
return new SingleSignOnListener(ssoId);
}
diff --git a/java/org/apache/catalina/authenticator/jaspic/AuthConfigFactoryImpl.java b/java/org/apache/catalina/authenticator/jaspic/AuthConfigFactoryImpl.java
index 8705f800af..225a924545 100644
--- a/java/org/apache/catalina/authenticator/jaspic/AuthConfigFactoryImpl.java
+++ b/java/org/apache/catalina/authenticator/jaspic/AuthConfigFactoryImpl.java
@@ -49,6 +49,9 @@ import org.apache.juli.logging.Log;
import org.apache.juli.logging.LogFactory;
import org.apache.tomcat.util.res.StringManager;
+/**
+ * Implementation of {@link AuthConfigFactory} for the JASPIC authentication framework.
+ */
public class AuthConfigFactoryImpl extends AuthConfigFactory {
private final Log log = LogFactory.getLog(AuthConfigFactoryImpl.class); // must not be static
@@ -72,6 +75,9 @@ public class AuthConfigFactoryImpl extends AuthConfigFactory {
private final Map<String,RegistrationContextImpl> defaultRegistration = new ConcurrentHashMap<>(1);
+ /**
+ * Constructs a new AuthConfigFactoryImpl and loads any persistent registrations.
+ */
public AuthConfigFactoryImpl() {
loadPersistentRegistrations();
}
diff --git a/java/org/apache/catalina/connector/Connector.java b/java/org/apache/catalina/connector/Connector.java
index c9574efd88..18719f3520 100644
--- a/java/org/apache/catalina/connector/Connector.java
+++ b/java/org/apache/catalina/connector/Connector.java
@@ -59,8 +59,14 @@ public class Connector extends LifecycleMBeanBase {
private static final Log log = LogFactory.getLog(Connector.class);
+ /**
+ * Name used for the internal executor when no external executor is configured.
+ */
public static final String INTERNAL_EXECUTOR_NAME = "Internal";
+ /**
+ * Flag that indicates whether the APR status class is present in the classpath.
+ */
private static final boolean aprStatusPresent;
static {
@@ -88,6 +94,11 @@ public class Connector extends LifecycleMBeanBase {
}
+ /**
+ * Create a new Connector instance with the specified protocol.
+ *
+ * @param protocol The protocol to use
+ */
public Connector(String protocol) {
configuredProtocol = protocol;
ProtocolHandler p = null;
@@ -108,6 +119,11 @@ public class Connector extends LifecycleMBeanBase {
}
+ /**
+ * Create a new Connector instance with the specified protocol handler.
+ *
+ * @param protocolHandler The protocol handler to use
+ */
public Connector(ProtocolHandler protocolHandler) {
protocolHandlerClassName = protocolHandler.getClass().getName();
configuredProtocol = protocolHandlerClassName;
@@ -343,7 +359,8 @@ public class Connector extends LifecycleMBeanBase {
/**
- * @return the <code>Service</code> with which we are associated (if any).
+ * Returns the <code>Service</code> with which this connector is associated.
+ * @return the associated <code>Service</code>, or {@code null} if not associated
*/
public Service getService() {
return this.service;
@@ -361,7 +378,8 @@ public class Connector extends LifecycleMBeanBase {
/**
- * @return <code>true</code> if backslash characters are allowed in URLs. Default value is <code>false</code>.
+ * Returns whether backslash characters are allowed in URLs.
+ * @return {@code true} if backslash characters are allowed in URLs, default is {@code false}
*/
public boolean getAllowBackslash() {
return allowBackslash;
@@ -379,7 +397,8 @@ public class Connector extends LifecycleMBeanBase {
/**
- * @return <code>true</code> if the TRACE method is allowed. Default value is <code>false</code>.
+ * Returns whether the TRACE HTTP method is allowed.
+ * @return {@code true} if the TRACE method is allowed, default is {@code false}
*/
public boolean getAllowTrace() {
return this.allowTrace;
@@ -397,7 +416,8 @@ public class Connector extends LifecycleMBeanBase {
/**
- * @return the default timeout for async requests in ms.
+ * Returns the default timeout for async requests.
+ * @return the default timeout in milliseconds
*/
public long getAsyncTimeout() {
return asyncTimeout;
@@ -415,6 +435,7 @@ public class Connector extends LifecycleMBeanBase {
/**
+ * Returns whether the object facades are discarded.
* @return <code>true</code> if the object facades are discarded, either when the discardFacades value is
* <code>true</code> or when the security manager is enabled.
*/
@@ -434,7 +455,9 @@ public class Connector extends LifecycleMBeanBase {
/**
- * @return the "enable DNS lookups" flag.
+ * Return the "enable DNS lookups" flag.
+ *
+ * @return the "enable DNS lookups" flag
*/
public boolean getEnableLookups() {
return this.enableLookups;
@@ -451,8 +474,9 @@ public class Connector extends LifecycleMBeanBase {
}
- /**
- * @return <code>true</code> if a default character encoding will be set when calling Response.getWriter()
+ /**
+ * Returns whether the encoding must be enforced when calling getWriter().
+ * @return {@code true} if the encoding must be enforced when calling getWriter()
*/
public boolean getEnforceEncodingInGetWriter() {
return enforceEncodingInGetWriter;
@@ -469,19 +493,28 @@ public class Connector extends LifecycleMBeanBase {
}
+ /**
+ * Returns the maximum number of cookies that will be accepted in a request.
+ * @return the maximum cookie count
+ */
public int getMaxCookieCount() {
return maxCookieCount;
}
+ /**
+ * Sets the maximum number of cookies that will be accepted in a request.
+ * @param maxCookieCount the new maximum cookie count
+ */
public void setMaxCookieCount(int maxCookieCount) {
this.maxCookieCount = maxCookieCount;
}
/**
- * @return the maximum number of parameters (GET plus POST) that will be automatically parsed by the container. A
- * value of less than 0 means no limit.
+ * Returns the maximum number of parameters (GET plus POST) that will be automatically parsed by the container.
+ * A value of less than 0 means no limit.
+ * @return the maximum parameter count
*/
public int getMaxParameterCount() {
return maxParameterCount;
@@ -499,28 +532,45 @@ public class Connector extends LifecycleMBeanBase {
}
+ /**
+ * Returns the maximum number of parts that will be accepted in a multipart request.
+ * @return the maximum part count
+ */
public int getMaxPartCount() {
return maxPartCount;
}
+ /**
+ * Sets the maximum number of parts that will be accepted in a multipart request.
+ * @param maxPartCount the new maximum part count
+ */
public void setMaxPartCount(int maxPartCount) {
this.maxPartCount = maxPartCount;
}
+ /**
+ * Returns the maximum size of the headers for each part in a multipart request.
+ * @return the maximum part header size
+ */
public int getMaxPartHeaderSize() {
return maxPartHeaderSize;
}
+ /**
+ * Sets the maximum size of the headers for each part in a multipart request.
+ * @param maxPartHeaderSize the new maximum part header size
+ */
public void setMaxPartHeaderSize(int maxPartHeaderSize) {
this.maxPartHeaderSize = maxPartHeaderSize;
}
/**
- * @return the maximum size of a POST which will be automatically parsed by the container.
+ * Returns the maximum size of a POST which will be automatically parsed by the container.
+ * @return the maximum POST size in bytes
*/
public int getMaxPostSize() {
return maxPostSize;
@@ -538,7 +588,8 @@ public class Connector extends LifecycleMBeanBase {
/**
- * @return the maximum size of a POST which will be saved by the container during authentication.
+ * Returns the maximum size of a POST which will be saved by the container during authentication.
+ * @return the maximum saved POST size in bytes
*/
public int getMaxSavePostSize() {
return maxSavePostSize;
@@ -558,7 +609,8 @@ public class Connector extends LifecycleMBeanBase {
/**
- * @return the HTTP methods which will support body parameters parsing
+ * Returns the HTTP methods which will support body parameters parsing.
+ * @return the comma-separated list of HTTP methods
*/
public String getParseBodyMethods() {
return this.parseBodyMethods;
@@ -587,14 +639,20 @@ public class Connector extends LifecycleMBeanBase {
}
+ /**
+ * Checks whether the given HTTP method is configured to allow body parameter parsing.
+ * @param method the HTTP method name to check
+ * @return {@code true} if the method is in the parse body methods set
+ */
protected boolean isParseBodyMethod(String method) {
return parseBodyMethodsSet.contains(method);
}
/**
- * @return the port number on which this connector is configured to listen for requests. The special value of 0
- * means select a random free port when the socket is bound.
+ * Returns the port number on which this connector is configured to listen for requests.
+ * The special value of 0 means select a random free port when the socket is bound.
+ * @return the configured port number
*/
public int getPort() {
// Try shortcut that should work for nearly all uses first as it does
@@ -622,6 +680,10 @@ public class Connector extends LifecycleMBeanBase {
}
+ /**
+ * Returns the port offset to be applied to the configured port.
+ * @return the port offset value
+ */
public int getPortOffset() {
// Try shortcut that should work for nearly all uses first as it does
// not use reflection and is therefore faster.
@@ -638,11 +700,19 @@ public class Connector extends LifecycleMBeanBase {
}
+ /**
+ * Sets the port offset to be applied to the configured port.
+ * @param portOffset the new port offset value
+ */
public void setPortOffset(int portOffset) {
setProperty("portOffset", String.valueOf(portOffset));
}
+ /**
+ * Returns the effective port number after applying the port offset.
+ * @return the port number with offset applied
+ */
public int getPortWithOffset() {
int port = getPort();
// Zero is a special case and negative values are invalid
@@ -654,8 +724,10 @@ public class Connector extends LifecycleMBeanBase {
/**
- * @return the port number on which this connector is listening to requests. If the special value for
- * {@link #getPort} of zero is used then this method will report the actual port bound.
+ * Returns the port number on which this connector is actually listening.
+ * If the special value for {@link #getPort} of zero is used then this method
+ * will report the actual port bound.
+ * @return the actual local port number
*/
public int getLocalPort() {
return ((Integer) getProperty("localPort")).intValue();
@@ -663,7 +735,8 @@ public class Connector extends LifecycleMBeanBase {
/**
- * @return the Coyote protocol handler in use.
+ * Returns the Coyote protocol handler in use.
+ * @return the protocol string
*/
public String getProtocol() {
return configuredProtocol;
@@ -671,7 +744,8 @@ public class Connector extends LifecycleMBeanBase {
/**
- * @return the class name of the Coyote protocol handler in use.
+ * Returns the class name of the Coyote protocol handler in use.
+ * @return the protocol handler class name
*/
public String getProtocolHandlerClassName() {
return this.protocolHandlerClassName;
@@ -679,7 +753,8 @@ public class Connector extends LifecycleMBeanBase {
/**
- * @return the protocol handler associated with the connector.
+ * Returns the protocol handler associated with the connector.
+ * @return the protocol handler instance
*/
public ProtocolHandler getProtocolHandler() {
return this.protocolHandler;
@@ -687,7 +762,8 @@ public class Connector extends LifecycleMBeanBase {
/**
- * @return the proxy server name for this Connector.
+ * Returns the proxy server name for this Connector.
+ * @return the proxy server name
*/
public String getProxyName() {
return this.proxyName;
@@ -710,7 +786,8 @@ public class Connector extends LifecycleMBeanBase {
/**
- * @return the proxy server port for this Connector.
+ * Returns the proxy server port for this Connector.
+ * @return the proxy server port
*/
public int getProxyPort() {
return this.proxyPort;
@@ -728,8 +805,9 @@ public class Connector extends LifecycleMBeanBase {
/**
- * @return the port number to which a request should be redirected if it comes in on a non-SSL port and is subject
- * to a security constraint with a transport guarantee that requires SSL.
+ * Returns the port number to which a request should be redirected if it comes in on a non-SSL port
+ * and is subject to a security constraint with a transport guarantee that requires SSL.
+ * @return the redirect port number
*/
public int getRedirectPort() {
return this.redirectPort;
@@ -746,13 +824,18 @@ public class Connector extends LifecycleMBeanBase {
}
+ /**
+ * Returns the redirect port with the port offset applied.
+ * @return the redirect port with offset
+ */
public int getRedirectPortWithOffset() {
return getRedirectPort() + getPortOffset();
}
/**
- * @return the scheme that will be assigned to requests received through this connector. Default value is "http".
+ * Returns the scheme that will be assigned to requests received through this connector.
+ * @return the scheme, default value is "http"
*/
public String getScheme() {
return this.scheme;
@@ -770,8 +853,8 @@ public class Connector extends LifecycleMBeanBase {
/**
- * @return the secure connection flag that will be assigned to requests received through this connector. Default
- * value is "false".
+ * Returns the secure connection flag that will be assigned to requests received through this connector.
+ * @return the secure flag, default value is {@code false}
*/
public boolean getSecure() {
return this.secure;
@@ -790,7 +873,8 @@ public class Connector extends LifecycleMBeanBase {
/**
- * @return the name of character encoding to be used for the URI using the original case.
+ * Returns the name of character encoding to be used for the URI using the original case.
+ * @return the URI encoding name
*/
public String getURIEncoding() {
return uriCharset.name();
@@ -798,7 +882,8 @@ public class Connector extends LifecycleMBeanBase {
/**
- * @return The Charset to use to convert raw URI bytes (after %nn decoding) to characters. This will never be null
+ * Returns the Charset to use to convert raw URI bytes (after %nn decoding) to characters.
+ * @return the URI charset, never null
*/
public Charset getURICharset() {
return uriCharset;
@@ -824,7 +909,8 @@ public class Connector extends LifecycleMBeanBase {
/**
- * @return the true if the entity body encoding should be used for the URI.
+ * Returns whether the entity body encoding should be used for the URI.
+ * @return {@code true} if the entity body encoding should be used for the URI
*/
public boolean getUseBodyEncodingForURI() {
return this.useBodyEncodingForURI;
@@ -883,6 +969,10 @@ public class Connector extends LifecycleMBeanBase {
}
+ /**
+ * Returns the name of the executor associated with this connector.
+ * @return the executor name, or {@link #INTERNAL_EXECUTOR_NAME} if using the internal executor
+ */
public String getExecutorName() {
Object obj = protocolHandler.getExecutor();
if (obj instanceof org.apache.catalina.Executor) {
@@ -892,61 +982,109 @@ public class Connector extends LifecycleMBeanBase {
}
+ /**
+ * Adds an SSL host configuration to this connector.
+ * @param sslHostConfig the SSL host configuration to add
+ */
public void addSslHostConfig(SSLHostConfig sslHostConfig) {
protocolHandler.addSslHostConfig(sslHostConfig);
}
+ /**
+ * Returns the SSL host configurations for this connector.
+ * @return array of SSL host configurations
+ */
public SSLHostConfig[] findSslHostConfigs() {
return protocolHandler.findSslHostConfigs();
}
+ /**
+ * Adds an upgrade protocol to this connector.
+ * @param upgradeProtocol the upgrade protocol to add
+ */
public void addUpgradeProtocol(UpgradeProtocol upgradeProtocol) {
protocolHandler.addUpgradeProtocol(upgradeProtocol);
}
+ /**
+ * Returns the registered upgrade protocols for this connector.
+ * @return array of upgrade protocols
+ */
public UpgradeProtocol[] findUpgradeProtocols() {
return protocolHandler.findUpgradeProtocols();
}
+ /**
+ * Returns the handling mode for encoded reverse solidus (backslash) characters.
+ * @return the encoded reverse solidus handling mode as a string
+ */
public String getEncodedReverseSolidusHandling() {
return encodedReverseSolidusHandling.getValue();
}
+ /**
+ * Sets the handling mode for encoded reverse solidus (backslash) characters.
+ * @param encodedReverseSolidusHandling the handling mode value
+ */
public void setEncodedReverseSolidusHandling(String encodedReverseSolidusHandling) {
this.encodedReverseSolidusHandling = EncodedSolidusHandling.fromString(encodedReverseSolidusHandling);
}
+ /**
+ * Returns the internal handling mode for encoded reverse solidus (backslash) characters.
+ * @return the encoded reverse solidus handling enum
+ */
public EncodedSolidusHandling getEncodedReverseSolidusHandlingInternal() {
return encodedReverseSolidusHandling;
}
+ /**
+ * Returns the handling mode for encoded solidus (forward slash) characters.
+ * @return the encoded solidus handling mode as a string
+ */
public String getEncodedSolidusHandling() {
return encodedSolidusHandling.getValue();
}
+ /**
+ * Sets the handling mode for encoded solidus (forward slash) characters.
+ * @param encodedSolidusHandling the handling mode value
+ */
public void setEncodedSolidusHandling(String encodedSolidusHandling) {
this.encodedSolidusHandling = EncodedSolidusHandling.fromString(encodedSolidusHandling);
}
+ /**
+ * Returns the internal handling mode for encoded solidus (forward slash) characters.
+ * @return the encoded solidus handling enum
+ */
public EncodedSolidusHandling getEncodedSolidusHandlingInternal() {
return encodedSolidusHandling;
}
+ /**
+ * Returns whether suspicious URIs should be rejected.
+ * @return {@code true} if suspicious URIs should be rejected
+ */
public boolean getRejectSuspiciousURIs() {
return rejectSuspiciousURIs;
}
+ /**
+ * Sets whether suspicious URIs should be rejected.
+ * @param rejectSuspiciousURIs {@code true} to reject suspicious URIs
+ */
public void setRejectSuspiciousURIs(boolean rejectSuspiciousURIs) {
this.rejectSuspiciousURIs = rejectSuspiciousURIs;
}
@@ -981,6 +1119,13 @@ public class Connector extends LifecycleMBeanBase {
}
+ /**
+ * Create the key properties for the ObjectName of a registered MBean.
+ *
+ * @param type The component type
+ *
+ * @return the key properties string for the ObjectName
+ */
protected String createObjectNameKeyProperties(String type) {
Object addressObj = getProperty("address");
diff --git a/java/org/apache/catalina/connector/CoyoteAdapter.java b/java/org/apache/catalina/connector/CoyoteAdapter.java
index bebffbccb4..7e57ace5a9 100644
--- a/java/org/apache/catalina/connector/CoyoteAdapter.java
+++ b/java/org/apache/catalina/connector/CoyoteAdapter.java
@@ -70,6 +70,9 @@ public class CoyoteAdapter implements Adapter {
private static final EnumSet<SessionTrackingMode> SSL_ONLY = EnumSet.of(SessionTrackingMode.SSL);
+ /**
+ * The note index used to store the Request and Response objects on the coyote request and response.
+ */
public static final int ADAPTER_NOTES = 1;
diff --git a/java/org/apache/catalina/connector/CoyoteInputStream.java b/java/org/apache/catalina/connector/CoyoteInputStream.java
index 076055bb04..f10b271082 100644
--- a/java/org/apache/catalina/connector/CoyoteInputStream.java
+++ b/java/org/apache/catalina/connector/CoyoteInputStream.java
@@ -34,12 +34,23 @@ import org.apache.tomcat.util.res.StringManager;
*/
public class CoyoteInputStream extends ServletInputStream {
+ /**
+ * The string manager for this class.
+ */
protected static final StringManager sm = StringManager.getManager(CoyoteInputStream.class);
+ /**
+ * The underlying input buffer.
+ */
protected InputBuffer ib;
+ /**
+ * Construct a new CoyoteInputStream.
+ *
+ * @param ib The underlying input buffer
+ */
protected CoyoteInputStream(InputBuffer ib) {
this.ib = ib;
}
diff --git a/java/org/apache/catalina/connector/CoyoteOutputStream.java b/java/org/apache/catalina/connector/CoyoteOutputStream.java
index de1e5fbe41..9d46841efd 100644
--- a/java/org/apache/catalina/connector/CoyoteOutputStream.java
+++ b/java/org/apache/catalina/connector/CoyoteOutputStream.java
@@ -30,17 +30,28 @@ import org.apache.tomcat.util.res.StringManager;
*/
public class CoyoteOutputStream extends ServletOutputStream {
+ /**
+ * The string manager for this class.
+ */
protected static final StringManager sm = StringManager.getManager(CoyoteOutputStream.class);
// ----------------------------------------------------- Instance Variables
+ /**
+ * The underlying output buffer.
+ */
protected OutputBuffer ob;
// ----------------------------------------------------------- Constructors
+ /**
+ * Construct a new CoyoteOutputStream.
+ *
+ * @param ob The underlying output buffer
+ */
protected CoyoteOutputStream(OutputBuffer ob) {
this.ob = ob;
}
diff --git a/java/org/apache/catalina/connector/CoyotePrincipal.java b/java/org/apache/catalina/connector/CoyotePrincipal.java
index 132f4ab35c..50ea1bc61e 100644
--- a/java/org/apache/catalina/connector/CoyotePrincipal.java
+++ b/java/org/apache/catalina/connector/CoyotePrincipal.java
@@ -30,6 +30,11 @@ public class CoyotePrincipal implements Principal, Serializable {
// ----------------------------------------------------------- Constructors
+ /**
+ * Construct a new CoyotePrincipal.
+ *
+ * @param name The name of the principal
+ */
public CoyotePrincipal(String name) {
this.name = name;
diff --git a/java/org/apache/catalina/connector/CoyoteReader.java b/java/org/apache/catalina/connector/CoyoteReader.java
index 96ee862069..1b23f33083 100644
--- a/java/org/apache/catalina/connector/CoyoteReader.java
+++ b/java/org/apache/catalina/connector/CoyoteReader.java
@@ -36,15 +36,26 @@ public class CoyoteReader extends BufferedReader {
// ----------------------------------------------------- Instance Variables
+ /**
+ * The underlying input buffer.
+ */
protected InputBuffer ib;
+ /**
+ * Buffer used for reading lines.
+ */
protected char[] lineBuffer = null;
// ----------------------------------------------------------- Constructors
+ /**
+ * Construct a new CoyoteReader.
+ *
+ * @param ib The underlying input buffer
+ */
public CoyoteReader(InputBuffer ib) {
super(ib, 1);
this.ib = ib;
diff --git a/java/org/apache/catalina/connector/CoyoteWriter.java b/java/org/apache/catalina/connector/CoyoteWriter.java
index 28c6c8b0f6..5f036d429a 100644
--- a/java/org/apache/catalina/connector/CoyoteWriter.java
+++ b/java/org/apache/catalina/connector/CoyoteWriter.java
@@ -33,13 +33,25 @@ public class CoyoteWriter extends PrintWriter {
// ----------------------------------------------------- Instance Variables
+ /**
+ * The underlying output buffer.
+ */
protected OutputBuffer ob;
+
+ /**
+ * Flag indicating whether an error has occurred.
+ */
protected boolean error = false;
// ----------------------------------------------------------- Constructors
+ /**
+ * Construct a new CoyoteWriter.
+ *
+ * @param ob The underlying output buffer
+ */
public CoyoteWriter(OutputBuffer ob) {
super(ob);
this.ob = ob;
diff --git a/java/org/apache/catalina/connector/InputBuffer.java b/java/org/apache/catalina/connector/InputBuffer.java
index 50e8c6b830..be12dbb414 100644
--- a/java/org/apache/catalina/connector/InputBuffer.java
+++ b/java/org/apache/catalina/connector/InputBuffer.java
@@ -60,12 +60,24 @@ public class InputBuffer extends Reader implements ByteChunk.ByteInputChannel, A
private static final ByteBuffer EMPTY_BUFFER = ByteBuffer.allocate(0);
+ /**
+ * Default buffer size in bytes.
+ */
public static final int DEFAULT_BUFFER_SIZE = 8 * 1024;
// The buffer can be used for byte[] and char[] reading
// ( this is needed to support ServletInputStream and BufferedReader )
+ /**
+ * Initial state before any read operation.
+ */
public final int INITIAL_STATE = 0;
+ /**
+ * State when reading character data.
+ */
public final int CHAR_STATE = 1;
+ /**
+ * State when reading byte data.
+ */
public final int BYTE_STATE = 2;
@@ -215,6 +227,11 @@ public class InputBuffer extends Reader implements ByteChunk.ByteInputChannel, A
}
+ /**
+ * Returns the number of bytes or characters available in the buffer.
+ *
+ * @return the number of bytes or characters available
+ */
public int available() {
int available = availableInThisBuffer();
if (available == 0) {
@@ -236,11 +253,21 @@ public class InputBuffer extends Reader implements ByteChunk.ByteInputChannel, A
}
+ /**
+ * Sets the read listener for async request processing.
+ *
+ * @param listener the read listener to set
+ */
public void setReadListener(ReadListener listener) {
coyoteRequest.setReadListener(listener);
}
+ /**
+ * Checks if all data has been read from the input buffer.
+ *
+ * @return {@code true} if all data has been read
+ */
public boolean isFinished() {
int available = 0;
if (state == BYTE_STATE) {
@@ -256,6 +283,11 @@ public class InputBuffer extends Reader implements ByteChunk.ByteInputChannel, A
}
+ /**
+ * Checks if the input buffer is ready for reading.
+ *
+ * @return {@code true} if the buffer is ready
+ */
public boolean isReady() {
if (coyoteRequest.getReadListener() == null) {
if (log.isDebugEnabled()) {
@@ -349,6 +381,13 @@ public class InputBuffer extends Reader implements ByteChunk.ByteInputChannel, A
}
+ /**
+ * Reads a single byte from the buffer.
+ *
+ * @return the byte read, or -1 if end of stream
+ *
+ * @throws IOException if an I/O error occurs
+ */
public int readByte() throws IOException {
throwIfClosed();
@@ -359,6 +398,17 @@ public class InputBuffer extends Reader implements ByteChunk.ByteInputChannel, A
}
+ /**
+ * Reads bytes into the specified array.
+ *
+ * @param b the buffer into which the data is read
+ * @param off the start offset in the destination array
+ * @param len the maximum number of bytes to read
+ *
+ * @return the number of bytes read, or -1 if end of stream
+ *
+ * @throws IOException if an I/O error occurs
+ */
public int read(byte[] b, int off, int len) throws IOException {
throwIfClosed();
@@ -400,6 +450,13 @@ public class InputBuffer extends Reader implements ByteChunk.ByteInputChannel, A
// ------------------------------------------------- Chars Handling Methods
+ /**
+ * Reads characters from the byte buffer using the current converter.
+ *
+ * @return the number of characters read, or -1 if end of stream
+ *
+ * @throws IOException if an I/O error occurs
+ */
public int realReadChars() throws IOException {
checkConverter();
@@ -555,6 +612,11 @@ public class InputBuffer extends Reader implements ByteChunk.ByteInputChannel, A
}
}
+ /**
+ * Ensures a byte-to-char converter is available, initializing one if necessary.
+ *
+ * @throws IOException if an I/O error occurs
+ */
public void checkConverter() throws IOException {
if (conv != null) {
return;
diff --git a/java/org/apache/catalina/core/AccessLogAdapter.java b/java/org/apache/catalina/core/AccessLogAdapter.java
index 666b058fd8..64afeb513e 100644
--- a/java/org/apache/catalina/core/AccessLogAdapter.java
+++ b/java/org/apache/catalina/core/AccessLogAdapter.java
@@ -30,11 +30,21 @@ public class AccessLogAdapter implements AccessLog {
private AccessLog[] logs;
+ /**
+ * Constructs a new adapter wrapping a single access log.
+ *
+ * @param log The access log to wrap
+ */
public AccessLogAdapter(AccessLog log) {
Objects.requireNonNull(log);
logs = new AccessLog[] { log };
}
+ /**
+ * Adds an access log to this adapter.
+ *
+ * @param log The access log to add
+ */
public void add(AccessLog log) {
Objects.requireNonNull(log);
AccessLog[] newArray = Arrays.copyOf(logs, logs.length + 1);
diff --git a/java/org/apache/catalina/core/ApplicationContext.java b/java/org/apache/catalina/core/ApplicationContext.java
index d74085a78f..2599307b9a 100644
--- a/java/org/apache/catalina/core/ApplicationContext.java
+++ b/java/org/apache/catalina/core/ApplicationContext.java
@@ -1174,6 +1174,12 @@ public class ApplicationContext implements ServletContext {
// -------------------------------------------------------- Package Methods
+
+ /**
+ * Returns the underlying StandardContext.
+ *
+ * @return the StandardContext
+ */
protected StandardContext getContext() {
return this.context;
}
@@ -1196,6 +1202,8 @@ public class ApplicationContext implements ServletContext {
/**
+ * Returns the ServletContext facade.
+ *
* @return the facade associated with this ApplicationContext.
*/
protected ServletContext getFacade() {
@@ -1215,6 +1223,11 @@ public class ApplicationContext implements ServletContext {
}
+ /**
+ * Sets whether new ServletContextListeners are allowed.
+ *
+ * @param allowed {@code true} to allow new listeners
+ */
protected void setNewServletContextListenerAllowed(boolean allowed) {
this.newServletContextListenerAllowed = allowed;
}
diff --git a/java/org/apache/catalina/core/ApplicationFilterChain.java b/java/org/apache/catalina/core/ApplicationFilterChain.java
index 67cd63f7b7..c049b6ade9 100644
--- a/java/org/apache/catalina/core/ApplicationFilterChain.java
+++ b/java/org/apache/catalina/core/ApplicationFilterChain.java
@@ -43,6 +43,9 @@ import org.apache.tomcat.util.res.StringManager;
*/
public final class ApplicationFilterChain implements FilterChain {
+ /** Constructs a new ApplicationFilterChain. */
+ ApplicationFilterChain() {}
+
// Used to enforce requirements of SRV.8.2 / SRV.14.2.5.1
private static final ThreadLocal<ServletRequest> lastServicedRequest = new ThreadLocal<>();
private static final ThreadLocal<ServletResponse> lastServicedResponse = new ThreadLocal<>();
@@ -51,6 +54,7 @@ public final class ApplicationFilterChain implements FilterChain {
// -------------------------------------------------------------- Constants
+ /** Default increment for filter array growth. */
public static final int INCREMENT = 10;
diff --git a/java/org/apache/catalina/core/ApplicationFilterConfig.java b/java/org/apache/catalina/core/ApplicationFilterConfig.java
index 09812ac55f..ea0c9f19f9 100644
--- a/java/org/apache/catalina/core/ApplicationFilterConfig.java
+++ b/java/org/apache/catalina/core/ApplicationFilterConfig.java
@@ -136,6 +136,8 @@ public final class ApplicationFilterConfig implements FilterConfig, Serializable
}
/**
+ * Returns the filter class name.
+ *
* @return The class of the filter we are configuring.
*/
public String getFilterClass() {
@@ -183,6 +185,11 @@ public final class ApplicationFilterConfig implements FilterConfig, Serializable
// --------------------------------------------------------- Public Methods
+ /**
+ * Returns an unmodifiable map of filter initialization parameters.
+ *
+ * @return the filter initialization parameter map
+ */
public Map<String,String> getFilterInitParameterMap() {
return Collections.unmodifiableMap(filterDef.getParameterMap());
}
diff --git a/java/org/apache/catalina/core/ApplicationFilterRegistration.java b/java/org/apache/catalina/core/ApplicationFilterRegistration.java
index c14ce0314f..3aea0ccc75 100644
--- a/java/org/apache/catalina/core/ApplicationFilterRegistration.java
+++ b/java/org/apache/catalina/core/ApplicationFilterRegistration.java
@@ -32,6 +32,9 @@ import org.apache.tomcat.util.descriptor.web.FilterDef;
import org.apache.tomcat.util.descriptor.web.FilterMap;
import org.apache.tomcat.util.res.StringManager;
+/**
+ * Dynamic filter registration implementation.
+ */
public class ApplicationFilterRegistration implements FilterRegistration.Dynamic {
/**
@@ -42,6 +45,12 @@ public class ApplicationFilterRegistration implements FilterRegistration.Dynamic
private final FilterDef filterDef;
private final Context context;
+ /**
+ * Constructs a new ApplicationFilterRegistration.
+ *
+ * @param filterDef the filter definition
+ * @param context the context
+ */
public ApplicationFilterRegistration(FilterDef filterDef, Context context) {
this.filterDef = filterDef;
this.context = context;
diff --git a/java/org/apache/catalina/core/ApplicationMapping.java b/java/org/apache/catalina/core/ApplicationMapping.java
index fd3cd06f3e..2c74602440 100644
--- a/java/org/apache/catalina/core/ApplicationMapping.java
+++ b/java/org/apache/catalina/core/ApplicationMapping.java
@@ -21,16 +21,29 @@ import jakarta.servlet.http.MappingMatch;
import org.apache.catalina.mapper.MappingData;
+/**
+ * Holds servlet mapping data for a single request.
+ */
public class ApplicationMapping {
private final MappingData mappingData;
private volatile HttpServletMapping mapping = null;
+ /**
+ * Constructs a new ApplicationMapping.
+ *
+ * @param mappingData the mapping data
+ */
public ApplicationMapping(MappingData mappingData) {
this.mappingData = mappingData;
}
+ /**
+ * Returns the HttpServletMapping for this request.
+ *
+ * @return the servlet mapping
+ */
public HttpServletMapping getHttpServletMapping() {
if (mapping == null) {
String servletName;
@@ -76,6 +89,9 @@ public class ApplicationMapping {
return mapping;
}
+ /**
+ * Recycles this mapping for reuse.
+ */
public void recycle() {
mapping = null;
}
diff --git a/java/org/apache/catalina/core/ApplicationPart.java b/java/org/apache/catalina/core/ApplicationPart.java
index 62720374fe..04827c429e 100644
--- a/java/org/apache/catalina/core/ApplicationPart.java
+++ b/java/org/apache/catalina/core/ApplicationPart.java
@@ -43,6 +43,12 @@ public class ApplicationPart implements Part {
private final FileItem fileItem;
private final File location;
+ /**
+ * Constructs a new ApplicationPart.
+ *
+ * @param fileItem the underlying FileItem
+ * @param location the file location
+ */
public ApplicationPart(FileItem fileItem, File location) {
this.fileItem = fileItem;
this.location = location;
@@ -120,6 +126,14 @@ public class ApplicationPart implements Part {
}
}
+ /**
+ * Returns the part content as a string with the given encoding.
+ *
+ * @param encoding the character encoding
+ * @return the part content as a string
+ * @throws UnsupportedEncodingException if the encoding is not supported
+ * @throws IOException if an I/O error occurs
+ */
public String getString(String encoding) throws UnsupportedEncodingException, IOException {
return fileItem.getString(encoding);
}
diff --git a/java/org/apache/catalina/core/ApplicationServletRegistration.java b/java/org/apache/catalina/core/ApplicationServletRegistration.java
index 71adec81ac..1587ee4837 100644
--- a/java/org/apache/catalina/core/ApplicationServletRegistration.java
+++ b/java/org/apache/catalina/core/ApplicationServletRegistration.java
@@ -34,6 +34,9 @@ import org.apache.catalina.util.ParameterMap;
import org.apache.tomcat.util.buf.UDecoder;
import org.apache.tomcat.util.res.StringManager;
+/**
+ * Dynamic servlet registration implementation.
+ */
public class ApplicationServletRegistration implements ServletRegistration.Dynamic {
/**
@@ -45,6 +48,12 @@ public class ApplicationServletRegistration implements ServletRegistration.Dynam
private final Context context;
private ServletSecurityElement constraint;
+ /**
+ * Constructs a new ApplicationServletRegistration.
+ *
+ * @param wrapper the servlet wrapper
+ * @param context the servlet context
+ */
public ApplicationServletRegistration(Wrapper wrapper, Context context) {
this.wrapper = wrapper;
this.context = context;
diff --git a/java/org/apache/catalina/core/ApplicationSessionCookieConfig.java b/java/org/apache/catalina/core/ApplicationSessionCookieConfig.java
index f0fd66cb5a..0315a8ad34 100644
--- a/java/org/apache/catalina/core/ApplicationSessionCookieConfig.java
+++ b/java/org/apache/catalina/core/ApplicationSessionCookieConfig.java
@@ -29,6 +29,9 @@ import org.apache.catalina.util.SessionConfig;
import org.apache.tomcat.util.descriptor.web.Constants;
import org.apache.tomcat.util.res.StringManager;
+/**
+ * Implementation of session cookie configuration.
+ */
public class ApplicationSessionCookieConfig implements SessionCookieConfig {
/**
@@ -45,6 +48,11 @@ public class ApplicationSessionCookieConfig implements SessionCookieConfig {
private String name;
private final StandardContext context;
+ /**
+ * Constructs a new ApplicationSessionCookieConfig.
+ *
+ * @param context the standard context
+ */
public ApplicationSessionCookieConfig(StandardContext context) {
this.context = context;
}
diff --git a/java/org/apache/catalina/core/AprLifecycleListener.java b/java/org/apache/catalina/core/AprLifecycleListener.java
index 2e0bf01585..004248c25e 100644
--- a/java/org/apache/catalina/core/AprLifecycleListener.java
+++ b/java/org/apache/catalina/core/AprLifecycleListener.java
@@ -67,11 +67,17 @@ public class AprLifecycleListener implements LifecycleListener {
private static final int TCN_1_REQUIRED_MINOR = 3;
private static final int TCN_1_REQUIRED_PATCH = 4;
+ /** Required major version of Tomcat Native. */
protected static final int TCN_REQUIRED_MAJOR = 2;
+ /** Required minor version of Tomcat Native. */
protected static final int TCN_REQUIRED_MINOR = 0;
+ /** Required patch version of Tomcat Native. */
protected static final int TCN_REQUIRED_PATCH = 12;
+ /** Recommended major version of Tomcat Native. */
protected static final int TCN_RECOMMENDED_MAJOR = 2;
+ /** Recommended minor version of Tomcat Native. */
protected static final int TCN_RECOMMENDED_MINOR = 0;
+ /** Recommended patch version of Tomcat Native. */
protected static final int TCN_RECOMMENDED_PV = 14;
@@ -82,10 +88,15 @@ public class AprLifecycleListener implements LifecycleListener {
private static int tcnPatch = 0;
private static int tcnVersion = 0;
+ /** SSL engine configuration. */
protected static String SSLEngine = "on"; // default on
+ /** FIPS mode configuration. */
protected static String FIPSMode = "off"; // default off, valid only when SSLEngine="on"
+ /** SSL random seed source. */
protected static String SSLRandomSeed = "builtin";
+ /** Indicates whether SSL has been initialized. */
protected static boolean sslInitialized = false;
+ /** Indicates whether FIPS mode is currently active. */
protected static boolean fipsModeActive = false;
/**
@@ -108,6 +119,11 @@ public class AprLifecycleListener implements LifecycleListener {
private boolean instanceInitialized = false;
+ /**
+ * Checks APR availability, initializing if necessary.
+ *
+ * @return {@code true} if APR is available
+ */
public static boolean isAprAvailable() {
// https://bz.apache.org/bugzilla/show_bug.cgi?id=48613
if (org.apache.tomcat.jni.AprStatus.isInstanceCreated()) {
@@ -212,6 +228,7 @@ public class AprLifecycleListener implements LifecycleListener {
}
}
+ /** Constructs a new AprLifecycleListener. */
public AprLifecycleListener() {
org.apache.tomcat.jni.AprStatus.setInstanceCreated(true);
}
@@ -505,10 +522,20 @@ public class AprLifecycleListener implements LifecycleListener {
log.info(sm.getString("aprListener.initializedOpenSSL", SSL.versionString()));
}
+ /**
+ * Returns the SSL engine configuration.
+ *
+ * @return the SSL engine configuration
+ */
public String getSSLEngine() {
return SSLEngine;
}
+ /**
+ * Sets the SSL engine configuration.
+ *
+ * @param SSLEngine the SSL engine configuration
+ */
public void setSSLEngine(String SSLEngine) {
if (!SSLEngine.equals(AprLifecycleListener.SSLEngine)) {
// Ensure that the SSLEngine is consistent with that used for SSL init
@@ -520,10 +547,20 @@ public class AprLifecycleListener implements LifecycleListener {
}
}
+ /**
+ * Returns the SSL random seed source.
+ *
+ * @return the SSL random seed source
+ */
public String getSSLRandomSeed() {
return SSLRandomSeed;
}
+ /**
+ * Sets the SSL random seed source.
+ *
+ * @param SSLRandomSeed the SSL random seed source
+ */
public void setSSLRandomSeed(String SSLRandomSeed) {
if (!SSLRandomSeed.equals(AprLifecycleListener.SSLRandomSeed)) {
// Ensure that the random seed is consistent with that used for SSL init
@@ -535,10 +572,20 @@ public class AprLifecycleListener implements LifecycleListener {
}
}
+ /**
+ * Returns the FIPS mode configuration.
+ *
+ * @return the FIPS mode configuration
+ */
public String getFIPSMode() {
return FIPSMode;
}
+ /**
+ * Sets the FIPS mode configuration.
+ *
+ * @param FIPSMode the FIPS mode configuration
+ */
public void setFIPSMode(String FIPSMode) {
if (!FIPSMode.equals(AprLifecycleListener.FIPSMode)) {
// Ensure that the FIPS mode is consistent with that used for SSL init
@@ -550,20 +597,40 @@ public class AprLifecycleListener implements LifecycleListener {
}
}
+ /**
+ * Returns whether FIPS mode is currently active.
+ *
+ * @return {@code true} if FIPS mode is active
+ */
public boolean isFIPSModeActive() {
return fipsModeActive;
}
+ /**
+ * Configures whether to use OpenSSL.
+ *
+ * @param useOpenSSL {@code true} to use OpenSSL
+ */
public void setUseOpenSSL(boolean useOpenSSL) {
if (useOpenSSL != org.apache.tomcat.jni.AprStatus.getUseOpenSSL()) {
org.apache.tomcat.jni.AprStatus.setUseOpenSSL(useOpenSSL);
}
}
+ /**
+ * Returns whether OpenSSL is in use.
+ *
+ * @return {@code true} if OpenSSL is in use
+ */
public static boolean getUseOpenSSL() {
return org.apache.tomcat.jni.AprStatus.getUseOpenSSL();
}
+ /**
+ * Returns whether an APR instance has been created.
+ *
+ * @return {@code true} if an APR instance has been created
+ */
public static boolean isInstanceCreated() {
return org.apache.tomcat.jni.AprStatus.isInstanceCreated();
}
diff --git a/java/org/apache/catalina/core/AsyncContextImpl.java b/java/org/apache/catalina/core/AsyncContextImpl.java
index 1de9d5edd5..e070129a34 100644
--- a/java/org/apache/catalina/core/AsyncContextImpl.java
+++ b/java/org/apache/catalina/core/AsyncContextImpl.java
@@ -50,10 +50,17 @@ import org.apache.tomcat.util.ExceptionUtils;
import org.apache.tomcat.util.buf.UDecoder;
import org.apache.tomcat.util.res.StringManager;
+/**
+ * Implementation of {@link AsyncContext} that manages the lifecycle of an asynchronous
+ * request processing operation.
+ */
public class AsyncContextImpl implements AsyncContext, AsyncContextCallback {
private static final Log log = LogFactory.getLog(AsyncContextImpl.class);
+ /**
+ * String manager for localized log messages.
+ */
protected static final StringManager sm = StringManager.getManager(AsyncContextImpl.class);
/*
@@ -77,6 +84,11 @@ public class AsyncContextImpl implements AsyncContext, AsyncContextCallback {
private final AtomicBoolean hasErrorProcessingStarted = new AtomicBoolean(false);
private final AtomicBoolean hasOnErrorReturned = new AtomicBoolean(false);
+ /**
+ * Constructs an AsyncContextImpl for the given request.
+ *
+ * @param request The request associated with this async context
+ */
public AsyncContextImpl(Request request) {
this.request = request;
if (log.isTraceEnabled()) {
@@ -118,6 +130,11 @@ public class AsyncContextImpl implements AsyncContext, AsyncContextCallback {
}
+ /**
+ * Fires the timeout event for this async context.
+ *
+ * @return {@code true} if the timeout was handled successfully
+ */
public boolean timeout() {
AtomicBoolean result = new AtomicBoolean();
request.getCoyoteRequest().action(ActionCode.ASYNC_TIMEOUT, result);
@@ -268,6 +285,9 @@ public class AsyncContextImpl implements AsyncContext, AsyncContextCallback {
return listener;
}
+ /**
+ * Recycles this async context, resetting all internal state for reuse.
+ */
public void recycle() {
if (log.isTraceEnabled()) {
logDebug("recycle ");
@@ -289,6 +309,11 @@ public class AsyncContextImpl implements AsyncContext, AsyncContextCallback {
servletResponse = null;
}
+ /**
+ * Checks whether async processing has been started for this context.
+ *
+ * @return {@code true} if async processing has started
+ */
public boolean isStarted() {
AtomicBoolean result = new AtomicBoolean(false);
Request request = this.request;
@@ -297,6 +322,14 @@ public class AsyncContextImpl implements AsyncContext, AsyncContextCallback {
return result.get();
}
+ /**
+ * Initializes this async context with the given parameters and fires onStartAsync events.
+ *
+ * @param context The context for this async operation
+ * @param request The servlet request
+ * @param response The servlet response
+ * @param originalRequestResponse {@code true} if the request/response are the original ones
+ */
public void setStarted(Context context, ServletRequest request, ServletResponse response,
boolean originalRequestResponse) {
@@ -332,6 +365,12 @@ public class AsyncContextImpl implements AsyncContext, AsyncContextCallback {
return hasOriginalRequestAndResponse;
}
+ /**
+ * Performs the internal dispatch for the pending async dispatch operation.
+ *
+ * @throws ServletException if a servlet error occurs
+ * @throws IOException if an I/O error occurs
+ */
protected void doInternalDispatch() throws ServletException, IOException {
if (log.isTraceEnabled()) {
logDebug("intDispatch");
@@ -391,6 +430,12 @@ public class AsyncContextImpl implements AsyncContext, AsyncContextCallback {
}
+ /**
+ * Sets the error state and optionally fires onError events to all registered listeners.
+ *
+ * @param t The throwable that caused the error, or {@code null}
+ * @param fireOnError {@code true} if onError should be fired to listeners
+ */
public void setErrorState(Throwable t, boolean fireOnError) {
if (!hasErrorProcessingStarted.compareAndSet(false, true)) {
// Skip duplicate error processing
diff --git a/java/org/apache/catalina/core/AsyncListenerWrapper.java b/java/org/apache/catalina/core/AsyncListenerWrapper.java
index 41fbf57722..790f042eb3 100644
--- a/java/org/apache/catalina/core/AsyncListenerWrapper.java
+++ b/java/org/apache/catalina/core/AsyncListenerWrapper.java
@@ -23,48 +23,94 @@ import jakarta.servlet.AsyncListener;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
+/**
+ * Wrapper for an {@link AsyncListener} that supports custom request and response objects
+ * for event customization.
+ */
public class AsyncListenerWrapper {
private AsyncListener listener = null;
private ServletRequest servletRequest = null;
private ServletResponse servletResponse = null;
+ /**
+ * Default constructor.
+ */
+ public AsyncListenerWrapper() {
+ }
+ /**
+ * Fires the onStartAsync event on the wrapped listener.
+ *
+ * @param event The async event
+ * @throws IOException if an I/O error occurs
+ */
public void fireOnStartAsync(AsyncEvent event) throws IOException {
listener.onStartAsync(customizeEvent(event));
}
-
+ /**
+ * Fires the onComplete event on the wrapped listener.
+ *
+ * @param event The async event
+ * @throws IOException if an I/O error occurs
+ */
public void fireOnComplete(AsyncEvent event) throws IOException {
listener.onComplete(customizeEvent(event));
}
-
+ /**
+ * Fires the onTimeout event on the wrapped listener.
+ *
+ * @param event The async event
+ * @throws IOException if an I/O error occurs
+ */
public void fireOnTimeout(AsyncEvent event) throws IOException {
listener.onTimeout(customizeEvent(event));
}
-
+ /**
+ * Fires the onError event on the wrapped listener.
+ *
+ * @param event The async event
+ * @throws IOException if an I/O error occurs
+ */
public void fireOnError(AsyncEvent event) throws IOException {
listener.onError(customizeEvent(event));
}
-
+ /**
+ * Returns the wrapped async listener.
+ *
+ * @return the async listener
+ */
public AsyncListener getListener() {
return listener;
}
-
+ /**
+ * Sets the async listener to wrap.
+ *
+ * @param listener the async listener
+ */
public void setListener(AsyncListener listener) {
this.listener = listener;
}
-
+ /**
+ * Sets the custom servlet request to use for events.
+ *
+ * @param servletRequest the servlet request
+ */
public void setServletRequest(ServletRequest servletRequest) {
this.servletRequest = servletRequest;
}
-
+ /**
+ * Sets the custom servlet response to use for events.
+ *
+ * @param servletResponse the servlet response
+ */
public void setServletResponse(ServletResponse servletResponse) {
this.servletResponse = servletResponse;
}
diff --git a/java/org/apache/catalina/core/Constants.java b/java/org/apache/catalina/core/Constants.java
index 3a2bd5bc9b..34cc2c5e14 100644
--- a/java/org/apache/catalina/core/Constants.java
+++ b/java/org/apache/catalina/core/Constants.java
@@ -16,10 +16,28 @@
*/
package org.apache.catalina.core;
+/**
+ * Constants used by the core Catalina package.
+ */
public class Constants {
+ /**
+ * Prevents instantiation.
+ */
+ private Constants() {
+ }
+
+ /**
+ * The major version of the Servlet specification implemented by this container.
+ */
public static final int MAJOR_VERSION = 6;
+ /**
+ * The minor version of the Servlet specification implemented by this container.
+ */
public static final int MINOR_VERSION = 0;
+ /**
+ * The fully qualified class name of the JSP servlet.
+ */
public static final String JSP_SERVLET_CLASS = "org.apache.jasper.servlet.JspServlet";
}
diff --git a/java/org/apache/catalina/core/ContainerBase.java b/java/org/apache/catalina/core/ContainerBase.java
index 25316577c6..acc3178807 100644
--- a/java/org/apache/catalina/core/ContainerBase.java
+++ b/java/org/apache/catalina/core/ContainerBase.java
@@ -143,6 +143,12 @@ public abstract class ContainerBase extends LifecycleMBeanBase implements Contai
}
+ /**
+ * Constructs a new ContainerBase instance.
+ */
+ public ContainerBase() {
+ }
+
// ----------------------------------------------------- Instance Variables
@@ -163,6 +169,9 @@ public abstract class ContainerBase extends LifecycleMBeanBase implements Contai
* The future allowing control of the background processor.
*/
protected ScheduledFuture<?> backgroundProcessorFuture;
+ /**
+ * The future allowing control of the monitor thread.
+ */
protected ScheduledFuture<?> monitorFuture;
/**
@@ -256,6 +265,9 @@ public abstract class ContainerBase extends LifecycleMBeanBase implements Contai
* The number of threads available to process start and stop events for any children associated with this container.
*/
private int startStopThreads = 1;
+ /**
+ * The executor used for threaded start and stop operations.
+ */
protected ExecutorService startStopExecutor;
@@ -344,8 +356,10 @@ public abstract class ContainerBase extends LifecycleMBeanBase implements Contai
}
- /*
+ /**
* Provide access to just the cluster component attached to this container.
+ *
+ * @return the cluster component directly attached to this container, or {@code null} if none
*/
protected Cluster getClusterInternal() {
Lock readLock = clusterLock.readLock();
@@ -503,6 +517,11 @@ public abstract class ContainerBase extends LifecycleMBeanBase implements Contai
}
+ /**
+ * Returns the Realm directly attached to this container, without falling back to the parent.
+ *
+ * @return the realm component directly attached to this container, or {@code null} if none
+ */
protected Realm getRealmInternal() {
Lock l = realmLock.readLock();
l.lock();
@@ -1063,6 +1082,11 @@ public abstract class ContainerBase extends LifecycleMBeanBase implements Contai
}
+ /**
+ * Returns the ObjectNames of all child containers that are instances of ContainerBase.
+ *
+ * @return the ObjectNames of the managed child containers
+ */
public ObjectName[] getChildren() {
List<ObjectName> names;
childrenLock.readLock().lock();
@@ -1132,7 +1156,16 @@ public abstract class ContainerBase extends LifecycleMBeanBase implements Contai
// ------------------------------- ContainerBackgroundProcessor Inner Class
+ /**
+ * Monitor runnable that starts the background processor thread when the container is available.
+ */
protected class ContainerBackgroundProcessorMonitor implements Runnable {
+ /**
+ * Constructs a new ContainerBackgroundProcessorMonitor instance.
+ */
+ protected ContainerBackgroundProcessorMonitor() {
+ }
+
@Override
public void run() {
if (getState().isAvailable()) {
@@ -1146,12 +1179,22 @@ public abstract class ContainerBase extends LifecycleMBeanBase implements Contai
* delay.
*/
protected class ContainerBackgroundProcessor implements Runnable {
+ /**
+ * Constructs a new ContainerBackgroundProcessor instance.
+ */
+ protected ContainerBackgroundProcessor() {
+ }
@Override
public void run() {
processChildren(ContainerBase.this);
}
+ /**
+ * Recursively processes the background processing for the given container and its children.
+ *
+ * @param container the container to process
+ */
protected void processChildren(Container container) {
ClassLoader originalClassLoader = null;
diff --git a/java/org/apache/catalina/core/ContextNamingInfoListener.java b/java/org/apache/catalina/core/ContextNamingInfoListener.java
index 5b1c760e6a..18f9e7f84c 100644
--- a/java/org/apache/catalina/core/ContextNamingInfoListener.java
+++ b/java/org/apache/catalina/core/ContextNamingInfoListener.java
@@ -45,6 +45,12 @@ import org.apache.tomcat.util.res.StringManager;
*/
public class ContextNamingInfoListener implements LifecycleListener {
+ /**
+ * Default constructor for ContextNamingInfoListener.
+ */
+ public ContextNamingInfoListener() {
+ }
+
private static final String PATH_ENTRY_NAME = "context/path";
private static final String ENCODED_PATH_ENTRY_NAME = "context/encodedPath";
private static final String WEBAPP_VERSION_ENTRY_NAME = "context/webappVersion";
diff --git a/java/org/apache/catalina/core/DefaultInstanceManager.java b/java/org/apache/catalina/core/DefaultInstanceManager.java
index 78b4d3719a..3798704810 100644
--- a/java/org/apache/catalina/core/DefaultInstanceManager.java
+++ b/java/org/apache/catalina/core/DefaultInstanceManager.java
@@ -56,6 +56,10 @@ import org.apache.tomcat.util.ExceptionUtils;
import org.apache.tomcat.util.collections.ManagedConcurrentWeakHashMap;
import org.apache.tomcat.util.res.StringManager;
+/**
+ * Default implementation of {@link InstanceManager} that handles annotation-based
+ * dependency injection for EJB, JPA, and web service references.
+ */
public class DefaultInstanceManager implements InstanceManager {
// Used when there are no annotations in a class
@@ -97,11 +101,34 @@ public class DefaultInstanceManager implements InstanceManager {
}
+ /**
+ * The context associated with this instance manager.
+ */
private final Context context;
+
+ /**
+ * The injection map for JNDI resource lookups.
+ */
private final Map<String,Map<String,String>> injectionMap;
+
+ /**
+ * The class loader for loading application classes.
+ */
protected final ClassLoader classLoader;
+
+ /**
+ * The class loader for loading container classes.
+ */
protected final ClassLoader containerClassLoader;
+
+ /**
+ * Whether to perform privileged operations.
+ */
protected final boolean privileged;
+
+ /**
+ * Whether to ignore annotations during injection.
+ */
protected final boolean ignoreAnnotations;
private final Set<String> restrictedClasses;
private final ManagedConcurrentWeakHashMap<Class<?>,AnnotationCacheEntry[]> annotationCache =
@@ -109,6 +136,14 @@ public class DefaultInstanceManager implements InstanceManager {
private final Map<String,String> postConstructMethods;
private final Map<String,String> preDestroyMethods;
+ /**
+ * Create a new DefaultInstanceManager.
+ *
+ * @param context The context associated with this instance manager
+ * @param injectionMap The injection map for JNDI resource lookups
+ * @param catalinaContext The Catalina context for configuration
+ * @param containerClassLoader The container class loader
+ */
public DefaultInstanceManager(Context context, Map<String,Map<String,String>> injectionMap,
org.apache.catalina.Context catalinaContext, ClassLoader containerClassLoader) {
classLoader = catalinaContext.getLoader().getClassLoader();
@@ -452,6 +487,14 @@ public class DefaultInstanceManager implements InstanceManager {
}
+ /**
+ * Load a class, performing a privileged check if necessary.
+ *
+ * @param className The name of the class to load
+ * @param classLoader The class loader to use
+ * @return the loaded class
+ * @throws ClassNotFoundException if the class cannot be found
+ */
protected Class<?> loadClassMaybePrivileged(final String className, final ClassLoader classLoader)
throws ClassNotFoundException {
Class<?> clazz;
@@ -472,6 +515,14 @@ public class DefaultInstanceManager implements InstanceManager {
return clazz;
}
+ /**
+ * Load a class using the appropriate class loader.
+ *
+ * @param className The name of the class to load
+ * @param classLoader The class loader to use
+ * @return the loaded class
+ * @throws ClassNotFoundException if the class cannot be found
+ */
protected Class<?> loadClass(String className, ClassLoader classLoader) throws ClassNotFoundException {
if (className.startsWith("org.apache.catalina")) {
return containerClassLoader.loadClass(className);
diff --git a/java/org/apache/catalina/core/FrameworkListener.java b/java/org/apache/catalina/core/FrameworkListener.java
index e454d0886a..5ea43c5ca0 100644
--- a/java/org/apache/catalina/core/FrameworkListener.java
+++ b/java/org/apache/catalina/core/FrameworkListener.java
@@ -35,7 +35,16 @@ import org.apache.catalina.Service;
* listener on all contexts. This is an alternative to adding a Listener in context.xml with more flexibility.
*/
public abstract class FrameworkListener implements LifecycleListener, ContainerListener {
+ /**
+ * Creates a new FrameworkListener instance.
+ */
+ public FrameworkListener() {
+ // Default constructor
+ }
+ /**
+ * Map of context to their associated lifecycle listeners.
+ */
protected final ConcurrentHashMap<Context,LifecycleListener> contextListeners = new ConcurrentHashMap<>();
/**
@@ -66,6 +75,11 @@ public abstract class FrameworkListener implements LifecycleListener, ContainerL
}
}
+ /**
+ * Registers listeners on all engines of the given server.
+ *
+ * @param server The server to register listeners for
+ */
protected void registerListenersForServer(Server server) {
for (Service service : server.findServices()) {
Engine engine = service.getContainer();
@@ -76,6 +90,11 @@ public abstract class FrameworkListener implements LifecycleListener, ContainerL
}
}
+ /**
+ * Registers listeners on all hosts of the given engine.
+ *
+ * @param engine The engine to register listeners for
+ */
protected void registerListenersForEngine(Engine engine) {
for (Container hostContainer : engine.findChildren()) {
Host host = (Host) hostContainer;
@@ -84,6 +103,11 @@ public abstract class FrameworkListener implements LifecycleListener, ContainerL
}
}
+ /**
+ * Registers listeners on all contexts of the given host.
+ *
+ * @param host The host to register listeners for
+ */
protected void registerListenersForHost(Host host) {
for (Container contextContainer : host.findChildren()) {
Context context = (Context) contextContainer;
@@ -91,12 +115,22 @@ public abstract class FrameworkListener implements LifecycleListener, ContainerL
}
}
+ /**
+ * Creates and registers a lifecycle listener for the given context.
+ *
+ * @param context The context to register a listener for
+ */
protected void registerContextListener(Context context) {
LifecycleListener listener = createLifecycleListener(context);
contextListeners.put(context, listener);
context.addLifecycleListener(listener);
}
+ /**
+ * Processes the addition of a child container by registering appropriate listeners.
+ *
+ * @param child The child container that was added
+ */
protected void processContainerAddChild(Container child) {
if (child instanceof Context) {
registerContextListener((Context) child);
@@ -107,6 +141,11 @@ public abstract class FrameworkListener implements LifecycleListener, ContainerL
}
}
+ /**
+ * Processes the removal of a child container by unregistering appropriate listeners.
+ *
+ * @param child The child container that was removed
+ */
protected void processContainerRemoveChild(Container child) {
if (child instanceof Context) {
LifecycleListener listener = contextListeners.remove(child);
diff --git a/java/org/apache/catalina/core/JniLifecycleListener.java b/java/org/apache/catalina/core/JniLifecycleListener.java
index d1f3e797e0..b07d823018 100644
--- a/java/org/apache/catalina/core/JniLifecycleListener.java
+++ b/java/org/apache/catalina/core/JniLifecycleListener.java
@@ -35,7 +35,17 @@ import org.apache.tomcat.util.res.StringManager;
*/
public class JniLifecycleListener implements LifecycleListener {
+ /**
+ * Constructs a new JniLifecycleListener.
+ */
+ public JniLifecycleListener() {
+ }
+
private static final Log log = LogFactory.getLog(JniLifecycleListener.class);
+
+ /**
+ * StringManager for this class.
+ */
protected static final StringManager sm = StringManager.getManager(JniLifecycleListener.class);
private String libraryName = "";
@@ -58,6 +68,11 @@ public class JniLifecycleListener implements LifecycleListener {
}
}
+ /**
+ * Set the name of the library to load.
+ *
+ * @param libraryName the library name
+ */
public void setLibraryName(String libraryName) {
if (!this.libraryPath.isEmpty()) {
@@ -67,10 +82,20 @@ public class JniLifecycleListener implements LifecycleListener {
this.libraryName = libraryName;
}
+ /**
+ * Get the name of the library to load.
+ *
+ * @return the library name
+ */
public String getLibraryName() {
return libraryName;
}
+ /**
+ * Set the path of the library to load.
+ *
+ * @param libraryPath the library path
+ */
public void setLibraryPath(String libraryPath) {
if (!this.libraryName.isEmpty()) {
@@ -80,6 +105,11 @@ public class JniLifecycleListener implements LifecycleListener {
this.libraryPath = libraryPath;
}
+ /**
+ * Get the path of the library to load.
+ *
+ * @return the library path
+ */
public String getLibraryPath() {
return libraryPath;
}
diff --git a/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java b/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
index 839e70c932..554d7e2c8a 100644
--- a/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
+++ b/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
@@ -45,6 +45,12 @@ import org.apache.tomcat.util.res.StringManager;
*/
public class JreMemoryLeakPreventionListener implements LifecycleListener {
+ /**
+ * Constructs a new JreMemoryLeakPreventionListener.
+ */
+ public JreMemoryLeakPreventionListener() {
+ }
+
private static final Log log = LogFactory.getLog(JreMemoryLeakPreventionListener.class);
private static final StringManager sm = StringManager.getManager(JreMemoryLeakPreventionListener.class);
@@ -55,10 +61,20 @@ public class JreMemoryLeakPreventionListener implements LifecycleListener {
*/
private boolean appContextProtection = false;
+ /**
+ * Get the app context protection flag.
+ *
+ * @return the app context protection flag
+ */
public boolean isAppContextProtection() {
return appContextProtection;
}
+ /**
+ * Set the app context protection flag.
+ *
+ * @param appContextProtection the flag to set
+ */
public void setAppContextProtection(boolean appContextProtection) {
this.appContextProtection = appContextProtection;
}
@@ -69,10 +85,20 @@ public class JreMemoryLeakPreventionListener implements LifecycleListener {
*/
private boolean urlCacheProtection = true;
+ /**
+ * Get the URL cache protection flag.
+ *
+ * @return the URL cache protection flag
+ */
public boolean isUrlCacheProtection() {
return urlCacheProtection;
}
+ /**
+ * Set the URL cache protection flag.
+ *
+ * @param urlCacheProtection the flag to set
+ */
public void setUrlCacheProtection(boolean urlCacheProtection) {
this.urlCacheProtection = urlCacheProtection;
}
@@ -84,10 +110,20 @@ public class JreMemoryLeakPreventionListener implements LifecycleListener {
*/
private boolean driverManagerProtection = true;
+ /**
+ * Get the DriverManager protection flag.
+ *
+ * @return the DriverManager protection flag
+ */
public boolean isDriverManagerProtection() {
return driverManagerProtection;
}
+ /**
+ * Set the DriverManager protection flag.
+ *
+ * @param driverManagerProtection the flag to set
+ */
public void setDriverManagerProtection(boolean driverManagerProtection) {
this.driverManagerProtection = driverManagerProtection;
}
@@ -99,10 +135,20 @@ public class JreMemoryLeakPreventionListener implements LifecycleListener {
*/
private String classesToInitialize = null;
+ /**
+ * Get the classes to initialize.
+ *
+ * @return the classes to initialize
+ */
public String getClassesToInitialize() {
return classesToInitialize;
}
+ /**
+ * Set the classes to initialize.
+ *
+ * @param classesToInitialize the classes to initialize
+ */
public void setClassesToInitialize(String classesToInitialize) {
this.classesToInitialize = classesToInitialize;
}
@@ -113,10 +159,20 @@ public class JreMemoryLeakPreventionListener implements LifecycleListener {
*/
private boolean initSeedGenerator = false;
+ /**
+ * Get the init seed generator flag.
+ *
+ * @return the init seed generator flag
+ */
public boolean getInitSeedGenerator() {
return this.initSeedGenerator;
}
+ /**
+ * Set the init seed generator flag.
+ *
+ * @param initSeedGenerator the flag to set
+ */
public void setInitSeedGenerator(boolean initSeedGenerator) {
this.initSeedGenerator = initSeedGenerator;
}
diff --git a/java/org/apache/catalina/filters/AddDefaultCharsetFilter.java b/java/org/apache/catalina/filters/AddDefaultCharsetFilter.java
index 6c98bbdbd4..45a4e1040a 100644
--- a/java/org/apache/catalina/filters/AddDefaultCharsetFilter.java
+++ b/java/org/apache/catalina/filters/AddDefaultCharsetFilter.java
@@ -43,6 +43,9 @@ import org.apache.juli.logging.LogFactory;
*/
public class AddDefaultCharsetFilter extends FilterBase {
+ /** Constructs a new AddDefaultCharsetFilter. */
+ public AddDefaultCharsetFilter() {}
+
// Log must be non-static as loggers are created per class-loader and this
// Filter may be used in multiple class loaders
private final Log log = LogFactory.getLog(AddDefaultCharsetFilter.class); // must not be static
@@ -51,6 +54,11 @@ public class AddDefaultCharsetFilter extends FilterBase {
private String encoding;
+ /**
+ * Sets the character encoding to use.
+ *
+ * @param encoding The character encoding
+ */
public void setEncoding(String encoding) {
this.encoding = encoding;
}
@@ -92,6 +100,12 @@ public class AddDefaultCharsetFilter extends FilterBase {
private String encoding;
+ /**
+ * Constructs a new ResponseWrapper.
+ *
+ * @param response The HTTP servlet response to wrap
+ * @param encoding The character encoding to use
+ */
public ResponseWrapper(HttpServletResponse response, String encoding) {
super(response);
this.encoding = encoding;
diff --git a/java/org/apache/catalina/filters/Constants.java b/java/org/apache/catalina/filters/Constants.java
index 350289b7be..6cc5bbe3e6 100644
--- a/java/org/apache/catalina/filters/Constants.java
+++ b/java/org/apache/catalina/filters/Constants.java
@@ -23,6 +23,12 @@ import org.apache.tomcat.util.http.Method;
*/
public final class Constants {
+ /**
+ * Prevents instantiation.
+ */
+ private Constants() {
+ }
+
/**
* The session attribute key under which the CSRF nonce cache will be stored.
*/
@@ -46,10 +52,19 @@ public final class Constants {
@Deprecated
public static final String METHOD_GET = Method.GET;
+ /**
+ * The HTTP header name used to carry the CSRF nonce in REST requests.
+ */
public static final String CSRF_REST_NONCE_HEADER_NAME = "X-CSRF-Token";
+ /**
+ * The fetch mode value for the CSRF REST nonce header.
+ */
public static final String CSRF_REST_NONCE_HEADER_FETCH_VALUE = "Fetch";
+ /**
+ * The required mode value for the CSRF REST nonce header.
+ */
public static final String CSRF_REST_NONCE_HEADER_REQUIRED_VALUE = "Required";
/**
diff --git a/java/org/apache/catalina/filters/CorsFilter.java b/java/org/apache/catalina/filters/CorsFilter.java
index 42b3221491..f5cd51d450 100644
--- a/java/org/apache/catalina/filters/CorsFilter.java
+++ b/java/org/apache/catalina/filters/CorsFilter.java
@@ -81,6 +81,12 @@ public class CorsFilter extends GenericFilter {
private transient Log log = LogFactory.getLog(CorsFilter.class); // must not be static
+ /**
+ * Default constructor.
+ */
+ public CorsFilter() {
+ }
+
/**
* A {@link Collection} of origins consisting of zero or more origins that are allowed access to the resource.
diff --git a/java/org/apache/catalina/filters/CsrfPreventionFilter.java b/java/org/apache/catalina/filters/CsrfPreventionFilter.java
index f97bf65817..b9a86c82c0 100644
--- a/java/org/apache/catalina/filters/CsrfPreventionFilter.java
+++ b/java/org/apache/catalina/filters/CsrfPreventionFilter.java
@@ -65,6 +65,12 @@ import org.apache.tomcat.util.http.Method;
*/
public class CsrfPreventionFilter extends CsrfPreventionFilterBase {
+ /**
+ * Default constructor.
+ */
+ public CsrfPreventionFilter() {
+ }
+
/**
* The default set of URL patterns for which nonces will not be appended.
*/
@@ -234,6 +240,12 @@ public class CsrfPreventionFilter extends CsrfPreventionFilterBase {
private final ServletContext context;
private final Predicate<String> predicate;
+ /**
+ * Construct a new MimePredicate.
+ *
+ * @param context The servlet context
+ * @param predicate The delegate predicate for matching MIME types
+ */
public MimePredicate(ServletContext context, Predicate<String> predicate) {
this.context = context;
this.predicate = predicate;
@@ -248,6 +260,11 @@ public class CsrfPreventionFilter extends CsrfPreventionFilterBase {
return predicate.test(mimeType);
}
+ /**
+ * Get the delegate predicate.
+ *
+ * @return The delegate predicate
+ */
public Predicate<String> getPredicate() {
return predicate;
}
@@ -259,6 +276,11 @@ public class CsrfPreventionFilter extends CsrfPreventionFilterBase {
protected static class PrefixPredicate implements Predicate<String> {
private final String prefix;
+ /**
+ * Construct a new PrefixPredicate.
+ *
+ * @param prefix The prefix to match
+ */
public PrefixPredicate(String prefix) {
this.prefix = prefix;
}
@@ -275,6 +297,11 @@ public class CsrfPreventionFilter extends CsrfPreventionFilterBase {
protected static class SuffixPredicate implements Predicate<String> {
private final String suffix;
+ /**
+ * Construct a new SuffixPredicate.
+ *
+ * @param suffix The suffix to match
+ */
public SuffixPredicate(String suffix) {
this.suffix = suffix;
}
@@ -291,6 +318,11 @@ public class CsrfPreventionFilter extends CsrfPreventionFilterBase {
protected static class PatternPredicate implements Predicate<String> {
private final Pattern pattern;
+ /**
+ * Construct a new PatternPredicate.
+ *
+ * @param regex The regular expression pattern to match
+ */
public PatternPredicate(String regex) {
this.pattern = Pattern.compile(regex);
}
@@ -446,6 +478,13 @@ public class CsrfPreventionFilter extends CsrfPreventionFilterBase {
return isEnforce();
}
+ /**
+ * Determine whether the nonce check should be skipped for the given request.
+ *
+ * @param request The HTTP servlet request
+ *
+ * @return {@code true} if the nonce check should be skipped
+ */
protected boolean skipNonceCheck(HttpServletRequest request) {
if (!Method.GET.equals(request.getMethod())) {
return false;
@@ -530,12 +569,23 @@ public class CsrfPreventionFilter extends CsrfPreventionFilterBase {
return nonceCache;
}
+ /**
+ * Wrapper for {@link HttpServletResponse} that adds CSRF nonces to encoded URLs.
+ */
protected static class CsrfResponseWrapper extends HttpServletResponseWrapper {
private final String nonceRequestParameterName;
private final String nonce;
private final Collection<Predicate<String>> noNoncePatterns;
+ /**
+ * Construct a new CsrfResponseWrapper.
+ *
+ * @param response The wrapped response
+ * @param nonceRequestParameterName The name of the nonce request parameter
+ * @param nonce The current nonce value
+ * @param noNoncePatterns The patterns for URLs that should not have nonces added
+ */
public CsrfResponseWrapper(HttpServletResponse response, String nonceRequestParameterName, String nonce,
Collection<Predicate<String>> noNoncePatterns) {
super(response);
@@ -699,9 +749,26 @@ public class CsrfPreventionFilter extends CsrfPreventionFilterBase {
}
+ /**
+ * Interface for a cache of nonces used for CSRF protection.
+ *
+ * @param <T> The type of nonce stored in the cache
+ */
protected interface NonceCache<T> extends Serializable {
+ /**
+ * Add a nonce to the cache.
+ *
+ * @param nonce The nonce to add
+ */
void add(T nonce);
+ /**
+ * Check if the cache contains the given nonce.
+ *
+ * @param nonce The nonce to check
+ *
+ * @return {@code true} if the nonce is in the cache
+ */
boolean contains(T nonce);
}
@@ -720,6 +787,11 @@ public class CsrfPreventionFilter extends CsrfPreventionFilterBase {
// implementation is only concerned with the keys.
private final Map<T,T> cache;
+ /**
+ * Construct a new LruCache.
+ *
+ * @param cacheSize The maximum number of entries in the cache
+ */
public LruCache(final int cacheSize) {
cache = new LinkedHashMap<>() {
private static final long serialVersionUID = 1L;
diff --git a/java/org/apache/catalina/filters/CsrfPreventionFilterBase.java b/java/org/apache/catalina/filters/CsrfPreventionFilterBase.java
index f45a56f314..15d2e00c67 100644
--- a/java/org/apache/catalina/filters/CsrfPreventionFilterBase.java
+++ b/java/org/apache/catalina/filters/CsrfPreventionFilterBase.java
@@ -27,8 +27,17 @@ import jakarta.servlet.http.HttpServletResponse;
import org.apache.juli.logging.Log;
import org.apache.juli.logging.LogFactory;
+/**
+ * Base class for CSRF prevention filters.
+ */
public abstract class CsrfPreventionFilterBase extends FilterBase {
+ /**
+ * Default constructor.
+ */
+ public CsrfPreventionFilterBase() {
+ }
+
// Log must be non-static as loggers are created per class-loader and this
// Filter may be used in multiple class loaders
private final Log log = LogFactory.getLog(CsrfPreventionFilterBase.class); // must not be static
@@ -45,7 +54,9 @@ public abstract class CsrfPreventionFilterBase extends FilterBase {
}
/**
- * @return response status code that is used to reject denied request.
+ * Get the HTTP status code used to reject denied requests.
+ *
+ * @return The response status code that is used to reject denied requests
*/
public int getDenyStatus() {
return denyStatus;
@@ -123,6 +134,13 @@ public abstract class CsrfPreventionFilterBase extends FilterBase {
return buffer.toString();
}
+ /**
+ * Get the requested path from the given request.
+ *
+ * @param request The HTTP servlet request
+ *
+ * @return The requested path
+ */
protected String getRequestedPath(HttpServletRequest request) {
String path = request.getServletPath();
if (request.getPathInfo() != null) {
diff --git a/java/org/apache/catalina/filters/ExpiresFilter.java b/java/org/apache/catalina/filters/ExpiresFilter.java
index 774bbe0d53..829b43f67b 100644
--- a/java/org/apache/catalina/filters/ExpiresFilter.java
+++ b/java/org/apache/catalina/filters/ExpiresFilter.java
@@ -414,6 +414,12 @@ import org.apache.tomcat.util.http.Method;
*/
public class ExpiresFilter extends FilterBase {
+ /**
+ * Creates a new ExpiresFilter instance.
+ */
+ public ExpiresFilter() {
+ }
+
/**
* Duration composed of an {@link #amount} and a {@link #unit}
*/
@@ -429,10 +435,20 @@ public class ExpiresFilter extends FilterBase {
this.unit = unit;
}
+ /**
+ * Returns the magnitude of this duration.
+ *
+ * @return the amount
+ */
public int getAmount() {
return amount;
}
+ /**
+ * Returns the unit of this duration.
+ *
+ * @return the unit
+ */
public DurationUnit getUnit() {
return unit;
}
@@ -447,12 +463,19 @@ public class ExpiresFilter extends FilterBase {
* Duration unit
*/
public enum DurationUnit {
+ /** Day duration unit. */
DAY(Calendar.DAY_OF_YEAR),
+ /** Hour duration unit. */
HOUR(Calendar.HOUR),
+ /** Minute duration unit. */
MINUTE(Calendar.MINUTE),
+ /** Month duration unit. */
MONTH(Calendar.MONTH),
+ /** Second duration unit. */
SECOND(Calendar.SECOND),
+ /** Week duration unit. */
WEEK(Calendar.WEEK_OF_YEAR),
+ /** Year duration unit. */
YEAR(Calendar.YEAR);
private final int calendarField;
@@ -461,6 +484,11 @@ public class ExpiresFilter extends FilterBase {
this.calendarField = calendarField;
}
+ /**
+ * Returns the calendar field corresponding to this duration unit.
+ *
+ * @return the calendar field value
+ */
public int getCalendardField() {
return calendarField;
}
@@ -492,10 +520,20 @@ public class ExpiresFilter extends FilterBase {
this.durations = durations;
}
+ /**
+ * Returns the list of durations for this configuration.
+ *
+ * @return the list of durations
+ */
public List<Duration> getDurations() {
return durations;
}
+ /**
+ * Returns the starting point for this configuration.
+ *
+ * @return the starting point
+ */
public StartingPoint getStartingPoint() {
return startingPoint;
}
@@ -512,7 +550,9 @@ public class ExpiresFilter extends FilterBase {
* {@link StartingPoint#LAST_MODIFICATION_TIME}).
*/
public enum StartingPoint {
+ /** Expiration relative to the access time. */
ACCESS_TIME,
+ /** Expiration relative to the last modification time. */
LAST_MODIFICATION_TIME
}
@@ -552,6 +592,12 @@ public class ExpiresFilter extends FilterBase {
*/
private boolean writeResponseBodyStarted;
+ /**
+ * Creates a new XHttpServletResponse wrapping the given response.
+ *
+ * @param request the HTTP servlet request
+ * @param response the HTTP servlet response to wrap
+ */
public XHttpServletResponse(HttpServletRequest request, HttpServletResponse response) {
super(response);
this.request = request;
@@ -578,10 +624,20 @@ public class ExpiresFilter extends FilterBase {
}
}
+ /**
+ * Returns the Cache-Control header value.
+ *
+ * @return the Cache-Control header value, or {@code null} if not set
+ */
public String getCacheControlHeader() {
return cacheControlHeader;
}
+ /**
+ * Returns the Last-Modified header value as a timestamp.
+ *
+ * @return the Last-Modified header timestamp
+ */
public long getLastModifiedHeader() {
return lastModifiedHeader;
}
@@ -602,10 +658,20 @@ public class ExpiresFilter extends FilterBase {
return printWriter;
}
+ /**
+ * Checks if the Last-Modified header has been set.
+ *
+ * @return {@code true} if the Last-Modified header has been set
+ */
public boolean isLastModifiedHeaderSet() {
return lastModifiedHeaderSet;
}
+ /**
+ * Checks if writing the response body has started.
+ *
+ * @return {@code true} if writing the response body has started
+ */
public boolean isWriteResponseBodyStarted() {
return writeResponseBodyStarted;
}
@@ -635,6 +701,11 @@ public class ExpiresFilter extends FilterBase {
}
}
+ /**
+ * Sets whether writing the response body has started.
+ *
+ * @param writeResponseBodyStarted {@code true} if writing has started
+ */
public void setWriteResponseBodyStarted(boolean writeResponseBodyStarted) {
this.writeResponseBodyStarted = writeResponseBodyStarted;
}
@@ -650,6 +721,13 @@ public class ExpiresFilter extends FilterBase {
private final XHttpServletResponse response;
+ /**
+ * Creates a new XPrintWriter wrapping the given writer.
+ *
+ * @param out the PrintWriter to wrap
+ * @param request the HTTP servlet request
+ * @param response the wrapped HTTP servlet response
+ */
public XPrintWriter(PrintWriter out, HttpServletRequest request, XHttpServletResponse response) {
super(out);
this.out = out;
@@ -863,6 +941,13 @@ public class ExpiresFilter extends FilterBase {
private final ServletOutputStream servletOutputStream;
+ /**
+ * Creates a new XServletOutputStream wrapping the given stream.
+ *
+ * @param servletOutputStream the ServletOutputStream to wrap
+ * @param request the HTTP servlet request
+ * @param response the wrapped HTTP servlet response
+ */
public XServletOutputStream(ServletOutputStream servletOutputStream, HttpServletRequest request,
XHttpServletResponse response) {
super();
@@ -1104,28 +1189,34 @@ public class ExpiresFilter extends FilterBase {
}
/**
+ * Checks if the given string is null or empty.
+ *
* @param str The String to check
*
- * @return {@code true} if the given {@code str} is {@code null} or has a zero characters length.
+ * @return {@code true} if the given {@code str} is {@code null} or has a zero characters length
*/
protected static boolean isEmpty(String str) {
return str == null || str.isEmpty();
}
/**
+ * Checks if the given string is not null and not empty.
+ *
* @param str The String to check
*
- * @return {@code true} if the given {@code str} has at least one character (can be a whitespace).
+ * @return {@code true} if the given {@code str} has at least one character (can be a whitespace)
*/
protected static boolean isNotEmpty(String str) {
return !isEmpty(str);
}
/**
- * @return {@code true} if the given {@code string} starts with the given {@code prefix} ignoring case.
+ * Checks if the given string starts with the given prefix, ignoring case.
*
* @param string can be {@code null}
* @param prefix can be {@code null}
+ *
+ * @return {@code true} if the given {@code string} starts with the given {@code prefix} ignoring case
*/
protected static boolean startsWithIgnoreCase(String string, String prefix) {
if (string == null || prefix == null) {
@@ -1139,12 +1230,14 @@ public class ExpiresFilter extends FilterBase {
}
/**
- * @return the subset of the given {@code str} that is before the first occurrence of the given {@code separator}.
- * Return {@code null} if the given {@code str} or the given {@code separator} is null. Return and empty
- * string if the {@code separator} is empty.
+ * Returns the subset of the given string that is before the first occurrence of the given separator.
+ * Returns {@code null} if the given {@code str} or the given {@code separator} is null. Returns an empty
+ * string if the {@code separator} is empty.
*
* @param str can be {@code null}
* @param separator can be {@code null}
+ *
+ * @return the subset before the separator, or {@code null} if either argument is null
*/
protected static String substringBefore(String str, String separator) {
if (str == null || str.isEmpty() || separator == null) {
@@ -1203,14 +1296,29 @@ public class ExpiresFilter extends FilterBase {
}
}
+ /**
+ * Returns the default expiration configuration.
+ *
+ * @return the default expiration configuration, or {@code null} if none
+ */
public ExpiresConfiguration getDefaultExpiresConfiguration() {
return defaultExpiresConfiguration;
}
+ /**
+ * Returns the excluded response status codes as a comma-delimited string.
+ *
+ * @return the excluded status codes
+ */
public String getExcludedResponseStatusCodes() {
return intsToCommaDelimitedString(excludedResponseStatusCodes);
}
+ /**
+ * Returns the excluded response status codes as an integer array.
+ *
+ * @return the excluded status codes as integers
+ */
public int[] getExcludedResponseStatusCodesAsInts() {
return excludedResponseStatusCodes;
}
@@ -1351,6 +1459,11 @@ public class ExpiresFilter extends FilterBase {
return calendar.getTime();
}
+ /**
+ * Returns the map of expiration configurations by content type.
+ *
+ * @return the map of content type to expiration configuration
+ */
public Map<String,ExpiresConfiguration> getExpiresConfigurationByContentType() {
return expiresConfigurationByContentType;
}
@@ -1589,14 +1702,29 @@ public class ExpiresFilter extends FilterBase {
return new ExpiresConfiguration(startingPoint, durations);
}
+ /**
+ * Sets the default expiration configuration.
+ *
+ * @param defaultExpiresConfiguration The default expiration configuration
+ */
public void setDefaultExpiresConfiguration(ExpiresConfiguration defaultExpiresConfiguration) {
this.defaultExpiresConfiguration = defaultExpiresConfiguration;
}
+ /**
+ * Sets the excluded response status codes.
+ *
+ * @param excludedResponseStatusCodes The status codes to exclude
+ */
public void setExcludedResponseStatusCodes(int[] excludedResponseStatusCodes) {
this.excludedResponseStatusCodes = excludedResponseStatusCodes;
}
+ /**
+ * Sets the expiration configurations by content type.
+ *
+ * @param expiresConfigurationByContentType The map of content type to expiration configuration
+ */
public void setExpiresConfigurationByContentType(
Map<String,ExpiresConfiguration> expiresConfigurationByContentType) {
this.expiresConfigurationByContentType = expiresConfigurationByContentType;
diff --git a/java/org/apache/catalina/filters/FilterBase.java b/java/org/apache/catalina/filters/FilterBase.java
index 9207397046..8b9fa362aa 100644
--- a/java/org/apache/catalina/filters/FilterBase.java
+++ b/java/org/apache/catalina/filters/FilterBase.java
@@ -27,12 +27,27 @@ import org.apache.tomcat.util.IntrospectionUtils;
import org.apache.tomcat.util.res.StringManager;
/**
- * Base class for filters that provides generic initialisation and a simple no-op destruction.
- */
+ * Base class for filters that provides generic initialisation and a simple no-op destruction.
+ */
public abstract class FilterBase implements Filter {
+ /**
+ * Default constructor for FilterBase.
+ */
+ public FilterBase() {
+ // Default constructor
+ }
+
+ /**
+ * StringManager for internationalized strings.
+ */
protected static final StringManager sm = StringManager.getManager(FilterBase.class);
+ /**
+ * Returns the logger for this filter.
+ *
+ * @return the logger
+ */
protected abstract Log getLogger();
diff --git a/java/org/apache/catalina/filters/HttpHeaderSecurityFilter.java b/java/org/apache/catalina/filters/HttpHeaderSecurityFilter.java
index b878e0dd1e..aa90d48059 100644
--- a/java/org/apache/catalina/filters/HttpHeaderSecurityFilter.java
+++ b/java/org/apache/catalina/filters/HttpHeaderSecurityFilter.java
@@ -36,6 +36,14 @@ import org.apache.juli.logging.LogFactory;
*/
public class HttpHeaderSecurityFilter extends FilterBase {
+ /**
+ * Creates a new instance of the filter.
+ */
+ public HttpHeaderSecurityFilter() {
+ super();
+ }
+
+
// Log must be non-static as loggers are created per class-loader and this
// Filter may be used in multiple class loaders
private final Log log = LogFactory.getLog(HttpHeaderSecurityFilter.class); // must not be static
@@ -144,61 +152,121 @@ public class HttpHeaderSecurityFilter extends FilterBase {
}
+ /**
+ * Returns whether HSTS is enabled.
+ *
+ * @return {@code true} if HSTS is enabled
+ */
public boolean isHstsEnabled() {
return hstsEnabled;
}
+ /**
+ * Enables or disables HSTS.
+ *
+ * @param hstsEnabled {@code true} to enable HSTS
+ */
public void setHstsEnabled(boolean hstsEnabled) {
this.hstsEnabled = hstsEnabled;
}
+ /**
+ * Returns the maximum age in seconds for the HSTS header.
+ *
+ * @return the maximum age in seconds
+ */
public int getHstsMaxAgeSeconds() {
return hstsMaxAgeSeconds;
}
+ /**
+ * Sets the maximum age in seconds for the HSTS header.
+ *
+ * @param hstsMaxAgeSeconds the maximum age in seconds
+ */
public void setHstsMaxAgeSeconds(int hstsMaxAgeSeconds) {
this.hstsMaxAgeSeconds = Math.max(hstsMaxAgeSeconds, 0);
}
+ /**
+ * Returns whether subdomains are included in the HSTS header.
+ *
+ * @return {@code true} if subdomains are included
+ */
public boolean isHstsIncludeSubDomains() {
return hstsIncludeSubDomains;
}
+ /**
+ * Sets whether subdomains should be included in the HSTS header.
+ *
+ * @param hstsIncludeSubDomains {@code true} to include subdomains
+ */
public void setHstsIncludeSubDomains(boolean hstsIncludeSubDomains) {
this.hstsIncludeSubDomains = hstsIncludeSubDomains;
}
+ /**
+ * Returns whether the preload directive is included in the HSTS header.
+ *
+ * @return {@code true} if preload is enabled
+ */
public boolean isHstsPreload() {
return hstsPreload;
}
+ /**
+ * Sets whether the preload directive should be included in the HSTS header.
+ *
+ * @param hstsPreload {@code true} to include preload
+ */
public void setHstsPreload(boolean hstsPreload) {
this.hstsPreload = hstsPreload;
}
+ /**
+ * Returns whether anti-click-jacking protection is enabled.
+ *
+ * @return {@code true} if anti-click-jacking is enabled
+ */
public boolean isAntiClickJackingEnabled() {
return antiClickJackingEnabled;
}
+ /**
+ * Enables or disables anti-click-jacking protection.
+ *
+ * @param antiClickJackingEnabled {@code true} to enable anti-click-jacking
+ */
public void setAntiClickJackingEnabled(boolean antiClickJackingEnabled) {
this.antiClickJackingEnabled = antiClickJackingEnabled;
}
+ /**
+ * Returns the X-Frame-Options value.
+ *
+ * @return the X-Frame-Options value
+ */
public String getAntiClickJackingOption() {
return antiClickJackingOption.toString();
}
+ /**
+ * Sets the X-Frame-Options value for click-jacking protection.
+ *
+ * @param antiClickJackingOption the X-Frame-Options value (DENY, SAMEORIGIN, or ALLOW-FROM)
+ */
public void setAntiClickJackingOption(String antiClickJackingOption) {
for (XFrameOption option : XFrameOption.values()) {
if (option.getHeaderValue().equalsIgnoreCase(antiClickJackingOption)) {
@@ -211,21 +279,41 @@ public class HttpHeaderSecurityFilter extends FilterBase {
}
+ /**
+ * Returns the URI used with the ALLOW_FROM X-Frame-Options directive.
+ *
+ * @return the ALLOW_FROM URI
+ */
public String getAntiClickJackingUri() {
return antiClickJackingUri.toString();
}
+ /**
+ * Returns whether content type sniffing protection is enabled.
+ *
+ * @return {@code true} if content type sniffing protection is enabled
+ */
public boolean isBlockContentTypeSniffingEnabled() {
return blockContentTypeSniffingEnabled;
}
+ /**
+ * Enables or disables content type sniffing protection.
+ *
+ * @param blockContentTypeSniffingEnabled {@code true} to enable protection
+ */
public void setBlockContentTypeSniffingEnabled(boolean blockContentTypeSniffingEnabled) {
this.blockContentTypeSniffingEnabled = blockContentTypeSniffingEnabled;
}
+ /**
+ * Sets the URI used with the ALLOW_FROM X-Frame-Options directive.
+ *
+ * @param antiClickJackingUri the URI for ALLOW_FROM
+ */
public void setAntiClickJackingUri(String antiClickJackingUri) {
URI uri;
try {
diff --git a/java/org/apache/catalina/ha/ClusterDeployer.java b/java/org/apache/catalina/ha/ClusterDeployer.java
index 6c74e71d16..aacf7d5c16 100644
--- a/java/org/apache/catalina/ha/ClusterDeployer.java
+++ b/java/org/apache/catalina/ha/ClusterDeployer.java
@@ -80,7 +80,9 @@ public interface ClusterDeployer extends ChannelListener {
void backgroundProcess();
/**
- * @return the cluster the is associated with
+ * Returns the cluster associated with this deployer.
+ *
+ * @return the cluster
*/
CatalinaCluster getCluster();
diff --git a/java/org/apache/catalina/ha/ClusterListener.java b/java/org/apache/catalina/ha/ClusterListener.java
index 1e844ff79a..a68290f9ce 100644
--- a/java/org/apache/catalina/ha/ClusterListener.java
+++ b/java/org/apache/catalina/ha/ClusterListener.java
@@ -33,20 +33,36 @@ public abstract class ClusterListener implements ChannelListener {
// --Instance Variables--------------------------------------
+ /**
+ * The cluster associated with this listener.
+ */
protected CatalinaCluster cluster = null;
// --Constructor---------------------------------------------
+ /**
+ * Default constructor for ClusterListener.
+ */
public ClusterListener() {
// NO-OP
}
// --Instance Getters/Setters--------------------------------
+ /**
+ * Returns the cluster associated with this listener.
+ *
+ * @return the cluster
+ */
public CatalinaCluster getCluster() {
return cluster;
}
+ /**
+ * Sets the cluster associated with this listener.
+ *
+ * @param cluster the cluster
+ */
public void setCluster(CatalinaCluster cluster) {
if (log.isTraceEnabled()) {
if (cluster != null) {
diff --git a/java/org/apache/catalina/ha/ClusterManager.java b/java/org/apache/catalina/ha/ClusterManager.java
index e5ff35e59e..f4fb536442 100644
--- a/java/org/apache/catalina/ha/ClusterManager.java
+++ b/java/org/apache/catalina/ha/ClusterManager.java
@@ -75,6 +75,8 @@ public interface ClusterManager extends Manager {
void setName(String name);
/**
+ * Returns the cluster associated with this manager.
+ *
* @return the cluster associated with this manager
*/
CatalinaCluster getCluster();
@@ -111,11 +113,15 @@ public interface ClusterManager extends Manager {
ReplicationStream getReplicationStream(byte[] data, int offset, int length) throws IOException;
/**
+ * Returns whether listeners are notified on replication.
+ *
* @return {@code true} if listeners are notified on replication
*/
boolean isNotifyListenersOnReplication();
/**
+ * Creates a clone of this manager from a template configuration.
+ *
* @return a clone of a template manager configuration
*/
ClusterManager cloneFromTemplate();
diff --git a/java/org/apache/catalina/ha/ClusterMessage.java b/java/org/apache/catalina/ha/ClusterMessage.java
index 14bf5e3e43..383c6624a2 100644
--- a/java/org/apache/catalina/ha/ClusterMessage.java
+++ b/java/org/apache/catalina/ha/ClusterMessage.java
@@ -20,9 +20,14 @@ import java.io.Serializable;
import org.apache.catalina.tribes.Member;
+/**
+ * Interface for messages exchanged between cluster nodes.
+ */
public interface ClusterMessage extends Serializable {
/**
- * @return the member associated with the message
+ * Returns the member associated with this message.
+ *
+ * @return the member address
*/
Member getAddress();
@@ -34,12 +39,16 @@ public interface ClusterMessage extends Serializable {
void setAddress(Member member);
/**
- * @return the unique id of the message
+ * Returns the unique identifier for this message.
+ *
+ * @return the unique ID
*/
String getUniqueId();
/**
- * @return the message timestamp
+ * Returns the timestamp of this message.
+ *
+ * @return the timestamp in milliseconds
*/
long getTimestamp();
diff --git a/java/org/apache/catalina/ha/ClusterMessageBase.java b/java/org/apache/catalina/ha/ClusterMessageBase.java
index 794ebd6ed4..a1bd88d17d 100644
--- a/java/org/apache/catalina/ha/ClusterMessageBase.java
+++ b/java/org/apache/catalina/ha/ClusterMessageBase.java
@@ -18,13 +18,26 @@ package org.apache.catalina.ha;
import org.apache.catalina.tribes.Member;
+/**
+ * Base implementation of {@link ClusterMessage} providing common fields and methods
+ * for cluster messages.
+ */
public abstract class ClusterMessageBase implements ClusterMessage {
private static final long serialVersionUID = 1L;
+ /**
+ * The timestamp of this message.
+ */
private long timestamp;
+ /**
+ * The member associated with this message.
+ */
protected transient Member address;
+ /**
+ * Default constructor for ClusterMessageBase.
+ */
public ClusterMessageBase() {
// NO-OP
}
diff --git a/java/org/apache/catalina/ha/ClusterSession.java b/java/org/apache/catalina/ha/ClusterSession.java
index db455b8bcb..8014157acd 100644
--- a/java/org/apache/catalina/ha/ClusterSession.java
+++ b/java/org/apache/catalina/ha/ClusterSession.java
@@ -20,6 +20,9 @@ import jakarta.servlet.http.HttpSession;
import org.apache.catalina.Session;
+/**
+ * Interface for a cluster-aware session that extends both {@link Session} and {@link HttpSession}.
+ */
public interface ClusterSession extends Session, HttpSession {
/**
* returns true if this session is the primary session, if that is the case, the manager can expire it upon timeout.
diff --git a/java/org/apache/catalina/ha/authenticator/ClusterSingleSignOn.java b/java/org/apache/catalina/ha/authenticator/ClusterSingleSignOn.java
index a015538f0b..c8942f1692 100644
--- a/java/org/apache/catalina/ha/authenticator/ClusterSingleSignOn.java
+++ b/java/org/apache/catalina/ha/authenticator/ClusterSingleSignOn.java
@@ -49,6 +49,12 @@ import org.apache.tomcat.util.res.StringManager;
*/
public class ClusterSingleSignOn extends SingleSignOn implements ClusterValve, MapOwner {
+ /**
+ * Default constructor for ClusterSingleSignOn.
+ */
+ public ClusterSingleSignOn() {
+ }
+
private static final StringManager sm = StringManager.getManager(ClusterSingleSignOn.class);
// -------------------------------------------------------------- Properties
@@ -68,10 +74,20 @@ public class ClusterSingleSignOn extends SingleSignOn implements ClusterValve, M
private long rpcTimeout = 15000;
+ /**
+ * Returns the RPC timeout in milliseconds.
+ *
+ * @return the RPC timeout
+ */
public long getRpcTimeout() {
return rpcTimeout;
}
+ /**
+ * Sets the RPC timeout in milliseconds.
+ *
+ * @param rpcTimeout the RPC timeout
+ */
public void setRpcTimeout(long rpcTimeout) {
this.rpcTimeout = rpcTimeout;
}
@@ -79,10 +95,20 @@ public class ClusterSingleSignOn extends SingleSignOn implements ClusterValve, M
private int mapSendOptions = Channel.SEND_OPTIONS_SYNCHRONIZED_ACK | Channel.SEND_OPTIONS_USE_ACK;
+ /**
+ * Returns the map send options.
+ *
+ * @return the map send options
+ */
public int getMapSendOptions() {
return mapSendOptions;
}
+ /**
+ * Sets the map send options.
+ *
+ * @param mapSendOptions the map send options
+ */
public void setMapSendOptions(int mapSendOptions) {
this.mapSendOptions = mapSendOptions;
}
@@ -90,20 +116,40 @@ public class ClusterSingleSignOn extends SingleSignOn implements ClusterValve, M
private boolean terminateOnStartFailure = false;
+ /**
+ * Returns whether to terminate on start failure.
+ *
+ * @return {@code true} if termination on start failure is enabled
+ */
public boolean getTerminateOnStartFailure() {
return terminateOnStartFailure;
}
+ /**
+ * Sets whether to terminate on start failure.
+ *
+ * @param terminateOnStartFailure the new value
+ */
public void setTerminateOnStartFailure(boolean terminateOnStartFailure) {
this.terminateOnStartFailure = terminateOnStartFailure;
}
private long accessTimeout = 5000;
+ /**
+ * Returns the access timeout in milliseconds.
+ *
+ * @return the access timeout
+ */
public long getAccessTimeout() {
return accessTimeout;
}
+ /**
+ * Sets the access timeout in milliseconds.
+ *
+ * @param accessTimeout the access timeout
+ */
public void setAccessTimeout(long accessTimeout) {
this.accessTimeout = accessTimeout;
}
diff --git a/java/org/apache/catalina/ha/authenticator/ClusterSingleSignOnListener.java b/java/org/apache/catalina/ha/authenticator/ClusterSingleSignOnListener.java
index eb9e0e64df..6b4f180c31 100644
--- a/java/org/apache/catalina/ha/authenticator/ClusterSingleSignOnListener.java
+++ b/java/org/apache/catalina/ha/authenticator/ClusterSingleSignOnListener.java
@@ -28,6 +28,11 @@ public class ClusterSingleSignOnListener extends SingleSignOnListener implements
private static final long serialVersionUID = 1L;
+ /**
+ * Creates a new ClusterSingleSignOnListener for the specified SSO identifier.
+ *
+ * @param ssoId the SSO identifier
+ */
public ClusterSingleSignOnListener(String ssoId) {
super(ssoId);
}
diff --git a/java/org/apache/catalina/ha/backend/CollectedInfo.java b/java/org/apache/catalina/ha/backend/CollectedInfo.java
index 3c791eff62..1a937a9a7f 100644
--- a/java/org/apache/catalina/ha/backend/CollectedInfo.java
+++ b/java/org/apache/catalina/ha/backend/CollectedInfo.java
@@ -34,12 +34,22 @@ import org.apache.tomcat.util.res.StringManager;
* what about the bind(IP. port) only IP makes sense (for the moment).
* BTW:v = version :-)
*/
+/**
+ * Listener to provide information to mod_heartbeat.c. Collects connector thread pool
+ * information via JMX to report ready and busy thread counts.
+ */
public class CollectedInfo {
private static final StringManager sm = StringManager.getManager(CollectedInfo.class);
+ /**
+ * The MBean server used to collect information.
+ */
/* Collect info via JMX */
protected MBeanServer mBeanServer = null;
+ /**
+ * The object name of the thread pool MBean.
+ */
protected ObjectName objName = null;
int ready;
@@ -48,10 +58,26 @@ public class CollectedInfo {
int port = 0;
String host = null;
+ /**
+ * Creates a new CollectedInfo instance and initializes it with the specified host and port.
+ *
+ * @param host the host
+ * @param port the port
+ *
+ * @throws Exception if initialization fails
+ */
public CollectedInfo(String host, int port) throws Exception {
init(host, port);
}
+ /**
+ * Initializes the collected info by looking up the thread pool MBean for the given host and port.
+ *
+ * @param host the host (may be null to match any host)
+ * @param port the port (0 to match any port)
+ *
+ * @throws Exception if no matching connector is found
+ */
public void init(String host, int port) throws Exception {
int iport = 0;
String shost = null;
@@ -102,6 +128,11 @@ public class CollectedInfo {
}
+ /**
+ * Refreshes the ready and busy thread counts from the thread pool MBean.
+ *
+ * @throws Exception if not initialized or MBean access fails
+ */
public void refresh() throws Exception {
if (mBeanServer == null || objName == null) {
throw new Exception(sm.getString("collectedInfo.notInitialized"));
diff --git a/java/org/apache/catalina/ha/backend/HeartbeatListener.java b/java/org/apache/catalina/ha/backend/HeartbeatListener.java
index e132e74dce..fde87dfcb4 100644
--- a/java/org/apache/catalina/ha/backend/HeartbeatListener.java
+++ b/java/org/apache/catalina/ha/backend/HeartbeatListener.java
@@ -30,17 +30,41 @@ import org.apache.tomcat.util.res.StringManager;
* what about the bind(IP. port) only IP makes sense (for the moment).
* BTW:v = version :-)
*/
+/**
+ * Lifecycle listener that provides heartbeat information to mod_heartbeat for Apache HTTP Server.
+ */
public class HeartbeatListener implements LifecycleListener {
+ /**
+ * Logger for this listener.
+ */
private static final Log log = LogFactory.getLog(HeartbeatListener.class);
+
+ /**
+ * Constructs a new HeartbeatListener.
+ */
+ public HeartbeatListener() {
+ }
+
+ /**
+ * String manager for this listener.
+ */
private static final StringManager sm = StringManager.getManager(HeartbeatListener.class);
- /* To allow to select the connector */
+ /**
+ * Port of the connector to proxy. Default is 8009.
+ */
protected int port = 8009;
+
+ /**
+ * Host of the connector to proxy.
+ */
protected String host = null;
/**
- * @return the host corresponding to the connector we want to proxy.
+ * Get the host corresponding to the connector we want to proxy.
+ *
+ * @return the host
*/
public String getHost() {
return this.host;
@@ -56,7 +80,9 @@ public class HeartbeatListener implements LifecycleListener {
}
/**
- * @return the port of the connector we want to proxy.
+ * Get the port of the connector we want to proxy.
+ *
+ * @return the port
*/
public int getPort() {
return this.port;
@@ -71,15 +97,27 @@ public class HeartbeatListener implements LifecycleListener {
this.port = port;
}
- /* for multicasting stuff */
- protected String ip = "224.0.1.105"; /* Multicast IP */
- protected int multiport = 23364; /* Multicast Port */
+ /**
+ * Multicast IP address. Default is 224.0.1.105.
+ */
+ protected String ip = "224.0.1.105";
+
+ /**
+ * Multicast port. Default is 23364.
+ */
+ protected int multiport = 23364;
+
+ /**
+ * Time-to-live for multicast packets. Default is 16.
+ */
protected int ttl = 16;
/* corresponding setters and getters */
/**
- * @return the Multicast IP we are using for Multicast
+ * Get the multicast IP address used for sending heartbeat messages.
+ *
+ * @return the multicast IP address
*/
public String getGroup() {
return ip;
@@ -95,7 +133,9 @@ public class HeartbeatListener implements LifecycleListener {
}
/**
- * @return the Multicast Port we are using for Multicast.
+ * Get the multicast port used for sending heartbeat messages.
+ *
+ * @return the multicast port
*/
public int getMultiport() {
return multiport;
@@ -111,7 +151,9 @@ public class HeartbeatListener implements LifecycleListener {
}
/**
- * @return the TTL for Multicast packets.
+ * Get the TTL value used for multicast packets.
+ *
+ * @return the TTL value
*/
public int getTtl() {
return ttl;
@@ -132,7 +174,9 @@ public class HeartbeatListener implements LifecycleListener {
protected String proxyList = null;
/**
- * @return the list of proxies that send us requests.
+ * Get the list of proxies that send requests to this server.
+ *
+ * @return the proxy list in "address:port,address:port" format
*/
public String getProxyList() {
return proxyList;
@@ -154,7 +198,9 @@ public class HeartbeatListener implements LifecycleListener {
protected String proxyURL = "/HeartbeatListener";
/**
- * @return the URL specified in <Location/> for the SetHandler heartbeat.
+ * Get the URL specified in <Location/> for the SetHandler heartbeat in httpd.conf.
+ *
+ * @return the proxy URL
*/
public String getProxyURL() {
return proxyURL;
diff --git a/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java b/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java
index 85a4f39509..51f72a9488 100644
--- a/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java
+++ b/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java
@@ -58,8 +58,14 @@ public class FarmWarDeployer extends ClusterListener implements ClusterDeployer,
private static final StringManager sm = StringManager.getManager(FarmWarDeployer.class);
/*--Instance Variables--------------------------------------*/
+ /**
+ * Whether the deployer has been started.
+ */
protected boolean started = false;
+ /**
+ * Map of file name to factory for in-progress file transfers.
+ */
protected final HashMap<String,FileMessageFactory> fileFactories = new HashMap<>();
/**
@@ -80,8 +86,14 @@ public class FarmWarDeployer extends ClusterListener implements ClusterDeployer,
protected String watchDir;
private File watchDirFile = null;
+ /**
+ * Whether the watch directory feature is enabled.
+ */
protected boolean watchEnabled = false;
+ /**
+ * The watcher for monitoring the watch directory.
+ */
protected WarWatcher watcher = null;
/**
@@ -121,6 +133,9 @@ public class FarmWarDeployer extends ClusterListener implements ClusterDeployer,
protected int maxValidTime = 5 * 60;
/*--Constructor---------------------------------------------*/
+ /**
+ * Creates a new FarmWarDeployer instance.
+ */
public FarmWarDeployer() {
}
@@ -569,10 +584,20 @@ public class FarmWarDeployer extends ClusterListener implements ClusterDeployer,
}
/*--Instance Getters/Setters--------------------------------*/
+ /**
+ * Returns the deployment directory path.
+ *
+ * @return the deployment directory path
+ */
public String getDeployDir() {
return deployDir;
}
+ /**
+ * Returns the deployment directory as a File object.
+ *
+ * @return the deployment directory file
+ */
public File getDeployDirFile() {
if (deployDirFile != null) {
return deployDirFile;
@@ -583,14 +608,29 @@ public class FarmWarDeployer extends ClusterListener implements ClusterDeployer,
return dir;
}
+ /**
+ * Sets the deployment directory path.
+ *
+ * @param deployDir the deployment directory path
+ */
public void setDeployDir(String deployDir) {
this.deployDir = deployDir;
}
+ /**
+ * Returns the temporary directory path.
+ *
+ * @return the temporary directory path
+ */
public String getTempDir() {
return tempDir;
}
+ /**
+ * Returns the temporary directory as a File object.
+ *
+ * @return the temporary directory file
+ */
public File getTempDirFile() {
if (tempDirFile != null) {
return tempDirFile;
@@ -601,14 +641,29 @@ public class FarmWarDeployer extends ClusterListener implements ClusterDeployer,
return dir;
}
+ /**
+ * Sets the temporary directory path.
+ *
+ * @param tempDir the temporary directory path
+ */
public void setTempDir(String tempDir) {
this.tempDir = tempDir;
}
+ /**
+ * Returns the watch directory path.
+ *
+ * @return the watch directory path
+ */
public String getWatchDir() {
return watchDir;
}
+ /**
+ * Returns the watch directory as a File object.
+ *
+ * @return the watch directory file
+ */
public File getWatchDirFile() {
if (watchDirFile != null) {
return watchDirFile;
@@ -619,24 +674,46 @@ public class FarmWarDeployer extends ClusterListener implements ClusterDeployer,
return dir;
}
+ /**
+ * Sets the watch directory path.
+ *
+ * @param watchDir the watch directory path
+ */
public void setWatchDir(String watchDir) {
this.watchDir = watchDir;
}
+ /**
+ * Returns whether the watch directory feature is enabled.
+ *
+ * @return {@code true} if watch is enabled
+ */
public boolean isWatchEnabled() {
return watchEnabled;
}
+ /**
+ * Returns whether the watch directory feature is enabled.
+ *
+ * @return {@code true} if watch is enabled
+ */
public boolean getWatchEnabled() {
return watchEnabled;
}
+ /**
+ * Sets whether the watch directory feature is enabled.
+ *
+ * @param watchEnabled {@code true} to enable watch
+ */
public void setWatchEnabled(boolean watchEnabled) {
this.watchEnabled = watchEnabled;
}
/**
- * @return the frequency of watcher checks.
+ * Returns the frequency of watcher checks.
+ *
+ * @return the frequency of watcher checks
*/
public int getProcessDeployFrequency() {
return this.processDeployFrequency;
@@ -655,10 +732,20 @@ public class FarmWarDeployer extends ClusterListener implements ClusterDeployer,
this.processDeployFrequency = processExpiresFrequency;
}
+ /**
+ * Returns the maximum valid time for FileMessageFactory.
+ *
+ * @return the maximum valid time in seconds
+ */
public int getMaxValidTime() {
return maxValidTime;
}
+ /**
+ * Sets the maximum valid time for FileMessageFactory.
+ *
+ * @param maxValidTime the maximum valid time in seconds
+ */
public void setMaxValidTime(int maxValidTime) {
this.maxValidTime = maxValidTime;
}
@@ -701,6 +788,9 @@ public class FarmWarDeployer extends ClusterListener implements ClusterDeployer,
return true;
}
+ /**
+ * Removes invalid file factories from the factory map.
+ */
protected void removeInvalidFileFactories() {
String[] fileNames = fileFactories.keySet().toArray(new String[0]);
for (String fileName : fileNames) {
diff --git a/java/org/apache/catalina/ha/deploy/FileChangeListener.java b/java/org/apache/catalina/ha/deploy/FileChangeListener.java
index 08519c73eb..299317dda8 100644
--- a/java/org/apache/catalina/ha/deploy/FileChangeListener.java
+++ b/java/org/apache/catalina/ha/deploy/FileChangeListener.java
@@ -18,6 +18,9 @@ package org.apache.catalina.ha.deploy;
import java.io.File;
+/**
+ * Interface for listening to file changes in a deployment directory.
+ */
public interface FileChangeListener {
/**
diff --git a/java/org/apache/catalina/ha/deploy/FileMessage.java b/java/org/apache/catalina/ha/deploy/FileMessage.java
index 6d3c28ac66..6e566c3cfd 100644
--- a/java/org/apache/catalina/ha/deploy/FileMessage.java
+++ b/java/org/apache/catalina/ha/deploy/FileMessage.java
@@ -35,37 +35,80 @@ public class FileMessage extends ClusterMessageBase {
private final String fileName;
private final String contextName;
+ /**
+ * Creates a new FileMessage for transferring a file.
+ *
+ * @param source The member that is the source of this message
+ * @param fileName The name of the file being transferred
+ * @param contextName The name of the context associated with this file
+ */
public FileMessage(Member source, String fileName, String contextName) {
this.address = source;
this.fileName = fileName;
this.contextName = contextName;
}
+ /**
+ * Returns the message number within the file transfer sequence.
+ *
+ * @return The message number
+ */
public int getMessageNumber() {
return messageNumber;
}
+ /**
+ * Sets the message number within the file transfer sequence.
+ *
+ * @param messageNumber The message number
+ */
public void setMessageNumber(int messageNumber) {
this.messageNumber = messageNumber;
}
+ /**
+ * Returns the total number of messages in the file transfer.
+ *
+ * @return The total number of messages
+ */
public long getTotalNrOfMsgs() {
return totalNrOfMsgs;
}
+ /**
+ * Sets the total number of messages in the file transfer.
+ *
+ * @param totalNrOfMsgs The total number of messages
+ */
public void setTotalNrOfMsgs(long totalNrOfMsgs) {
this.totalNrOfMsgs = totalNrOfMsgs;
}
+ /**
+ * Returns the data payload of this message.
+ *
+ * @return The data byte array
+ */
public byte[] getData() {
return data;
}
+ /**
+ * Sets the data payload and its length for this message.
+ *
+ * @param data The data byte array
+ * @param length The length of valid data in the array
+ */
public void setData(byte[] data, int length) {
this.data = data;
this.dataLength = length;
}
+ /**
+ * Returns the length of the valid data in the data array.
+ *
+ * @return The data length
+ */
public int getDataLength() {
return dataLength;
}
@@ -76,10 +119,20 @@ public class FileMessage extends ClusterMessageBase {
}
+ /**
+ * Returns the name of the file being transferred.
+ *
+ * @return The file name
+ */
public String getFileName() {
return fileName;
}
+ /**
+ * Returns the context name associated with this file transfer.
+ *
+ * @return The context name
+ */
public String getContextName() {
return contextName;
}
diff --git a/java/org/apache/catalina/ha/deploy/FileMessageFactory.java b/java/org/apache/catalina/ha/deploy/FileMessageFactory.java
index 978c2e6bb6..2ca3de1363 100644
--- a/java/org/apache/catalina/ha/deploy/FileMessageFactory.java
+++ b/java/org/apache/catalina/ha/deploy/FileMessageFactory.java
@@ -330,10 +330,21 @@ public class FileMessageFactory {
}
}
+ /**
+ * Returns the file associated with this factory.
+ *
+ * @return The file
+ */
public File getFile() {
return file;
}
+ /**
+ * Checks if this factory instance is still valid based on the maximum valid time.
+ * If the instance has been idle longer than maxValidTime, it will be cleaned up.
+ *
+ * @return True if the factory is still valid, false if it has expired
+ */
public boolean isValid() {
if (maxValidTime > 0) {
long timeNow = System.currentTimeMillis();
@@ -353,10 +364,20 @@ public class FileMessageFactory {
return true;
}
+ /**
+ * Returns the maximum time in seconds that this factory instance is allowed to exist from last modification.
+ *
+ * @return The maximum valid time in seconds
+ */
public int getMaxValidTime() {
return maxValidTime;
}
+ /**
+ * Sets the maximum time in seconds that this factory instance is allowed to exist from last modification.
+ *
+ * @param maxValidTime The maximum valid time in seconds
+ */
public void setMaxValidTime(int maxValidTime) {
this.maxValidTime = maxValidTime;
}
diff --git a/java/org/apache/catalina/ha/session/BackupManager.java b/java/org/apache/catalina/ha/session/BackupManager.java
index 10be3800ae..98502061e7 100644
--- a/java/org/apache/catalina/ha/session/BackupManager.java
+++ b/java/org/apache/catalina/ha/session/BackupManager.java
@@ -32,6 +32,9 @@ import org.apache.juli.logging.Log;
import org.apache.juli.logging.LogFactory;
import org.apache.tomcat.util.res.StringManager;
+/**
+ * Cluster session manager that provides backup session replication. Each session has one primary and one backup node.
+ */
public class BackupManager extends ClusterManagerBase implements MapOwner, DistributedManager {
private final Log log = LogFactory.getLog(BackupManager.class); // must not be static
@@ -41,6 +44,9 @@ public class BackupManager extends ClusterManagerBase implements MapOwner, Distr
*/
protected static final StringManager sm = StringManager.getManager(BackupManager.class);
+ /**
+ * Default replication timeout in milliseconds.
+ */
protected static final long DEFAULT_REPL_TIMEOUT = 15000;// 15 seconds
/**
@@ -152,6 +158,11 @@ public class BackupManager extends ClusterManagerBase implements MapOwner, Distr
setState(LifecycleState.STARTING);
}
+ /**
+ * Returns the name of the replication map.
+ *
+ * @return the map name
+ */
public String getMapName() {
String name = cluster.getManagerName(getName(), this) + "-" + "map";
if (log.isTraceEnabled()) {
@@ -191,10 +202,20 @@ public class BackupManager extends ClusterManagerBase implements MapOwner, Distr
this.name = name;
}
+ /**
+ * Sets the channel send options for the replication map.
+ *
+ * @param mapSendOptions the send options as an integer flag
+ */
public void setMapSendOptions(int mapSendOptions) {
this.mapSendOptions = mapSendOptions;
}
+ /**
+ * Sets the channel send options for the replication map from a string.
+ *
+ * @param mapSendOptions the send options as a comma-separated string
+ */
public void setMapSendOptions(String mapSendOptions) {
int value = Channel.parseSendOptions(mapSendOptions);
@@ -203,6 +224,11 @@ public class BackupManager extends ClusterManagerBase implements MapOwner, Distr
}
}
+ /**
+ * Returns the channel send options for the replication map.
+ *
+ * @return the send options as an integer flag
+ */
public int getMapSendOptions() {
return mapSendOptions;
}
@@ -216,26 +242,56 @@ public class BackupManager extends ClusterManagerBase implements MapOwner, Distr
return Channel.getSendOptionsAsString(mapSendOptions);
}
+ /**
+ * Sets the RPC timeout for replication messages.
+ *
+ * @param rpcTimeout the timeout in milliseconds
+ */
public void setRpcTimeout(long rpcTimeout) {
this.rpcTimeout = rpcTimeout;
}
+ /**
+ * Returns the RPC timeout for replication messages.
+ *
+ * @return the timeout in milliseconds
+ */
public long getRpcTimeout() {
return rpcTimeout;
}
+ /**
+ * Sets whether to terminate the map on start failure.
+ *
+ * @param terminateOnStartFailure {@code true} to terminate on start failure
+ */
public void setTerminateOnStartFailure(boolean terminateOnStartFailure) {
this.terminateOnStartFailure = terminateOnStartFailure;
}
+ /**
+ * Returns whether the map will terminate on start failure.
+ *
+ * @return {@code true} if the map will terminate on start failure
+ */
public boolean isTerminateOnStartFailure() {
return terminateOnStartFailure;
}
+ /**
+ * Returns the access timeout for the replication map.
+ *
+ * @return the access timeout in milliseconds
+ */
public long getAccessTimeout() {
return accessTimeout;
}
+ /**
+ * Sets the access timeout for the replication map.
+ *
+ * @param accessTimeout the access timeout in milliseconds
+ */
public void setAccessTimeout(long accessTimeout) {
this.accessTimeout = accessTimeout;
}
diff --git a/java/org/apache/catalina/ha/session/ClusterManagerBase.java b/java/org/apache/catalina/ha/session/ClusterManagerBase.java
index 77c989add4..74f614ddd4 100644
--- a/java/org/apache/catalina/ha/session/ClusterManagerBase.java
+++ b/java/org/apache/catalina/ha/session/ClusterManagerBase.java
@@ -35,8 +35,21 @@ import org.apache.juli.logging.LogFactory;
import org.apache.tomcat.util.collections.SynchronizedStack;
import org.apache.tomcat.util.res.StringManager;
+/**
+ * Base class for cluster session managers. Provides common functionality for
+ * session replication and clustering.
+ */
public abstract class ClusterManagerBase extends ManagerBase implements ClusterManager {
+ /**
+ * Default constructor for ClusterManagerBase.
+ */
+ public ClusterManagerBase() {
+ }
+
+ /**
+ * String manager for this class.
+ */
protected static final StringManager sm = StringManager.getManager(ClusterManagerBase.class);
private final Log log = LogFactory.getLog(ClusterManagerBase.class); // must not be static
@@ -63,6 +76,11 @@ public abstract class ClusterManagerBase extends ManagerBase implements ClusterM
private final SynchronizedStack<DeltaRequest> deltaRequestPool = new SynchronizedStack<>();
+ /**
+ * Returns the pool of DeltaRequest objects.
+ *
+ * @return the delta request pool
+ */
protected SynchronizedStack<DeltaRequest> getDeltaRequestPool() {
return deltaRequestPool;
}
@@ -83,20 +101,42 @@ public abstract class ClusterManagerBase extends ManagerBase implements ClusterM
return notifyListenersOnReplication;
}
+ /**
+ * Sets whether listeners should be notified on replication.
+ *
+ * @param notifyListenersOnReplication the new value
+ */
public void setNotifyListenersOnReplication(boolean notifyListenersOnReplication) {
this.notifyListenersOnReplication = notifyListenersOnReplication;
}
+ /**
+ * Returns whether all session attribute actions should be recorded.
+ *
+ * @return {@code true} if all actions are recorded
+ */
public boolean isRecordAllActions() {
return recordAllActions;
}
+ /**
+ * Sets whether all session attribute actions should be recorded.
+ *
+ * @param recordAllActions the new value
+ */
public void setRecordAllActions(boolean recordAllActions) {
this.recordAllActions = recordAllActions;
}
+ /**
+ * Returns the class loaders for the specified context.
+ *
+ * @param context the context
+ *
+ * @return the array of class loaders
+ */
public static ClassLoader[] getClassLoaders(Context context) {
ClassLoader tccl = Thread.currentThread().getContextClassLoader();
Loader loader = context.getLoader();
@@ -115,6 +155,11 @@ public abstract class ClusterManagerBase extends ManagerBase implements ClusterM
}
+ /**
+ * Returns the class loaders for this manager's context.
+ *
+ * @return the array of class loaders
+ */
public ClassLoader[] getClassLoaders() {
return getClassLoaders(getContext());
}
@@ -151,6 +196,11 @@ public abstract class ClusterManagerBase extends ManagerBase implements ClusterM
// NOOP
}
+ /**
+ * Clone the configuration from this manager to the specified copy.
+ *
+ * @param copy the manager to clone to
+ */
protected void clone(ClusterManagerBase copy) {
copy.setName("Clone-from-" + getName());
copy.setMaxActiveSessions(getMaxActiveSessions());
diff --git a/java/org/apache/catalina/ha/session/ClusterSessionListener.java b/java/org/apache/catalina/ha/session/ClusterSessionListener.java
index e400e7bc9a..3f6d67d4d2 100644
--- a/java/org/apache/catalina/ha/session/ClusterSessionListener.java
+++ b/java/org/apache/catalina/ha/session/ClusterSessionListener.java
@@ -35,6 +35,9 @@ public class ClusterSessionListener extends ClusterListener {
// --Constructor---------------------------------------------
+ /**
+ * Default constructor for ClusterSessionListener.
+ */
public ClusterSessionListener() {
// NO-OP
}
diff --git a/java/org/apache/catalina/ha/session/DeltaManager.java b/java/org/apache/catalina/ha/session/DeltaManager.java
index fe37aeabb4..8583efd812 100644
--- a/java/org/apache/catalina/ha/session/DeltaManager.java
+++ b/java/org/apache/catalina/ha/session/DeltaManager.java
@@ -54,6 +54,9 @@ import org.apache.tomcat.util.res.StringManager;
public class DeltaManager extends ClusterManagerBase {
// ---------------------------------------------------- Security Classes
+ /**
+ * The log instance for this class.
+ */
public final Log log = LogFactory.getLog(DeltaManager.class);
/**
@@ -65,6 +68,9 @@ public class DeltaManager extends ClusterManagerBase {
// ----------------------------------------------------- Instance Variables
+ /**
+ * The name of this manager.
+ */
protected String name = null;
private boolean expireSessionsOnShutdown = false;
@@ -110,6 +116,9 @@ public class DeltaManager extends ClusterManagerBase {
// ------------------------------------------------------------- Constructor
+ /**
+ * Default constructor.
+ */
public DeltaManager() {
super();
}
@@ -126,161 +135,210 @@ public class DeltaManager extends ClusterManagerBase {
return name;
}
- /**
- * @return Returns the counterSend_EVT_GET_ALL_SESSIONS.
+ /**
+ * Get the send counter for EVT_GET_ALL_SESSIONS events.
+ *
+ * @return the counterSend_EVT_GET_ALL_SESSIONS value.
*/
public long getCounterSend_EVT_GET_ALL_SESSIONS() {
return counterSend_EVT_GET_ALL_SESSIONS.get();
}
- /**
- * @return Returns the counterSend_EVT_SESSION_ACCESSED.
+ /**
+ * Get the send counter for EVT_SESSION_ACCESSED events.
+ *
+ * @return the counterSend_EVT_SESSION_ACCESSED value.
*/
public long getCounterSend_EVT_SESSION_ACCESSED() {
return counterSend_EVT_SESSION_ACCESSED.get();
}
- /**
- * @return Returns the counterSend_EVT_SESSION_CREATED.
+ /**
+ * Get the send counter for EVT_SESSION_CREATED events.
+ *
+ * @return the counterSend_EVT_SESSION_CREATED value.
*/
public long getCounterSend_EVT_SESSION_CREATED() {
return counterSend_EVT_SESSION_CREATED.get();
}
- /**
- * @return Returns the counterSend_EVT_SESSION_DELTA.
+ /**
+ * Get the send counter for EVT_SESSION_DELTA events.
+ *
+ * @return the counterSend_EVT_SESSION_DELTA value.
*/
public long getCounterSend_EVT_SESSION_DELTA() {
return counterSend_EVT_SESSION_DELTA.get();
}
- /**
- * @return Returns the counterSend_EVT_SESSION_EXPIRED.
+ /**
+ * Get the send counter for EVT_SESSION_EXPIRED events.
+ *
+ * @return the counterSend_EVT_SESSION_EXPIRED value.
*/
public long getCounterSend_EVT_SESSION_EXPIRED() {
return counterSend_EVT_SESSION_EXPIRED.get();
}
- /**
- * @return Returns the counterSend_EVT_ALL_SESSION_DATA.
+ /**
+ * Get the send counter for EVT_ALL_SESSION_DATA events.
+ *
+ * @return the counterSend_EVT_ALL_SESSION_DATA value.
*/
public long getCounterSend_EVT_ALL_SESSION_DATA() {
return counterSend_EVT_ALL_SESSION_DATA.get();
}
- /**
- * @return Returns the counterSend_EVT_ALL_SESSION_TRANSFERCOMPLETE.
+ /**
+ * Get the send counter for EVT_ALL_SESSION_TRANSFERCOMPLETE events.
+ *
+ * @return the counterSend_EVT_ALL_SESSION_TRANSFERCOMPLETE value.
*/
public int getCounterSend_EVT_ALL_SESSION_TRANSFERCOMPLETE() {
return counterSend_EVT_ALL_SESSION_TRANSFERCOMPLETE.get();
}
- /**
- * @return Returns the counterSend_EVT_CHANGE_SESSION_ID.
+ /**
+ * Get the send counter for EVT_CHANGE_SESSION_ID events.
+ *
+ * @return the counterSend_EVT_CHANGE_SESSION_ID value.
*/
public long getCounterSend_EVT_CHANGE_SESSION_ID() {
return counterSend_EVT_CHANGE_SESSION_ID.get();
}
- /**
- * @return Returns the counterReceive_EVT_ALL_SESSION_DATA.
+ /**
+ * Get the receive counter for EVT_ALL_SESSION_DATA events.
+ *
+ * @return the counterReceive_EVT_ALL_SESSION_DATA value.
*/
public long getCounterReceive_EVT_ALL_SESSION_DATA() {
return counterReceive_EVT_ALL_SESSION_DATA.get();
}
- /**
- * @return Returns the counterReceive_EVT_GET_ALL_SESSIONS.
+ /**
+ * Get the receive counter for EVT_GET_ALL_SESSIONS events.
+ *
+ * @return the counterReceive_EVT_GET_ALL_SESSIONS value.
*/
public long getCounterReceive_EVT_GET_ALL_SESSIONS() {
return counterReceive_EVT_GET_ALL_SESSIONS.get();
}
- /**
- * @return Returns the counterReceive_EVT_SESSION_ACCESSED.
+ /**
+ * Get the receive counter for EVT_SESSION_ACCESSED events.
+ *
+ * @return the counterReceive_EVT_SESSION_ACCESSED value.
*/
public long getCounterReceive_EVT_SESSION_ACCESSED() {
return counterReceive_EVT_SESSION_ACCESSED.get();
}
- /**
- * @return Returns the counterReceive_EVT_SESSION_CREATED.
+ /**
+ * Get the receive counter for EVT_SESSION_CREATED events.
+ *
+ * @return the counterReceive_EVT_SESSION_CREATED value.
*/
public long getCounterReceive_EVT_SESSION_CREATED() {
return counterReceive_EVT_SESSION_CREATED.get();
}
- /**
- * @return Returns the counterReceive_EVT_SESSION_DELTA.
+ /**
+ * Get the receive counter for EVT_SESSION_DELTA events.
+ *
+ * @return the counterReceive_EVT_SESSION_DELTA value.
*/
public long getCounterReceive_EVT_SESSION_DELTA() {
return counterReceive_EVT_SESSION_DELTA.get();
}
- /**
- * @return Returns the counterReceive_EVT_SESSION_EXPIRED.
+ /**
+ * Get the receive counter for EVT_SESSION_EXPIRED events.
+ *
+ * @return the counterReceive_EVT_SESSION_EXPIRED value.
*/
public long getCounterReceive_EVT_SESSION_EXPIRED() {
return counterReceive_EVT_SESSION_EXPIRED.get();
}
- /**
- * @return Returns the counterReceive_EVT_ALL_SESSION_TRANSFERCOMPLETE.
+ /**
+ * Get the receive counter for EVT_ALL_SESSION_TRANSFERCOMPLETE events.
+ *
+ * @return the counterReceive_EVT_ALL_SESSION_TRANSFERCOMPLETE value.
*/
public int getCounterReceive_EVT_ALL_SESSION_TRANSFERCOMPLETE() {
return counterReceive_EVT_ALL_SESSION_TRANSFERCOMPLETE.get();
}
- /**
- * @return Returns the counterReceive_EVT_CHANGE_SESSION_ID.
+ /**
+ * Get the receive counter for EVT_CHANGE_SESSION_ID events.
+ *
+ * @return the counterReceive_EVT_CHANGE_SESSION_ID value.
*/
public long getCounterReceive_EVT_CHANGE_SESSION_ID() {
return counterReceive_EVT_CHANGE_SESSION_ID.get();
}
- /**
- * @return Returns the counterReceive_EVT_ALL_SESSION_NOCONTEXTMANAGER.
+ /**
+ * Get the receive counter for EVT_ALL_SESSION_NOCONTEXTMANAGER events.
+ *
+ * @return the counterReceive_EVT_ALL_SESSION_NOCONTEXTMANAGER value.
*/
public long getCounterReceive_EVT_ALL_SESSION_NOCONTEXTMANAGER() {
return counterReceive_EVT_ALL_SESSION_NOCONTEXTMANAGER.get();
}
- /**
- * @return Returns the sessionReplaceCounter.
+ /**
+ * Get the session replace counter.
+ *
+ * @return the sessionReplaceCounter value.
*/
public long getSessionReplaceCounter() {
return sessionReplaceCounter.get();
}
- /**
- * @return Returns the counterNoStateTransferred.
+ /**
+ * Get the counter for sessions where no state was transferred.
+ *
+ * @return the counterNoStateTransferred value.
*/
public int getCounterNoStateTransferred() {
return counterNoStateTransferred.get();
}
+ /**
+ * Get the current size of the received message queue.
+ *
+ * @return the queue size
+ */
public int getReceivedQueueSize() {
synchronized (receivedMessageQueue) {
return receivedMessageQueue.size();
}
}
- /**
- * @return Returns the stateTransferTimeout.
+ /**
+ * Get the state transfer timeout value.
+ *
+ * @return the stateTransferTimeout value.
*/
public int getStateTransferTimeout() {
return stateTransferTimeout;
}
- /**
- * @param timeoutAllSession The timeout
+ /**
+ * Set the state transfer timeout.
+ *
+ * @param timeoutAllSession The timeout value
*/
public void setStateTransferTimeout(int timeoutAllSession) {
this.stateTransferTimeout = timeoutAllSession;
}
- /**
+ /**
+ * Check if the state transfer is complete.
+ *
* @return <code>true</code> if the state transfer is complete.
*/
public boolean getStateTransferred() {
@@ -296,110 +354,164 @@ public class DeltaManager extends ClusterManagerBase {
this.stateTransferred = stateTransferred;
}
+ /**
+ * Check if a no-context-manager signal has been received.
+ *
+ * @return true if no context manager received
+ */
public boolean isNoContextManagerReceived() {
return noContextManagerReceived;
}
+ /**
+ * Set whether a no-context-manager signal has been received.
+ *
+ * @param noContextManagerReceived The flag value
+ */
public void setNoContextManagerReceived(boolean noContextManagerReceived) {
this.noContextManagerReceived = noContextManagerReceived;
}
- /**
- * @return the sendAllSessionsWaitTime in msec
+ /**
+ * Get the wait time for sending all sessions.
+ *
+ * @return the sendAllSessionsWaitTime in milliseconds
*/
public int getSendAllSessionsWaitTime() {
return sendAllSessionsWaitTime;
}
- /**
- * @param sendAllSessionsWaitTime The sendAllSessionsWaitTime to set at msec.
+ /**
+ * Set the wait time for sending all sessions.
+ *
+ * @param sendAllSessionsWaitTime The wait time in milliseconds
*/
public void setSendAllSessionsWaitTime(int sendAllSessionsWaitTime) {
this.sendAllSessionsWaitTime = sendAllSessionsWaitTime;
}
- /**
- * @return the stateTimestampDrop.
+ /**
+ * Check if state timestamp drop is enabled.
+ *
+ * @return the stateTimestampDrop flag
*/
public boolean isStateTimestampDrop() {
return stateTimestampDrop;
}
- /**
+ /**
+ * Set the state timestamp drop flag.
+ *
* @param isTimestampDrop The new flag value
*/
public void setStateTimestampDrop(boolean isTimestampDrop) {
this.stateTimestampDrop = isTimestampDrop;
}
- /**
- * @return the sendAllSessions.
+ /**
+ * Check if sending all sessions is enabled.
+ *
+ * @return the sendAllSessions flag
*/
public boolean isSendAllSessions() {
return sendAllSessions;
}
- /**
- * @param sendAllSessions The sendAllSessions to set.
+ /**
+ * Set whether to send all sessions during replication.
+ *
+ * @param sendAllSessions The flag value
*/
public void setSendAllSessions(boolean sendAllSessions) {
this.sendAllSessions = sendAllSessions;
}
- /**
- * @return the sendAllSessionsSize.
+ /**
+ * Get the batch size for sending all sessions.
+ *
+ * @return the sendAllSessionsSize value
*/
public int getSendAllSessionsSize() {
return sendAllSessionsSize;
}
- /**
- * @param sendAllSessionsSize The sendAllSessionsSize to set.
+ /**
+ * Set the batch size for sending all sessions.
+ *
+ * @param sendAllSessionsSize The batch size value
*/
public void setSendAllSessionsSize(int sendAllSessionsSize) {
this.sendAllSessionsSize = sendAllSessionsSize;
}
- /**
- * @return the notifySessionListenersOnReplication.
+ /**
+ * Check if session listeners are notified on replication.
+ *
+ * @return the notifySessionListenersOnReplication flag
*/
public boolean isNotifySessionListenersOnReplication() {
return notifySessionListenersOnReplication;
}
- /**
- * @param notifyListenersCreateSessionOnReplication The notifySessionListenersOnReplication to set.
+ /**
+ * Set whether to notify session listeners on replication.
+ *
+ * @param notifyListenersCreateSessionOnReplication The flag value
*/
public void setNotifySessionListenersOnReplication(boolean notifyListenersCreateSessionOnReplication) {
this.notifySessionListenersOnReplication = notifyListenersCreateSessionOnReplication;
}
+ /**
+ * Check if sessions should be expired on shutdown.
+ *
+ * @return true if sessions are expired on shutdown
+ */
public boolean isExpireSessionsOnShutdown() {
return expireSessionsOnShutdown;
}
+ /**
+ * Set whether to expire sessions on shutdown.
+ *
+ * @param expireSessionsOnShutdown The flag value
+ */
public void setExpireSessionsOnShutdown(boolean expireSessionsOnShutdown) {
this.expireSessionsOnShutdown = expireSessionsOnShutdown;
}
+ /**
+ * Check if container listeners are notified on replication.
+ *
+ * @return true if container listeners are notified on replication
+ */
public boolean isNotifyContainerListenersOnReplication() {
return notifyContainerListenersOnReplication;
}
+ /**
+ * Set whether to notify container listeners on replication.
+ *
+ * @param notifyContainerListenersOnReplication The flag value
+ */
public void setNotifyContainerListenersOnReplication(boolean notifyContainerListenersOnReplication) {
this.notifyContainerListenersOnReplication = notifyContainerListenersOnReplication;
}
- /**
- * @return the enableStatistics
+/**
+ * Check if statistics collection is enabled.
+ *
+ * @return the enableStatistics flag
*/
public boolean getEnableStatistics() {
return this.enableStatistics;
}
- /**
- * @param enableStatistics the enableStatistics to set
+/**
+ * Set whether statistics collection is enabled.
+ *
+ * @param enableStatistics The flag value
*/
public void setEnableStatistics(boolean enableStatistics) {
this.enableStatistics = enableStatistics;
@@ -484,6 +596,13 @@ public class DeltaManager extends ClusterManagerBase {
changeSessionId(session, newId, true);
}
+ /**
+ * Rotate the session ID and optionally notify cluster members.
+ *
+ * @param session The session whose ID should be rotated
+ * @param notify Whether to notify cluster members of the change
+ * @return the new session ID
+ */
protected String rotateSessionId(Session session, boolean notify) {
String orgSessionID = session.getId();
String newId = super.rotateSessionId(session);
@@ -493,6 +612,13 @@ public class DeltaManager extends ClusterManagerBase {
return newId;
}
+ /**
+ * Change the session ID and optionally notify cluster members.
+ *
+ * @param session The session whose ID should be changed
+ * @param newId The new session ID
+ * @param notify Whether to notify cluster members of the change
+ */
protected void changeSessionId(Session session, String newId, boolean notify) {
String orgSessionID = session.getId();
super.changeSessionId(session, newId);
@@ -501,6 +627,12 @@ public class DeltaManager extends ClusterManagerBase {
}
}
+ /**
+ * Send a session ID change notification to cluster members.
+ *
+ * @param newSessionID The new session ID
+ * @param orgSessionID The original session ID
+ */
protected void sendChangeSessionId(String newSessionID, String orgSessionID) {
if (cluster.getMembers().length > 0) {
try {
diff --git a/java/org/apache/catalina/ha/session/DeltaRequest.java b/java/org/apache/catalina/ha/session/DeltaRequest.java
index 6f690b6122..e889070a84 100644
--- a/java/org/apache/catalina/ha/session/DeltaRequest.java
+++ b/java/org/apache/catalina/ha/session/DeltaRequest.java
@@ -38,6 +38,9 @@ import org.apache.tomcat.util.res.StringManager;
*/
public class DeltaRequest implements Externalizable {
+ /**
+ * The logger for this class.
+ */
public static final Log log = LogFactory.getLog(DeltaRequest.class);
/**
@@ -45,21 +48,74 @@ public class DeltaRequest implements Externalizable {
*/
protected static final StringManager sm = StringManager.getManager(DeltaRequest.class);
+ /**
+ * Action type for session attributes.
+ */
public static final int TYPE_ATTRIBUTE = 0;
+
+ /**
+ * Action type for session principal.
+ */
public static final int TYPE_PRINCIPAL = 1;
+
+ /**
+ * Action type for session new flag.
+ */
public static final int TYPE_ISNEW = 2;
+
+ /**
+ * Action type for session max inactive interval.
+ */
public static final int TYPE_MAXINTERVAL = 3;
+
+ /**
+ * Action type for session authentication type.
+ */
public static final int TYPE_AUTHTYPE = 4;
+
+ /**
+ * Action type for session listener.
+ */
public static final int TYPE_LISTENER = 5;
+
+ /**
+ * Action type for session note.
+ */
public static final int TYPE_NOTE = 6;
+ /**
+ * Action to set a value.
+ */
public static final int ACTION_SET = 0;
+
+ /**
+ * Action to remove a value.
+ */
public static final int ACTION_REMOVE = 1;
+ /**
+ * Name used for principal actions.
+ */
public static final String NAME_PRINCIPAL = "__SET__PRINCIPAL__";
+
+ /**
+ * Name used for max inactive interval actions.
+ */
public static final String NAME_MAXINTERVAL = "__SET__MAXINTERVAL__";
+
+ /**
+ * Name used for new flag actions.
+ */
public static final String NAME_ISNEW = "__SET__ISNEW__";
+
+ /**
+ * Name used for auth type actions.
+ */
public static final String NAME_AUTHTYPE = "__SET__AUTHTYPE__";
+
+ /**
+ * Name used for listener actions.
+ */
public static final String NAME_LISTENER = "__SET__LISTENER__";
private String sessionId;
@@ -68,10 +124,19 @@ public class DeltaRequest implements Externalizable {
private boolean recordAllActions = false;
+ /**
+ * Default constructor required by {@link java.io.Externalizable}.
+ */
public DeltaRequest() {
}
+ /**
+ * Construct a new DeltaRequest.
+ *
+ * @param sessionId Session identifier
+ * @param recordAllActions Record all actions, including duplicates
+ */
public DeltaRequest(String sessionId, boolean recordAllActions) {
this.recordAllActions = recordAllActions;
if (sessionId != null) {
@@ -80,24 +145,51 @@ public class DeltaRequest implements Externalizable {
}
+ /**
+ * Record a set attribute action.
+ *
+ * @param name Attribute name
+ * @param value Attribute value
+ */
public void setAttribute(String name, Object value) {
int action = (value == null) ? ACTION_REMOVE : ACTION_SET;
addAction(TYPE_ATTRIBUTE, action, name, value);
}
+ /**
+ * Record a remove attribute action.
+ *
+ * @param name Attribute name
+ */
public void removeAttribute(String name) {
addAction(TYPE_ATTRIBUTE, ACTION_REMOVE, name, null);
}
+ /**
+ * Record a set note action.
+ *
+ * @param name Note name
+ * @param value Note value
+ */
public void setNote(String name, Object value) {
int action = (value == null) ? ACTION_REMOVE : ACTION_SET;
addAction(TYPE_NOTE, action, name, value);
}
+ /**
+ * Record a remove note action.
+ *
+ * @param name Note name
+ */
public void removeNote(String name) {
addAction(TYPE_NOTE, ACTION_REMOVE, name, null);
}
+ /**
+ * Record a set max inactive interval action.
+ *
+ * @param interval Max inactive interval in seconds
+ */
public void setMaxInactiveInterval(int interval) {
addAction(TYPE_MAXINTERVAL, ACTION_SET, NAME_MAXINTERVAL, Integer.valueOf(interval));
}
@@ -125,23 +217,51 @@ public class DeltaRequest implements Externalizable {
addAction(TYPE_PRINCIPAL, action, NAME_PRINCIPAL, gp);
}
+ /**
+ * Record a set new action.
+ *
+ * @param n New flag value
+ */
public void setNew(boolean n) {
addAction(TYPE_ISNEW, ACTION_SET, NAME_ISNEW, Boolean.valueOf(n));
}
+ /**
+ * Record a set auth type action.
+ *
+ * @param authType Authentication type
+ */
public void setAuthType(String authType) {
int action = (authType == null) ? ACTION_REMOVE : ACTION_SET;
addAction(TYPE_AUTHTYPE, action, NAME_AUTHTYPE, authType);
}
+ /**
+ * Record an add session listener action.
+ *
+ * @param listener Session listener to add
+ */
public void addSessionListener(SessionListener listener) {
addAction(TYPE_LISTENER, ACTION_SET, NAME_LISTENER, listener);
}
+ /**
+ * Record a remove session listener action.
+ *
+ * @param listener Session listener to remove
+ */
public void removeSessionListener(SessionListener listener) {
addAction(TYPE_LISTENER, ACTION_REMOVE, NAME_LISTENER, listener);
}
+ /**
+ * Add an action to the list of actions to be executed.
+ *
+ * @param type Action type
+ * @param action Action (set or remove)
+ * @param name Attribute or property name
+ * @param value Attribute or property value
+ */
protected void addAction(int type, int action, String name, Object value) {
AttributeInfo info;
if (!this.actionPool.isEmpty()) {
@@ -168,6 +288,12 @@ public class DeltaRequest implements Externalizable {
actions.addLast(info);
}
+ /**
+ * Execute all recorded actions on the given session.
+ *
+ * @param session Target session
+ * @param notifyListeners Whether to notify session listeners
+ */
public void execute(DeltaSession session, boolean notifyListeners) {
if (!this.sessionId.equals(session.getId())) {
throw new IllegalArgumentException(sm.getString("deltaRequest.ssid.mismatch"));
@@ -245,6 +371,9 @@ public class DeltaRequest implements Externalizable {
reset();
}
+ /**
+ * Reset this request, returning all action objects to the pool.
+ */
public void reset() {
while (!actions.isEmpty()) {
try {
@@ -257,10 +386,20 @@ public class DeltaRequest implements Externalizable {
}
}
+ /**
+ * Get the session identifier.
+ *
+ * @return Session identifier
+ */
public String getSessionId() {
return sessionId;
}
+ /**
+ * Set the session identifier.
+ *
+ * @param sessionId Session identifier
+ */
public void setSessionId(String sessionId) {
this.sessionId = sessionId;
if (sessionId == null) {
@@ -269,10 +408,18 @@ public class DeltaRequest implements Externalizable {
}
}
+ /**
+ * Get the number of actions recorded.
+ *
+ * @return Number of actions
+ */
public int getSize() {
return actions.size();
}
+ /**
+ * Clear all actions and the action pool.
+ */
public void clear() {
actions.clear();
actionPool.clear();
diff --git a/java/org/apache/catalina/ha/session/DeltaSession.java b/java/org/apache/catalina/ha/session/DeltaSession.java
index fe3e42bff6..9a029a8df1 100644
--- a/java/org/apache/catalina/ha/session/DeltaSession.java
+++ b/java/org/apache/catalina/ha/session/DeltaSession.java
@@ -53,6 +53,9 @@ import org.apache.tomcat.util.res.StringManager;
*/
public class DeltaSession extends StandardSession implements Externalizable, ClusterSession, ReplicatedMapEntry {
+ /**
+ * The logger for this class.
+ */
public static final Log log = LogFactory.getLog(DeltaSession.class);
/**
@@ -80,12 +83,18 @@ public class DeltaSession extends StandardSession implements Externalizable, Clu
private transient long lastTimeReplicated = System.currentTimeMillis();
+ /**
+ * Write lock used to protect delta operations.
+ */
protected final Lock diffLock = new ReentrantReadWriteLock().writeLock();
private long version;
// ----------------------------------------------------------- Constructors
+ /**
+ * Default constructor required by {@link java.io.Externalizable}.
+ */
public DeltaSession() {
this(null);
}
@@ -106,9 +115,14 @@ public class DeltaSession extends StandardSession implements Externalizable, Clu
return createRequest(null, false);
}
- /*
- * DeltaRequest instances are created via this protected method to enable subclasses to over-ride the method to use
+ /**
+ * Create a DeltaRequest instance. This protected method enables subclasses to override and use
* custom DeltaRequest implementations.
+ *
+ * @param sessionId Session identifier
+ * @param recordAllActions Record all actions, including duplicates
+ *
+ * @return New DeltaRequest instance
*/
protected DeltaRequest createRequest(String sessionId, boolean recordAllActions) {
return new DeltaRequest(sessionId, recordAllActions);
@@ -155,6 +169,11 @@ public class DeltaSession extends StandardSession implements Externalizable, Clu
return result;
}
+ /**
+ * Get the class loaders used for deserialization.
+ *
+ * @return Class loaders or {@code null} if none available
+ */
public ClassLoader[] getClassLoaders() {
if (manager instanceof ClusterManagerBase) {
return ((ClusterManagerBase) manager).getClassLoaders();
@@ -290,6 +309,12 @@ public class DeltaSession extends StandardSession implements Externalizable, Clu
}
+ /**
+ * Set the maximum inactive interval.
+ *
+ * @param interval Max inactive interval in seconds
+ * @param addDeltaRequest Whether to add a delta request entry
+ */
public void setMaxInactiveInterval(int interval, boolean addDeltaRequest) {
super.maxInactiveInterval = interval;
if (addDeltaRequest) {
@@ -307,6 +332,12 @@ public class DeltaSession extends StandardSession implements Externalizable, Clu
setNew(isNew, true);
}
+ /**
+ * Set the new flag.
+ *
+ * @param isNew New flag value
+ * @param addDeltaRequest Whether to add a delta request entry
+ */
public void setNew(boolean isNew, boolean addDeltaRequest) {
super.setNew(isNew);
if (addDeltaRequest) {
@@ -324,6 +355,12 @@ public class DeltaSession extends StandardSession implements Externalizable, Clu
setPrincipal(principal, true);
}
+ /**
+ * Set the session principal.
+ *
+ * @param principal Session principal
+ * @param addDeltaRequest Whether to add a delta request entry
+ */
public void setPrincipal(Principal principal, boolean addDeltaRequest) {
lockInternal();
try {
@@ -341,6 +378,12 @@ public class DeltaSession extends StandardSession implements Externalizable, Clu
setAuthType(authType, true);
}
+ /**
+ * Set the authentication type.
+ *
+ * @param authType Authentication type
+ * @param addDeltaRequest Whether to add a delta request entry
+ */
public void setAuthType(String authType, boolean addDeltaRequest) {
lockInternal();
try {
@@ -399,6 +442,12 @@ public class DeltaSession extends StandardSession implements Externalizable, Clu
expire(notify, true);
}
+ /**
+ * Expire this session.
+ *
+ * @param notify Whether to notify session listeners
+ * @param notifyCluster Whether to notify the cluster of expiration
+ */
public void expire(boolean notify, boolean notifyCluster) {
// Check to see if session has already been invalidated.
@@ -466,6 +515,12 @@ public class DeltaSession extends StandardSession implements Externalizable, Clu
addSessionListener(listener, true);
}
+ /**
+ * Add a session listener.
+ *
+ * @param listener Session listener to add
+ * @param addDeltaRequest Whether to add a delta request entry
+ */
public void addSessionListener(SessionListener listener, boolean addDeltaRequest) {
lockInternal();
try {
@@ -483,6 +538,12 @@ public class DeltaSession extends StandardSession implements Externalizable, Clu
removeSessionListener(listener, true);
}
+ /**
+ * Remove a session listener.
+ *
+ * @param listener Session listener to remove
+ * @param addDeltaRequest Whether to add a delta request entry
+ */
public void removeSessionListener(SessionListener listener, boolean addDeltaRequest) {
lockInternal();
try {
@@ -514,6 +575,14 @@ public class DeltaSession extends StandardSession implements Externalizable, Clu
doReadObject((ObjectInput) stream);
}
+ /**
+ * Read object data from the given input stream.
+ *
+ * @param stream Input stream to read from
+ *
+ * @throws ClassNotFoundException If a class is not found
+ * @throws IOException If an I/O error occurs
+ */
public void readObjectData(ObjectInput stream) throws ClassNotFoundException, IOException {
doReadObject(stream);
}
@@ -523,10 +592,20 @@ public class DeltaSession extends StandardSession implements Externalizable, Clu
writeObjectData((ObjectOutput) stream);
}
+ /**
+ * Write object data to the given output stream.
+ *
+ * @param stream Output stream to write to
+ *
+ * @throws IOException If an I/O error occurs
+ */
public void writeObjectData(ObjectOutput stream) throws IOException {
doWriteObject(stream);
}
+ /**
+ * Reset the delta request, clearing all recorded actions.
+ */
public void resetDeltaRequest() {
lockInternal();
try {
@@ -570,6 +649,14 @@ public class DeltaSession extends StandardSession implements Externalizable, Clu
}
+ /**
+ * Deserialize a delta request and execute its actions on this session.
+ *
+ * @param delta Serialized delta request data
+ *
+ * @throws IOException If an I/O error occurs
+ * @throws ClassNotFoundException If a class is not found
+ */
protected void deserializeAndExecuteDeltaRequest(byte[] delta) throws IOException, ClassNotFoundException {
if (manager instanceof ClusterManagerBase) {
SynchronizedStack<DeltaRequest> deltaRequestPool = ((ClusterManagerBase) manager).getDeltaRequestPool();
@@ -607,6 +694,15 @@ public class DeltaSession extends StandardSession implements Externalizable, Clu
removeAttribute(name, notify, true);
}
+ /**
+ * Remove an attribute from this session.
+ *
+ * @param name Attribute name
+ * @param notify Whether to notify listeners
+ * @param addDeltaRequest Whether to add a delta request entry
+ *
+ * @throws IllegalStateException If this session is no longer valid
+ */
public void removeAttribute(String name, boolean notify, boolean addDeltaRequest) {
// Validate our current state
if (!isValid()) {
@@ -620,6 +716,16 @@ public class DeltaSession extends StandardSession implements Externalizable, Clu
setAttribute(name, value, true, true);
}
+ /**
+ * Set an attribute on this session.
+ *
+ * @param name Attribute name
+ * @param value Attribute value
+ * @param notify Whether to notify listeners
+ * @param addDeltaRequest Whether to add a delta request entry
+ *
+ * @throws IllegalArgumentException If name is null
+ */
public void setAttribute(String name, Object value, boolean notify, boolean addDeltaRequest) {
// Name cannot be null
@@ -650,6 +756,12 @@ public class DeltaSession extends StandardSession implements Externalizable, Clu
removeNote(name, true);
}
+ /**
+ * Remove a note from this session.
+ *
+ * @param name Note name
+ * @param addDeltaRequest Whether to add a delta request entry
+ */
public void removeNote(String name, boolean addDeltaRequest) {
lockInternal();
try {
@@ -668,6 +780,13 @@ public class DeltaSession extends StandardSession implements Externalizable, Clu
setNote(name, value, true);
}
+ /**
+ * Set a note on this session.
+ *
+ * @param name Note name
+ * @param value Note value
+ * @param addDeltaRequest Whether to add a delta request entry
+ */
public void setNote(String name, Object value, boolean addDeltaRequest) {
if (value == null) {
@@ -863,6 +982,13 @@ public class DeltaSession extends StandardSession implements Externalizable, Clu
// -------------------------------------------------------- Private Methods
+ /**
+ * Remove an attribute from this session without additional validation.
+ *
+ * @param name Attribute name
+ * @param notify Whether to notify listeners
+ * @param addDeltaRequest Whether to add a delta request entry
+ */
protected void removeAttributeInternal(String name, boolean notify, boolean addDeltaRequest) {
lockInternal();
try {
@@ -902,6 +1028,11 @@ public class DeltaSession extends StandardSession implements Externalizable, Clu
this.version = version;
}
+ /**
+ * Set the access count for this session.
+ *
+ * @param count Access count value
+ */
protected void setAccessCount(int count) {
if (accessCount == null && activityCheck) {
accessCount = new AtomicInteger();
diff --git a/java/org/apache/catalina/ha/tcp/Constants.java b/java/org/apache/catalina/ha/tcp/Constants.java
index 5a76fae098..240bf5952d 100644
--- a/java/org/apache/catalina/ha/tcp/Constants.java
+++ b/java/org/apache/catalina/ha/tcp/Constants.java
@@ -21,6 +21,15 @@ package org.apache.catalina.ha.tcp;
*/
public class Constants {
+ /**
+ * Prevents instantiation.
+ */
+ private Constants() {
+ }
+
+ /**
+ * The fully qualified name of this package.
+ */
public static final String Package = "org.apache.catalina.ha.tcp";
}
diff --git a/java/org/apache/catalina/loader/JdbcLeakPrevention.java b/java/org/apache/catalina/loader/JdbcLeakPrevention.java
index a292505123..99befc01f6 100644
--- a/java/org/apache/catalina/loader/JdbcLeakPrevention.java
+++ b/java/org/apache/catalina/loader/JdbcLeakPrevention.java
@@ -34,6 +34,18 @@ import java.util.Set;
*/
public class JdbcLeakPrevention {
+ /**
+ * Constructs a new JdbcLeakPrevention.
+ */
+ public JdbcLeakPrevention() {
+ }
+
+ /**
+ * Clear JDBC driver registrations to prevent memory leaks.
+ *
+ * @return the list of driver names that were deregistered
+ * @throws SQLException if a database access error occurs
+ */
public List<String> clearJdbcDriverRegistrations() throws SQLException {
List<String> driverNames = new ArrayList<>();
diff --git a/java/org/apache/catalina/loader/WebappClassLoaderBase.java b/java/org/apache/catalina/loader/WebappClassLoaderBase.java
index 59970af662..81e4801a83 100644
--- a/java/org/apache/catalina/loader/WebappClassLoaderBase.java
+++ b/java/org/apache/catalina/loader/WebappClassLoaderBase.java
@@ -421,7 +421,9 @@ public abstract class WebappClassLoaderBase extends URLClassLoader
/**
- * @return the context name for this class loader.
+ * Get the context name for this class loader.
+ *
+ * @return the context name
*/
public String getContextName() {
if (resources == null) {
@@ -520,7 +522,9 @@ public abstract class WebappClassLoaderBase extends URLClassLoader
/**
- * @return the clearReferencesStopThreads flag for this Context.
+ * Get the clearReferencesStopThreads flag for this Context.
+ *
+ * @return the clearReferencesStopThreads flag
*/
public boolean getClearReferencesStopThreads() {
return this.clearReferencesStopThreads;
@@ -538,7 +542,9 @@ public abstract class WebappClassLoaderBase extends URLClassLoader
/**
- * @return the clearReferencesStopTimerThreads flag for this Context.
+ * Get the clearReferencesStopTimerThreads flag for this Context.
+ *
+ * @return the clearReferencesStopTimerThreads flag
*/
public boolean getClearReferencesStopTimerThreads() {
return this.clearReferencesStopTimerThreads;
@@ -556,7 +562,9 @@ public abstract class WebappClassLoaderBase extends URLClassLoader
/**
- * @return the clearReferencesLogFactoryRelease flag for this Context.
+ * Get the clearReferencesLogFactoryRelease flag for this Context.
+ *
+ * @return the clearReferencesLogFactoryRelease flag
*/
public boolean getClearReferencesLogFactoryRelease() {
return this.clearReferencesLogFactoryRelease;
@@ -574,7 +582,9 @@ public abstract class WebappClassLoaderBase extends URLClassLoader
/**
- * @return the clearReferencesHttpClientKeepAliveThread flag for this Context.
+ * Get the clearReferencesHttpClientKeepAliveThread flag for this Context.
+ *
+ * @return the clearReferencesHttpClientKeepAliveThread flag
*/
public boolean getClearReferencesHttpClientKeepAliveThread() {
return this.clearReferencesHttpClientKeepAliveThread;
diff --git a/java/org/apache/catalina/manager/Constants.java b/java/org/apache/catalina/manager/Constants.java
index 7081b6bfd5..c195fd3d88 100644
--- a/java/org/apache/catalina/manager/Constants.java
+++ b/java/org/apache/catalina/manager/Constants.java
@@ -17,18 +17,60 @@
package org.apache.catalina.manager;
+/**
+ * Constants used by the manager web application.
+ */
public class Constants {
+ /**
+ * Prevents instantiation.
+ */
+ private Constants() {
+ }
+
+ /**
+ * The fully qualified name of this package.
+ */
public static final String Package = "org.apache.catalina.manager";
+ /**
+ * The HTML rel attribute value for external links.
+ */
public static final String REL_EXTERNAL = "rel=\"noopener noreferrer\"";
+ /**
+ * The HTML header section template for manager pages.
+ */
public static final String HTML_HEADER_SECTION;
+
+ /**
+ * The HTML body header section template for manager pages.
+ */
public static final String BODY_HEADER_SECTION;
+
+ /**
+ * The HTML message section template for manager pages.
+ */
public static final String MESSAGE_SECTION;
+
+ /**
+ * The HTML manager section template for manager pages.
+ */
public static final String MANAGER_SECTION;
+
+ /**
+ * The HTML server header section template for manager pages.
+ */
public static final String SERVER_HEADER_SECTION;
+
+ /**
+ * The HTML server row section template for manager pages.
+ */
public static final String SERVER_ROW_SECTION;
+
+ /**
+ * The HTML tail section template for manager pages.
+ */
public static final String HTML_TAIL_SECTION;
static {
@@ -139,9 +181,18 @@ public class Constants {
//@formatter:on
}
+ /**
+ * The character set used by the manager application.
+ */
public static final String CHARSET = "utf-8";
+ /**
+ * The XML declaration used in manager responses.
+ */
public static final String XML_DECLARATION = "<?xml version=\"1.0\" encoding=\"" + CHARSET + "\"?>";
+ /**
+ * The XML stylesheet processing instruction used in manager responses.
+ */
public static final String XML_STYLE = "<?xml-stylesheet type=\"text/xsl\" href=\"{0}/xform.xsl\" ?>\n";
}
diff --git a/java/org/apache/catalina/manager/DummyProxySession.java b/java/org/apache/catalina/manager/DummyProxySession.java
index 30b1faed95..dddda3fdfd 100644
--- a/java/org/apache/catalina/manager/DummyProxySession.java
+++ b/java/org/apache/catalina/manager/DummyProxySession.java
@@ -25,10 +25,18 @@ import org.apache.catalina.Manager;
import org.apache.catalina.Session;
import org.apache.catalina.SessionListener;
+/**
+ * A dummy proxy session used for testing purposes.
+ */
public class DummyProxySession implements Session {
private String sessionId;
+ /**
+ * Construct a DummyProxySession with the given session ID.
+ *
+ * @param sessionId The session identifier
+ */
public DummyProxySession(String sessionId) {
this.sessionId = sessionId;
}
diff --git a/java/org/apache/catalina/manager/HTMLManagerServlet.java b/java/org/apache/catalina/manager/HTMLManagerServlet.java
index 896264914f..e2f14203db 100644
--- a/java/org/apache/catalina/manager/HTMLManagerServlet.java
+++ b/java/org/apache/catalina/manager/HTMLManagerServlet.java
@@ -66,6 +66,12 @@ import org.apache.tomcat.util.security.Escape;
*/
public class HTMLManagerServlet extends ManagerServlet {
+ /**
+ * Constructs a new HTMLManagerServlet.
+ */
+ public HTMLManagerServlet() {
+ }
+
private static final long serialVersionUID = 1L;
static final String APPLICATION_MESSAGE = "message";
@@ -200,6 +206,14 @@ public class HTMLManagerServlet extends ManagerServlet {
}
+ /**
+ * Upload a WAR file for deployment.
+ *
+ * @param request the HTTP servlet request
+ * @param smClient internationalized strings
+ *
+ * @return message string describing the result of the upload
+ */
protected String upload(HttpServletRequest request, StringManager smClient) {
String message = "";
@@ -695,6 +709,14 @@ public class HTMLManagerServlet extends ManagerServlet {
}
+ /**
+ * Reload SSL configuration for the specified host.
+ *
+ * @param tlsHostName the TLS host name
+ * @param smClient internationalized strings
+ *
+ * @return message string describing the result
+ */
protected String sslReload(String tlsHostName, StringManager smClient) {
StringWriter stringWriter = new StringWriter();
PrintWriter printWriter = new PrintWriter(stringWriter);
@@ -705,6 +727,16 @@ public class HTMLManagerServlet extends ManagerServlet {
}
+ /**
+ * Display SSL connector cipher information.
+ *
+ * @param request the HTTP servlet request
+ * @param response the HTTP servlet response
+ * @param smClient internationalized strings
+ *
+ * @throws ServletException a servlet error occurred
+ * @throws IOException an I/O error occurred
+ */
protected void sslConnectorCiphers(HttpServletRequest request, HttpServletResponse response, StringManager smClient)
throws ServletException, IOException {
request.setAttribute("cipherList", getConnectorCiphers(smClient));
@@ -712,6 +744,16 @@ public class HTMLManagerServlet extends ManagerServlet {
}
+ /**
+ * Display SSL connector certificate information.
+ *
+ * @param request the HTTP servlet request
+ * @param response the HTTP servlet response
+ * @param smClient internationalized strings
+ *
+ * @throws ServletException a servlet error occurred
+ * @throws IOException an I/O error occurred
+ */
protected void sslConnectorCerts(HttpServletRequest request, HttpServletResponse response, StringManager smClient)
throws ServletException, IOException {
request.setAttribute("certList", getConnectorCerts(smClient));
@@ -719,6 +761,16 @@ public class HTMLManagerServlet extends ManagerServlet {
}
+ /**
+ * Display SSL connector trusted certificate information.
+ *
+ * @param request the HTTP servlet request
+ * @param response the HTTP servlet response
+ * @param smClient internationalized strings
+ *
+ * @throws ServletException a servlet error occurred
+ * @throws IOException an I/O error occurred
+ */
protected void sslConnectorTrustedCerts(HttpServletRequest request, HttpServletResponse response,
StringManager smClient) throws ServletException, IOException {
request.setAttribute("trustedCertList", getConnectorTrustedCerts(smClient));
@@ -806,6 +858,14 @@ public class HTMLManagerServlet extends ManagerServlet {
displaySessionsListPage(cn, req, resp, smClient);
}
+ /**
+ * Get all sessions for the specified context.
+ *
+ * @param cn the context name
+ * @param smClient internationalized strings
+ *
+ * @return list of sessions for the context
+ */
protected List<Session> getSessionsForName(ContextName cn, StringManager smClient) {
if (cn == null || !(cn.getPath().startsWith("/") || cn.getPath().isEmpty())) {
String path = null;
@@ -838,6 +898,15 @@ public class HTMLManagerServlet extends ManagerServlet {
return sessions;
}
+ /**
+ * Get a specific session by ID for the specified context.
+ *
+ * @param cn the context name
+ * @param id the session ID
+ * @param smClient internationalized strings
+ *
+ * @return the session, or {@code null} if not found
+ */
protected Session getSessionForNameAndId(ContextName cn, String id, StringManager smClient) {
List<Session> sessions = getSessionsForName(cn, smClient);
@@ -996,6 +1065,13 @@ public class HTMLManagerServlet extends ManagerServlet {
return wasPresent;
}
+ /**
+ * Get a comparator for sessions based on the specified sort criteria.
+ *
+ * @param sortBy the sort criteria
+ *
+ * @return the comparator, or {@code null} if the sort criteria is not recognized
+ */
protected Comparator<Session> getComparator(String sortBy) {
if ("CreationTime".equalsIgnoreCase(sortBy)) {
return Comparator.comparingLong(Session::getCreationTime);
diff --git a/java/org/apache/catalina/manager/JMXProxyServlet.java b/java/org/apache/catalina/manager/JMXProxyServlet.java
index d948a9a659..5a9b5cc900 100644
--- a/java/org/apache/catalina/manager/JMXProxyServlet.java
+++ b/java/org/apache/catalina/manager/JMXProxyServlet.java
@@ -46,6 +46,12 @@ import org.apache.tomcat.util.res.StringManager;
*/
public class JMXProxyServlet extends HttpServlet {
+ /**
+ * Constructs a new JMXProxyServlet.
+ */
+ public JMXProxyServlet() {
+ }
+
private static final long serialVersionUID = 1L;
// Constant for "no parameters" when invoking a JMX operation
@@ -59,6 +65,9 @@ public class JMXProxyServlet extends HttpServlet {
* MBean server.
*/
protected transient MBeanServer mBeanServer = null;
+ /**
+ * The MBean registry.
+ */
protected transient Registry registry;
@@ -116,6 +125,14 @@ public class JMXProxyServlet extends HttpServlet {
}
+ /**
+ * Get an MBean attribute value.
+ *
+ * @param writer the output writer
+ * @param onameStr the MBean object name
+ * @param att the attribute name
+ * @param key the key for composite data, or {@code null}
+ */
public void getAttribute(PrintWriter writer, String onameStr, String att, String key) {
try {
ObjectName oname = new ObjectName(onameStr);
@@ -153,6 +170,14 @@ public class JMXProxyServlet extends HttpServlet {
}
+ /**
+ * Set an MBean attribute value.
+ *
+ * @param writer the output writer
+ * @param onameStr the MBean object name
+ * @param att the attribute name
+ * @param val the attribute value
+ */
public void setAttribute(PrintWriter writer, String onameStr, String att, String val) {
try {
setAttributeInternal(onameStr, att, val);
@@ -164,6 +189,12 @@ public class JMXProxyServlet extends HttpServlet {
}
+ /**
+ * List MBeans matching the query.
+ *
+ * @param writer the output writer
+ * @param qry the query string
+ */
public void listBeans(PrintWriter writer, String qry) {
Set<ObjectName> names;
diff --git a/java/org/apache/catalina/manager/JspHelper.java b/java/org/apache/catalina/manager/JspHelper.java
index 809ba65375..5321670b63 100644
--- a/java/org/apache/catalina/manager/JspHelper.java
+++ b/java/org/apache/catalina/manager/JspHelper.java
@@ -76,6 +76,12 @@ public class JspHelper {
}
+ /**
+ * Returns the formatted creation time for the given session.
+ *
+ * @param in_session the session
+ * @return the formatted creation time, or empty string if invalid
+ */
public static String getDisplayCreationTimeForSession(Session in_session) {
try {
if (in_session.getCreationTime() == 0) {
@@ -89,6 +95,12 @@ public class JspHelper {
}
}
+ /**
+ * Returns the formatted last accessed time for the given session.
+ *
+ * @param in_session the session
+ * @return the formatted last accessed time, or empty string if invalid
+ */
public static String getDisplayLastAccessedTimeForSession(Session in_session) {
try {
if (in_session.getLastAccessedTime() == 0) {
@@ -102,6 +114,12 @@ public class JspHelper {
}
}
+ /**
+ * Returns the formatted total used time for the given session.
+ *
+ * @param in_session the session
+ * @return the formatted used time string
+ */
public static String getDisplayUsedTimeForSession(Session in_session) {
try {
if (in_session.getCreationTime() == 0) {
@@ -114,6 +132,12 @@ public class JspHelper {
return secondsToTimeString(SessionUtils.getUsedTimeForSession(in_session) / 1000);
}
+ /**
+ * Returns the formatted time-to-live for the given session.
+ *
+ * @param in_session the session
+ * @return the formatted TTL string
+ */
public static String getDisplayTTLForSession(Session in_session) {
try {
if (in_session.getCreationTime() == 0) {
@@ -126,6 +150,12 @@ public class JspHelper {
return secondsToTimeString(SessionUtils.getTTLForSession(in_session) / 1000);
}
+ /**
+ * Returns the formatted inactive time for the given session.
+ *
+ * @param in_session the session
+ * @return the formatted inactive time string
+ */
public static String getDisplayInactiveTimeForSession(Session in_session) {
try {
if (in_session.getCreationTime() == 0) {
@@ -138,6 +168,12 @@ public class JspHelper {
return secondsToTimeString(SessionUtils.getInactiveTimeForSession(in_session) / 1000);
}
+ /**
+ * Converts a number of seconds to a formatted time string in HH:mm:ss format.
+ *
+ * @param in_seconds the number of seconds
+ * @return the formatted time string
+ */
public static String secondsToTimeString(long in_seconds) {
StringBuilder buff = new StringBuilder(9);
if (in_seconds < 0) {
@@ -182,6 +218,12 @@ public class JspHelper {
specialCharactersRepresentation['\''] = "'".toCharArray();
}
+ /**
+ * Escapes XML special characters in the given object's string representation.
+ *
+ * @param obj the object to escape
+ * @return the escaped XML string
+ */
public static String escapeXml(Object obj) {
String value = null;
try {
@@ -215,6 +257,12 @@ public class JspHelper {
return Escape.xml(buffer);
}
+ /**
+ * Formats a long number using the default locale's number format.
+ *
+ * @param number the number to format
+ * @return the formatted number string
+ */
public static String formatNumber(long number) {
return NumberFormat.getNumberInstance().format(number);
}
diff --git a/java/org/apache/catalina/manager/host/Constants.java b/java/org/apache/catalina/manager/host/Constants.java
index 8c007b2c63..ababa4fe1b 100644
--- a/java/org/apache/catalina/manager/host/Constants.java
+++ b/java/org/apache/catalina/manager/host/Constants.java
@@ -17,13 +17,31 @@
package org.apache.catalina.manager.host;
+/**
+ * Constants used by the host manager web application.
+ */
public class Constants {
+ /**
+ * Prevents instantiation.
+ */
+ private Constants() {
+ }
+
+ /**
+ * The fully qualified name of this package.
+ */
public static final String Package = "org.apache.catalina.manager.host";
+ /**
+ * The HTML rel attribute value for external links.
+ */
public static final String REL_EXTERNAL = org.apache.catalina.manager.Constants.REL_EXTERNAL;
//@formatter:off
+ /**
+ * The HTML message section template for host manager pages.
+ */
public static final String MESSAGE_SECTION =
"<table border=\"1\" cellspacing=\"0\" cellpadding=\"3\">\n" +
" <tr>\n" +
@@ -35,6 +53,9 @@ public class Constants {
"<br>\n" +
"\n";
+ /**
+ * The HTML manager section template for host manager pages.
+ */
public static final String MANAGER_SECTION =
"<table border=\"1\" cellspacing=\"0\" cellpadding=\"3\">\n" +
"<tr>\n" +
@@ -50,6 +71,9 @@ public class Constants {
"<br>\n" +
"\n";
+ /**
+ * The HTML server header section template for host manager pages.
+ */
public static final String SERVER_HEADER_SECTION =
"<table border=\"1\" cellspacing=\"0\" cellpadding=\"3\">\n" +
"<tr>\n" +
@@ -64,6 +88,9 @@ public class Constants {
" <td class=\"header-center\"><small>{6}</small></td>\n" +
"</tr>\n";
... 31113 lines suppressed ...
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org