tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jon Eaves <...@eaves.org>
Subject Re: Custom Valves and Administration Tool
Date Wed, 11 Dec 2002 06:45:29 GMT
Hi again Bill,

>> Aha.  I was hoping this wasn't going to be the answer.  Oh well.
>> 
>> [ snip ]
>> 
>> If this is the case, why does the code for the Valve recommend 
>> implementing the Lifecycle interface ? What was the design reason for
>> that ?h
> 
> By implementing Lifecycle, you get well-defined states to allocate and 
> release any resources that your Valve may need.  Since the order of
> setting attributes is undefined, it makes it much easier to determine
> resources that depend on multiple attribute values.  It's pretty much
> independent of the MBeans.
> 

Excellent, so the Valves can then conform to an defined
servlet/applet/midlet like behaviour.  I noticed the use of the
start() etc methods in the Valve and guessed that was something to
do with it, but also guessed wrong that it was relating to the MBeans.

> It's purely because of the Valve definition in server.xml, when it can't
>  find the MBean to manage it.  Actually, the Valve should function fine
> even with the error:  It's just noise in the log.

Yup.  My Valves were all working just fine with the errors, but I wanted
to be neat and tidy ;-)

> 
>> The reason I ask is because it seems bit of dicking around just to 
>> implement a new Valve.  Writing the code took about 2 hours, it then
>> took 2 days to get the exception stuff sorted out.
>> 
>> What is the additional information used for ? And was there a better 
>> (read simpler and less mucking around) way to solve my "get rid of the
>> exception" than addition of the descriptor, or is that required for
>> all additional components in Tomcat ?
> 
> 
> With the MBean info, it is possible to use other JMX-enabled tools to
> manage Tomcat (including your Valve).  The admin web-app is only one
> example of such a tool.  It is also likely that JMX support will improve
> in Tomcat 5.x.
> 
> Of course, the simplest way to "get rid of the exception" is to disable
> (aka comment out) the MBeans Listeners in server.xml.

OK.  I'll have a play around with that.  I think I tried that originally,
and when I did, the Administration application stopped working, but that
may just have been co-incidence.

Thanks very much Bill and Craig for your patience.

Cheers,
	-- jon

-- 
Jon Eaves <jon@eaves.org>
http://www.eaves.org/jon/


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message