|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.catalina.mbeans.JMXAdaptorLifecycleListener
Start JSR160 JMX Adapter with naming and jmx port! Add only as Server Listner
to your tomcat server.xml
<Server ...> ... <Listener className="org.apache.catalina.mbeans.JMXAdaptorLifecycleListener"You can use normal jmx system properties from command line or jmx config file:
namingPort="8083" port="8084" host="myhost" /> ... </Server>
-Dcom.sun.management.jmxremote.authenticate=true
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.access.file=$CATALINA_BASE/conf/access.file
-Dcom.sun.management.jmxremote.password.file=$CATALINA_BASE/conf/password.file
-Dcom.sun.management.config.file=$CATALINA_BASE/conf/jmx.properties
jconsole service:jmx:rmi://myhost:8084/jndi/rmi://myhost:8083/server
It would be be better if this was built into Tomcat as a configuration option, rather than having to do it as part of every Tomcat instance.
Origanal code idea comes from George Lindholm read
Tomcat Bug 39055
and other helpful links are:
Constructor Summary | |
JMXAdaptorLifecycleListener()
create new jmx adaptor and read properties from file. |
Method Summary | |
protected java.lang.String |
getConfigProperty(java.lang.String name)
get jmx config parameter from jmx config file or system property. |
java.lang.String |
getHost()
|
java.lang.String |
getInfo()
Return descriptive information about this Listener implementation and the corresponding version number, in the format <description>/<version> . |
java.lang.String |
getJmxUrl()
|
int |
getNamingPort()
|
int |
getPort()
|
boolean |
isEnabled()
|
void |
lifecycleEvent(LifecycleEvent event)
Acknowledge the occurrence of the specified event. |
void |
setEnabled(boolean enabled)
|
void |
setHost(java.lang.String host)
|
void |
setNamingPort(int namingPort)
|
void |
setPort(int port)
|
void |
start()
Start JMX connector and local name registry |
protected void |
stop()
stop jmx connector at tomcat normale shutdown |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JMXAdaptorLifecycleListener()
-Dcom.sun.management.config.file=xxx
as file.
Method Detail |
public java.lang.String getHost()
public void setHost(java.lang.String host)
host
- The host to set.public int getPort()
public void setPort(int port)
port
- The port to set.public int getNamingPort()
public void setNamingPort(int namingPort)
namingPort
- The namingPort to set.public boolean isEnabled()
public void setEnabled(boolean enabled)
enabled
- The enabled to set.public java.lang.String getJmxUrl()
public java.lang.String getInfo()
<description>/<version>
.
public void lifecycleEvent(LifecycleEvent event)
LifecycleListener
lifecycleEvent
in interface LifecycleListener
event
- LifecycleEvent that has occurredprotected void stop()
protected java.lang.String getConfigProperty(java.lang.String name)
name
-
public void start()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |