Package org.apache.catalina.mbeans
Class JmxRemoteLifecycleListener
- java.lang.Object
-
- org.apache.catalina.mbeans.JmxRemoteLifecycleListener
-
- All Implemented Interfaces:
LifecycleListener
public class JmxRemoteLifecycleListener extends java.lang.Object 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJmxRemoteLifecycleListener.RmiClientLocalhostSocketFactorystatic classJmxRemoteLifecycleListener.RmiServerBindSocketFactorystatic classJmxRemoteLifecycleListener.SslRmiServerBindSocketFactory
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringaccessFileprotected booleanauthenticateprotected java.lang.String[]ciphersprotected booleanclientAuthprotected javax.management.remote.JMXConnectorServercsPlatformprotected java.lang.StringloginModuleNameprotected java.lang.StringpasswordFileprotected java.lang.String[]protocolsprotected java.lang.StringrmiBindAddressprotected intrmiRegistryPortPlatformprotected booleanrmiRegistrySSLprotected intrmiServerPortPlatformprotected booleanrmiServerSSLprotected static StringManagersmprotected booleanuseLocalPorts
-
Constructor Summary
Constructors Constructor Description JmxRemoteLifecycleListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetRmiBindAddress()Get the inet address on which the Platform RMI server is exported.intgetRmiRegistryPortPlatform()Get the port on which the Platform RMI registry is exported.intgetRmiServerPortPlatform()Get the port on which the Platform RMI server is exported.booleangetUseLocalPorts()Get the flag that indicates that local ports should be used for all connections.voidlifecycleEvent(LifecycleEvent event)Acknowledge the occurrence of the specified event.voidsetRmiBindAddress(java.lang.String theRmiBindAddress)Set the inet address on which the Platform RMI server is exported.voidsetRmiRegistryPortPlatform(int theRmiRegistryPortPlatform)Set the port on which the Platform RMI registry is exported.voidsetRmiServerPortPlatform(int theRmiServerPortPlatform)Set the port on which the Platform RMI server is exported.voidsetUseLocalPorts(boolean useLocalPorts)Set the flag that indicates that local ports should be used for all connections.
-
-
-
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
-
ciphers
protected java.lang.String[] ciphers
-
protocols
protected java.lang.String[] protocols
-
clientAuth
protected boolean clientAuth
-
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 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:
trueif 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 totrueif local ports should be used
-
lifecycleEvent
public void lifecycleEvent(LifecycleEvent event)
Description copied from interface:LifecycleListenerAcknowledge the occurrence of the specified event.- Specified by:
lifecycleEventin interfaceLifecycleListener- Parameters:
event- LifecycleEvent that has occurred
-
-