tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Costin Manolache <cmanola...@yahoo.com>
Subject Re: Startup question
Date Thu, 20 Feb 2003 17:53:40 GMT
Remy Maucherat wrote:

> Filip Hanik wrote:
>> yes, you are right, how do I subscribe to this event?
>> I know that the server has a addLifeCycleListener, but how do I access
>> the server from a cluster object for example?
> 
> You can go up the tree, I think, but otherwise, you can just use
> ServerFactory.getServer().

A much better way - at least for tomcat5, but it should work for tomcat4 - 
is to use JMX. The server and service should be registered. We expose the
"managedResource" attribute of type "Object" - you can cast it to the 
right type.

All you need is to know the object name of the server.

BTW, I would strongly suggest dealing with the Service - this way your 
code will work for embeded catalina ( for example jboss doesn't use Server,
and AFAIK it is not required ). 

Static methods are not very nice :-)

Costin


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message