tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Gainty <mgai...@hotmail.com>
Subject RE: Another confused person trying to get jconsole to monitor tomcat.
Date Thu, 02 Oct 2008 19:39:47 GMT

http://www.jdocs.com/tomcat/6.0.14/org/apache/catalina/ServerFactory.html
ServerFactory.getServer() will return
org.apache.catalina.ServerFactory 

concerning LifecycleListener take a look at 
http://tomcat.apache.org/tomcat-5.5-doc/catalina/docs/api/org/apache/catalina/LifecycleListener.html

the events that the LifecycleListener reponds to are listed at
http://tomcat.apache.org/tomcat-5.5-doc/catalina/docs/api/org/apache/catalina/Lifecycle.html

a brief synopsis of the Lifecycle events described here would be

static java.lang.String
AFTER_START_EVENT



          The LifecycleEvent type for the "component after start" event.



static java.lang.String
AFTER_STOP_EVENT



          The LifecycleEvent type for the "component after stop" event.



static java.lang.String
BEFORE_START_EVENT



          The LifecycleEvent type for the "component before start" event.



static java.lang.String
BEFORE_STOP_EVENT



          The LifecycleEvent type for the "component before stop" event.



static java.lang.String
DESTROY_EVENT



          The LifecycleEvent type for the "component destroy" event.



static java.lang.String
INIT_EVENT



          The LifecycleEvent type for the "component init" event.



static java.lang.String
PERIODIC_EVENT



          The LifecycleEvent type for the "periodic" event.



static java.lang.String
START_EVENT



          The LifecycleEvent type for the "component start" event.



static java.lang.String
STOP_EVENT



          The LifecycleEvent type for the "component stop" event.
for these derived components
AccessLogValve, AuthenticatorBase, Connector, ContainerBase, DeltaManager, Embedded, ExtendedAccessLogValve,
FastCommonAccessLogValve, JDBCAccessLogValve, JvmRouteBinderValve, PersistentManagerBase,
RealmBase, SemaphoreValve, SimpleTcpCluster, SingleSignOn, StandardManager, StandardPipeline,
StandardServer, StandardService, StoreBase, WebappClassLoader, WebappLoaderthe derived component
StandardServer contains documentation located at
http://tomcat.apache.org/tomcat-5.5-doc/catalina/docs/api/org/apache/catalina/core/StandardServer.html
and supports the following attributes


protected  java.lang.String
domain



           



protected  javax.management.MBeanServer
mserver



           



protected  javax.management.ObjectName
oname



           



protected  java.lang.String
suffix



           



protected  java.beans.PropertyChangeSupport
support



          The property change support for this component.



protected  java.lang.String
type


which implements the interface you are interested in (javax.management.MBeanRegistration)
JavaDoc listed at
http://java.sun.com/j2se/1.5.0/docs/api/javax/management/MBeanRegistration.html

and registers the MBeanServer located at
http://java.sun.com/j2se/1.5.0/docs/api/javax/management/MBeanServer.html

you will want to configure your security requirements to ensure accessing each attribute is
permittable

such as what is described in catalina.policy here
grant codeBase "file:${catalina.home}/-" 

{
 
...
permission java.util.PropertyPermission "javax.management.MBeanServer", 
"read,write"; 
  permission javax.management.MBeanServerPermission "*";           
  
permission javax.management.MBeanPermission "*", "*";
  
permission javax.management.MBeanTrustPermission "register";  

...
};


Martin 
______________________________________________ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business of Sender.
This transmission is of a confidential nature and Sender does not endorse distribution to
any party other than intended recipient. Sender does not necessarily endorse content contained
within this transmission. 


> From: kjkoster@kjkoster.org
> To: users@tomcat.apache.org
> Subject: Re: Another confused person trying to get jconsole to monitor tomcat.
> Date: Thu, 2 Oct 2008 20:26:16 +0200
> 
> Dear Mark,
> 
> > I got bitten by this recently. I am working on a LifecycleListener  
> > (that
> > can be configured in server.xml) that fixes both ports that are used  
> > by
> > jconsole. This makes it much easier to configure firewalls, tunnel  
> > through
> > PuTTY etc.
> >
> > If I get it finished in time, it will be in 6.0.19+. If not, a later
> > version. Keep an eye on the change log and/or the dev list.
> 
> 
> Since you are knowledgeable in the sources for Tomcat, are you aware  
> of any programmatic way to register the Catalina mbeans? I'd like to  
> do so from code, without specifying any command line options.
> 
> For JBoss I found a special JMXserver class that I can load using  
> reflection. Is there such a thing for Tomcat?
> --
> Kees Jan
> 
> http://java-monitor.com/forum/
> kjkoster@kjkoster.org
> 06-51838192
> 
> The secret of success lies in the stability of the goal. -- Benjamin  
> Disraeli
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 

_________________________________________________________________
Stay up to date on your PC, the Web, and your mobile phone with Windows Live.
http://clk.atdmt.com/MRT/go/msnnkwxp1020093185mrt/direct/01/
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message