Class AprLifecycleListener
java.lang.Object
org.apache.catalina.core.AprLifecycleListener
- All Implemented Interfaces:
LifecycleListener
Implementation of
LifecycleListener that will init and destroy APR.
This listener must only be nested within Server elements.
Only one instance of the APR/Native library may be loaded per JVM. Loading multiple instances will trigger a JVM crash - typically when the Connectors are destroyed. This listener utilises reference counting to ensure that only one instance of the APR/Native library is loaded at any one time.
If multiple listener configurations are found, only the first one initialised will be used.
- Since:
- 4.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static StringFIPS mode configuration.protected static booleanIndicates whether FIPS mode is currently active.protected static final StringManagerThe string manager for this package.protected static StringSSL engine configuration.protected static booleanIndicates whether SSL has been initialized.protected static StringSSL random seed source.protected static final intRecommended major version of Tomcat Native.protected static final intRecommended minor version of Tomcat Native.protected static final intRecommended patch version of Tomcat Native.protected static final intRequired major version of Tomcat Native.protected static final intRequired minor version of Tomcat Native.protected static final intRequired patch version of Tomcat Native. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the FIPS mode configuration.static StringGet the installed APR version string, if available.static StringGet the installed OpenSSL version string (via APR), if available.static StringGet the installed Tomcat Native version string, if available.Returns the SSL engine configuration.Returns the SSL random seed source.static StringGet a warning message if the installed Tomcat Native version is older than recommended.static booleanReturns whether OpenSSL is in use.static booleanChecks APR availability, initializing if necessary.booleanReturns whether FIPS mode is currently active.static booleanReturns whether an APR instance has been created.voidlifecycleEvent(LifecycleEvent event) Primary entry point for startup and shutdown events.voidsetFIPSMode(String FIPSMode) Sets the FIPS mode configuration.voidsetSSLEngine(String SSLEngine) Sets the SSL engine configuration.voidsetSSLRandomSeed(String SSLRandomSeed) Sets the SSL random seed source.voidsetUseOpenSSL(boolean useOpenSSL) Configures whether to use OpenSSL.
-
Field Details
-
sm
The string manager for this package. -
TCN_REQUIRED_MAJOR
protected static final int TCN_REQUIRED_MAJORRequired major version of Tomcat Native.- See Also:
-
TCN_REQUIRED_MINOR
protected static final int TCN_REQUIRED_MINORRequired minor version of Tomcat Native.- See Also:
-
TCN_REQUIRED_PATCH
protected static final int TCN_REQUIRED_PATCHRequired patch version of Tomcat Native.- See Also:
-
TCN_RECOMMENDED_MAJOR
protected static final int TCN_RECOMMENDED_MAJORRecommended major version of Tomcat Native.- See Also:
-
TCN_RECOMMENDED_MINOR
protected static final int TCN_RECOMMENDED_MINORRecommended minor version of Tomcat Native.- See Also:
-
TCN_RECOMMENDED_PV
protected static final int TCN_RECOMMENDED_PVRecommended patch version of Tomcat Native.- See Also:
-
SSLEngine
SSL engine configuration. -
FIPSMode
FIPS mode configuration. -
SSLRandomSeed
SSL random seed source. -
sslInitialized
protected static boolean sslInitializedIndicates whether SSL has been initialized. -
fipsModeActive
protected static boolean fipsModeActiveIndicates whether FIPS mode is currently active.
-
-
Constructor Details
-
AprLifecycleListener
public AprLifecycleListener()Constructs a new AprLifecycleListener.
-
-
Method Details
-
isAprAvailable
public static boolean isAprAvailable()Checks APR availability, initializing if necessary.- Returns:
trueif APR is available
-
getInstalledTcnVersion
Get the installed Tomcat Native version string, if available.- Returns:
- the version string, or null if APR is not available
-
getInstalledAprVersion
Get the installed APR version string, if available.- Returns:
- the APR version string, or null if APR is not available
-
getInstalledOpenSslVersion
Get the installed OpenSSL version string (via APR), if available.- Returns:
- the OpenSSL version string, or null if not available
-
getTcnVersionWarning
Get a warning message if the installed Tomcat Native version is older than recommended. This performs the same version check used during Tomcat startup.- Returns:
- a warning message if the installed version is outdated, or null if the version is acceptable or APR is not available
-
lifecycleEvent
Primary entry point for startup and shutdown events.- Specified by:
lifecycleEventin interfaceLifecycleListener- Parameters:
event- The event that has occurred
-
getSSLEngine
Returns the SSL engine configuration.- Returns:
- the SSL engine configuration
-
setSSLEngine
Sets the SSL engine configuration.- Parameters:
SSLEngine- the SSL engine configuration
-
getSSLRandomSeed
Returns the SSL random seed source.- Returns:
- the SSL random seed source
-
setSSLRandomSeed
Sets the SSL random seed source.- Parameters:
SSLRandomSeed- the SSL random seed source
-
getFIPSMode
Returns the FIPS mode configuration.- Returns:
- the FIPS mode configuration
-
setFIPSMode
Sets the FIPS mode configuration.- Parameters:
FIPSMode- the FIPS mode configuration
-
isFIPSModeActive
public boolean isFIPSModeActive()Returns whether FIPS mode is currently active.- Returns:
trueif FIPS mode is active
-
setUseOpenSSL
public void setUseOpenSSL(boolean useOpenSSL) Configures whether to use OpenSSL.- Parameters:
useOpenSSL-trueto use OpenSSL
-
getUseOpenSSL
public static boolean getUseOpenSSL()Returns whether OpenSSL is in use.- Returns:
trueif OpenSSL is in use
-
isInstanceCreated
public static boolean isInstanceCreated()Returns whether an APR instance has been created.- Returns:
trueif an APR instance has been created
-