Package org.apache.catalina.mbeans
Class JmxRemoteLifecycleListener
- java.lang.Object
-
- org.apache.tomcat.util.net.SSLHostConfig
-
- org.apache.catalina.mbeans.JmxRemoteLifecycleListener
-
- All Implemented Interfaces:
java.io.Serializable
,LifecycleListener
public class JmxRemoteLifecycleListener extends SSLHostConfig implements LifecycleListener
This listener fixes the port used by JMX/RMI Server making things much simpler if you need to connect jconsole or similar to a remote Tomcat instance that is running behind a firewall. Only the ports are configured via the listener. The remainder of the configuration is via the standard system properties for configuring JMX.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JmxRemoteLifecycleListener.RmiClientLocalhostSocketFactory
static class
JmxRemoteLifecycleListener.RmiServerBindSocketFactory
static class
JmxRemoteLifecycleListener.SslRmiServerBindSocketFactory
-
Nested classes/interfaces inherited from class org.apache.tomcat.util.net.SSLHostConfig
SSLHostConfig.CertificateVerification, SSLHostConfig.Type
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
accessFile
protected boolean
authenticate
protected javax.management.remote.JMXConnectorServer
csPlatform
protected java.lang.String
loginModuleName
protected java.lang.String
passwordFile
protected java.lang.String
rmiBindAddress
protected int
rmiRegistryPortPlatform
protected boolean
rmiRegistrySSL
protected int
rmiServerPortPlatform
protected boolean
rmiServerSSL
protected static StringManager
sm
protected boolean
useLocalPorts
-
Fields inherited from class org.apache.tomcat.util.net.SSLHostConfig
DEFAULT_SSL_HOST_NAME, SSL_PROTO_ALL_SET
-
-
Constructor Summary
Constructors Constructor Description JmxRemoteLifecycleListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAccessFile()
java.lang.String
getLoginModuleName()
java.lang.String
getPasswordFile()
java.lang.String
getRmiBindAddress()
Get the inet address on which the Platform RMI server is exported.int
getRmiRegistryPortPlatform()
Get the port on which the Platform RMI registry is exported.int
getRmiServerPortPlatform()
Get the port on which the Platform RMI server is exported.boolean
getUseLocalPorts()
Get the flag that indicates that local ports should be used for all connections.protected void
init()
boolean
isAuthenticate()
boolean
isRmiRegistrySSL()
boolean
isRmiServerSSL()
void
lifecycleEvent(LifecycleEvent event)
Acknowledge the occurrence of the specified event.void
setAccessFile(java.lang.String accessFile)
void
setAuthenticate(boolean authenticate)
void
setLoginModuleName(java.lang.String loginModuleName)
void
setPasswordFile(java.lang.String passwordFile)
void
setRmiBindAddress(java.lang.String theRmiBindAddress)
Set the inet address on which the Platform RMI server is exported.void
setRmiRegistryPortPlatform(int theRmiRegistryPortPlatform)
Set the port on which the Platform RMI registry is exported.void
setRmiRegistrySSL(boolean rmiRegistrySSL)
void
setRmiServerPortPlatform(int theRmiServerPortPlatform)
Set the port on which the Platform RMI server is exported.void
setRmiServerSSL(boolean rmiServerSSL)
void
setUseLocalPorts(boolean useLocalPorts)
Set the flag that indicates that local ports should be used for all connections.-
Methods inherited from class org.apache.tomcat.util.net.SSLHostConfig
addCertificate, adjustRelativePath, getCaCertificateFile, getCaCertificatePath, getCertificateChainFile, getCertificateFile, getCertificateKeyAlias, getCertificateKeyFile, getCertificateKeyPassword, getCertificateKeystoreFile, getCertificateKeystorePassword, getCertificateKeystoreProvider, getCertificateKeystoreType, getCertificateRevocationListFile, getCertificateRevocationListPath, getCertificates, getCertificates, getCertificateVerification, getCertificateVerificationAsString, getCertificateVerificationDepth, getCipherList, getCiphers, getConfigType, getDisableCompression, getDisableSessionTickets, getEnabledCiphers, getEnabledProtocols, getHonorCipherOrder, getHostName, getInsecureRenegotiation, getJsseCipherNames, getKeyManagerAlgorithm, getObjectName, getOpenSslConf, getOpenSslConfContext, getOpenSslContext, getProtocols, getRevocationEnabled, getSessionCacheSize, getSessionTimeout, getSslProtocol, getTrustManagerClassName, getTruststore, getTruststoreAlgorithm, getTruststoreFile, getTruststorePassword, getTruststoreProvider, getTruststoreType, isCertificateVerificationDepthConfigured, setCaCertificateFile, setCaCertificatePath, setCertificateChainFile, setCertificateFile, setCertificateKeyAlias, setCertificateKeyFile, setCertificateKeyPassword, setCertificateKeystoreFile, setCertificateKeystorePassword, setCertificateKeystoreProvider, setCertificateKeystoreType, setCertificateRevocationListFile, setCertificateRevocationListPath, setCertificateVerification, setCertificateVerificationAsString, setCertificateVerificationDepth, setCiphers, setDisableCompression, setDisableSessionTickets, setEnabledCiphers, setEnabledProtocols, setHonorCipherOrder, setHostName, setInsecureRenegotiation, setKeyManagerAlgorithm, setObjectName, setOpenSslConf, setOpenSslConfContext, setOpenSslContext, setProtocols, setRevocationEnabled, setSessionCacheSize, setSessionTimeout, setSslProtocol, setTrustManagerClassName, setTrustStore, setTruststoreAlgorithm, setTruststoreFile, setTruststorePassword, setTruststoreProvider, setTruststoreType
-
-
-
-
Field Detail
-
sm
protected static final StringManager sm
-
rmiBindAddress
protected java.lang.String rmiBindAddress
-
rmiRegistryPortPlatform
protected int rmiRegistryPortPlatform
-
rmiServerPortPlatform
protected int rmiServerPortPlatform
-
rmiRegistrySSL
protected boolean rmiRegistrySSL
-
rmiServerSSL
protected boolean rmiServerSSL
-
authenticate
protected boolean authenticate
-
passwordFile
protected java.lang.String passwordFile
-
loginModuleName
protected java.lang.String loginModuleName
-
accessFile
protected java.lang.String accessFile
-
useLocalPorts
protected boolean useLocalPorts
-
csPlatform
protected transient javax.management.remote.JMXConnectorServer csPlatform
-
-
Method Detail
-
getRmiBindAddress
public java.lang.String getRmiBindAddress()
Get the inet address on which the Platform RMI server is exported.- Returns:
- The textual representation of inet address
-
setRmiBindAddress
public void setRmiBindAddress(java.lang.String theRmiBindAddress)
Set the inet address on which the Platform RMI server is exported.- Parameters:
theRmiBindAddress
- The textual representation of inet address
-
getRmiServerPortPlatform
public int getRmiServerPortPlatform()
Get the port on which the Platform RMI server is exported. This is the port that is normally chosen by the RMI stack.- Returns:
- The port number
-
setRmiServerPortPlatform
public void setRmiServerPortPlatform(int theRmiServerPortPlatform)
Set the port on which the Platform RMI server is exported. This is the port that is normally chosen by the RMI stack.- Parameters:
theRmiServerPortPlatform
- The port number
-
getRmiRegistryPortPlatform
public int getRmiRegistryPortPlatform()
Get the port on which the Platform RMI registry is exported.- Returns:
- The port number
-
setRmiRegistryPortPlatform
public void setRmiRegistryPortPlatform(int theRmiRegistryPortPlatform)
Set the port on which the Platform RMI registry is exported.- Parameters:
theRmiRegistryPortPlatform
- The port number
-
getUseLocalPorts
public boolean getUseLocalPorts()
Get the flag that indicates that local ports should be used for all connections. If using SSH tunnels, or similar, this should be set to true to ensure the RMI client uses the tunnel.- Returns:
true
if local ports should be used
-
setUseLocalPorts
public void setUseLocalPorts(boolean useLocalPorts)
Set the flag that indicates that local ports should be used for all connections. If using SSH tunnels, or similar, this should be set to true to ensure the RMI client uses the tunnel.- Parameters:
useLocalPorts
- Set totrue
if local ports should be used
-
isRmiRegistrySSL
public boolean isRmiRegistrySSL()
- Returns:
- the rmiRegistrySSL
-
setRmiRegistrySSL
public void setRmiRegistrySSL(boolean rmiRegistrySSL)
- Parameters:
rmiRegistrySSL
- the rmiRegistrySSL to set
-
isRmiServerSSL
public boolean isRmiServerSSL()
- Returns:
- the rmiServerSSL
-
setRmiServerSSL
public void setRmiServerSSL(boolean rmiServerSSL)
- Parameters:
rmiServerSSL
- the rmiServerSSL to set
-
isAuthenticate
public boolean isAuthenticate()
- Returns:
- the authenticate
-
setAuthenticate
public void setAuthenticate(boolean authenticate)
- Parameters:
authenticate
- the authenticate to set
-
getPasswordFile
public java.lang.String getPasswordFile()
- Returns:
- the passwordFile
-
setPasswordFile
public void setPasswordFile(java.lang.String passwordFile)
- Parameters:
passwordFile
- the passwordFile to set
-
getLoginModuleName
public java.lang.String getLoginModuleName()
- Returns:
- the loginModuleName
-
setLoginModuleName
public void setLoginModuleName(java.lang.String loginModuleName)
- Parameters:
loginModuleName
- the loginModuleName to set
-
getAccessFile
public java.lang.String getAccessFile()
- Returns:
- the accessFile
-
setAccessFile
public void setAccessFile(java.lang.String accessFile)
- Parameters:
accessFile
- the accessFile to set
-
init
protected void init()
-
lifecycleEvent
public void lifecycleEvent(LifecycleEvent event)
Description copied from interface:LifecycleListener
Acknowledge the occurrence of the specified event.- Specified by:
lifecycleEvent
in interfaceLifecycleListener
- Parameters:
event
- LifecycleEvent that has occurred
-
-