You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by co...@covalent.net on 2002/07/29 20:10:14 UTC

catalina.mbeans package

I'm a bit confused of what's in catalina.mbeans.

My understanding of model mbeans is that we use the modeler
and the xml description - what's the role of all the 
classes like LoggerMBean, etc ? 

There is also some logic that goes inside the Mbean wrapper 
that is very strange - for example ConnectorMBean.getClientAuth().
The logic should be in the object itself ( i.e. add get/setClientAuth
to CoyoteConnector ), not in the JMX wrappers. 

Can anyone clarify this a bit ?

Costin


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: catalina.mbeans package

Posted by Amy Roh <am...@apache.org>.
> > >
> > > Many classes are just extending BaseModelMBean and do nothing ( all
those
> > > with around 4k size :-).
> >
> > Yes.  There're a few classes that need to be deleted since they're not
> > getting used.  Initially I added them to handle special cases and
realized
> > those objects don't need any special case stuff on the implementation.
> > Looking at it quickly we don't use HttpConnectorMBean,
HttpsConnectorMBean,
> > LoaderMBean, LoggerMBean, ManagerMBean, RealmMBean, and ValveBaseMBean
> > anymore.
> >
> > Should I delete them from both 4.0 and the new jakarta-tomcat-catalina
or
> > just the new repository?
> >
>
> If it's just a case of removing the FooMBean class and changing
> mbeans-descriptors.xml, there's no reason not to do it in he 4.x branch as
> well.  That means it's transparent to all users of the MBeans.

Done.  There was no need to change mbeans-descriptors.xml since they weren't
getting used at all.

Amy
>
> > Thanks,
> > Amy
> >
>
> Craig
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: catalina.mbeans package

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Tue, 30 Jul 2002, Amy Roh wrote:

> Date: Tue, 30 Jul 2002 12:24:00 -0700
> From: Amy Roh <am...@apache.org>
> Reply-To: Tomcat Developers List <to...@jakarta.apache.org>
> To: Tomcat Developers List <to...@jakarta.apache.org>
> Subject: Re: catalina.mbeans package
>
> > On Mon, 29 Jul 2002, Craig R. McClanahan wrote:
> >
> > > Most of the time, you want MBeans to directly delegate attribute read
> and
> > > write operations to the corresponding component object.  Sometimes,
> > > though, that is not possible (for example, when the component getter
> takes
> > > an actual object, and the MBean takes a string containing the MBean
> name).
> > > Thus, you can subclass the provided base ModelMBean class and override
> > > just the methods you care about -- everything else will pass through
> with
> > > no changes.
> >
> > Many classes are just extending BaseModelMBean and do nothing ( all those
> > with around 4k size :-).
>
> Yes.  There're a few classes that need to be deleted since they're not
> getting used.  Initially I added them to handle special cases and realized
> those objects don't need any special case stuff on the implementation.
> Looking at it quickly we don't use HttpConnectorMBean, HttpsConnectorMBean,
> LoaderMBean, LoggerMBean, ManagerMBean, RealmMBean, and ValveBaseMBean
> anymore.
>
> Should I delete them from both 4.0 and the new jakarta-tomcat-catalina or
> just the new repository?
>

If it's just a case of removing the FooMBean class and changing
mbeans-descriptors.xml, there's no reason not to do it in he 4.x branch as
well.  That means it's transparent to all users of the MBeans.

> Thanks,
> Amy
>

Craig


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: catalina.mbeans package

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Tue, 30 Jul 2002, Amy Roh wrote:

> Date: Tue, 30 Jul 2002 12:24:00 -0700
> From: Amy Roh <am...@apache.org>
> Reply-To: Tomcat Developers List <to...@jakarta.apache.org>
> To: Tomcat Developers List <to...@jakarta.apache.org>
> Subject: Re: catalina.mbeans package
>
> > On Mon, 29 Jul 2002, Craig R. McClanahan wrote:
> >
> > > Most of the time, you want MBeans to directly delegate attribute read
> and
> > > write operations to the corresponding component object.  Sometimes,
> > > though, that is not possible (for example, when the component getter
> takes
> > > an actual object, and the MBean takes a string containing the MBean
> name).
> > > Thus, you can subclass the provided base ModelMBean class and override
> > > just the methods you care about -- everything else will pass through
> with
> > > no changes.
> >
> > Many classes are just extending BaseModelMBean and do nothing ( all those
> > with around 4k size :-).
>
> Yes.  There're a few classes that need to be deleted since they're not
> getting used.  Initially I added them to handle special cases and realized
> those objects don't need any special case stuff on the implementation.
> Looking at it quickly we don't use HttpConnectorMBean, HttpsConnectorMBean,
> LoaderMBean, LoggerMBean, ManagerMBean, RealmMBean, and ValveBaseMBean
> anymore.
>
> Should I delete them from both 4.0 and the new jakarta-tomcat-catalina or
> just the new repository?
>

If removing them is transparent (i.e. all you do is remove the special
class name in mbeans-descriptors.xml), I'd go ahead and remove them from
the 4.1 version as well.

> Thanks,
> Amy

Craig


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: catalina.mbeans package

Posted by Amy Roh <am...@apache.org>.
> On Mon, 29 Jul 2002, Craig R. McClanahan wrote:
>
> > Most of the time, you want MBeans to directly delegate attribute read
and
> > write operations to the corresponding component object.  Sometimes,
> > though, that is not possible (for example, when the component getter
takes
> > an actual object, and the MBean takes a string containing the MBean
name).
> > Thus, you can subclass the provided base ModelMBean class and override
> > just the methods you care about -- everything else will pass through
with
> > no changes.
>
> Many classes are just extending BaseModelMBean and do nothing ( all those
> with around 4k size :-).

Yes.  There're a few classes that need to be deleted since they're not
getting used.  Initially I added them to handle special cases and realized
those objects don't need any special case stuff on the implementation.
Looking at it quickly we don't use HttpConnectorMBean, HttpsConnectorMBean,
LoaderMBean, LoggerMBean, ManagerMBean, RealmMBean, and ValveBaseMBean
anymore.

Should I delete them from both 4.0 and the new jakarta-tomcat-catalina or
just the new repository?

Thanks,
Amy


>
> For all others - I think we should try to move the method implementation
> in the real code, and keep using 'plain' modeler.
>
>
> > There are a bunch of methods on the Connector implementations that are
not
> > exposed in Connector.java itself -- and we didn't want to change
Connector
> > due to backwards compatibility concerns.  Therefore, there's some
special
> > case stuff on the various implementations.
>
> I don't think the interface needs to change - the modeler wraps the real
> object and uses introspection on it.
>
> That means attributes in CoyoteConnector should be visible without need
> to have them in Connector. If not, we should fix modeler to allow this.
>
>
> > In 5.0, this is definitely something that should be refactored in the
> > Connector interfaces so it doesn't have to be special cased.
>
> +1
>
> Costin
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: catalina.mbeans package

Posted by co...@covalent.net.
On Mon, 29 Jul 2002, Craig R. McClanahan wrote:

> > As long as we are using modeler - I think we shouldn't have to write
> > _any_ custom MBean.
> >
> 
> I look forward to seeing how you plan to deal with some of the interesting
> cases -- everything from the "users" MBean attribute on the
> MemoryUserDatabase MBean to synthesized MBeans like MBeanFactory that
> don't really correspond to any Catalina component, but are there only for
> JMX clients to use.

Ok, let me try again: we shouldn't use both modeler and 'custom' mbean
at the same time.

For 'intersting' cases we can use a custom standard mbean or a dyanmic
mbean or even a custom model mbean. 

I don't understand MBeanFactory very well - my understanding is that 
you can declare a 'class' and have the constructor called ( that's 
why the constructor is defined in JMX ), so the factory is redundant.
But it may be a cleaner way to construct elements. I don't know
how it can deal with 'custom' modules ( like user-defined realms 
or connectors ).

For users - given the performance and scalability implications it 
certainly need a custom mbean, if we go with one mbean per user
model.

Costin



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: catalina.mbeans package

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Mon, 29 Jul 2002 costinm@covalent.net wrote:

> Date: Mon, 29 Jul 2002 14:18:58 -0700 (PDT)
> From: costinm@covalent.net
> Reply-To: Tomcat Developers List <to...@jakarta.apache.org>
> To: Tomcat Developers List <to...@jakarta.apache.org>
> Subject: Re: catalina.mbeans package
>
> On Mon, 29 Jul 2002, Craig R. McClanahan wrote:
>
> >
> > The only place that will prove difficult is when a component's method
> > implementing an operation wants an object instead of a String or primitive
> > (say, Container.addChild()).  We also have the choice (in Tomcat 5) to
> > break the existing APIs a little bit more freely, which I didn't believe
> > we could really do in 4.1.
>
> No problem - just add (in the component implementation) a second method
> taking a string as parameter.
>
> That's how jk works - each jk component has a name, and 2 setters ( one
> taking a string ).
>
> Again, no interface change is needed - the config setters are specific
> to the implementation object. ( same as in commons-logging :-)
>
> > That's a good idea -- it will reduce the need to write custom MBean
> > implementations without eliminating the opportunity to do so when it's
> > helpful.
>
>
> As long as we are using modeler - I think we shouldn't have to write
> _any_ custom MBean.
>

I look forward to seeing how you plan to deal with some of the interesting
cases -- everything from the "users" MBean attribute on the
MemoryUserDatabase MBean to synthesized MBeans like MBeanFactory that
don't really correspond to any Catalina component, but are there only for
JMX clients to use.

>
> Costin

Craig


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: catalina.mbeans package

Posted by co...@covalent.net.
On Mon, 29 Jul 2002, Craig R. McClanahan wrote:

> 
> The only place that will prove difficult is when a component's method
> implementing an operation wants an object instead of a String or primitive
> (say, Container.addChild()).  We also have the choice (in Tomcat 5) to
> break the existing APIs a little bit more freely, which I didn't believe
> we could really do in 4.1.

No problem - just add (in the component implementation) a second method 
taking a string as parameter. 

That's how jk works - each jk component has a name, and 2 setters ( one 
taking a string ). 

Again, no interface change is needed - the config setters are specific 
to the implementation object. ( same as in commons-logging :-)

> That's a good idea -- it will reduce the need to write custom MBean
> implementations without eliminating the opportunity to do so when it's
> helpful.


As long as we are using modeler - I think we shouldn't have to write 
_any_ custom MBean. 


Costin


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: catalina.mbeans package

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Mon, 29 Jul 2002 costinm@covalent.net wrote:

> Date: Mon, 29 Jul 2002 13:24:09 -0700 (PDT)
> From: costinm@covalent.net
> Reply-To: Tomcat Developers List <to...@jakarta.apache.org>
> To: Tomcat Developers List <to...@jakarta.apache.org>
> Subject: Re: catalina.mbeans package
>
> On Mon, 29 Jul 2002, Craig R. McClanahan wrote:
>
> > Most of the time, you want MBeans to directly delegate attribute read and
> > write operations to the corresponding component object.  Sometimes,
> > though, that is not possible (for example, when the component getter takes
> > an actual object, and the MBean takes a string containing the MBean name).
> > Thus, you can subclass the provided base ModelMBean class and override
> > just the methods you care about -- everything else will pass through with
> > no changes.
>
> Many classes are just extending BaseModelMBean and do nothing ( all those
> with around 4k size :-).
>

Sounds like some cleanup is in order.  Fortunately, that's pretty
transparent to anyone actually using the JMX interfaces.

> For all others - I think we should try to move the method implementation
> in the real code, and keep using 'plain' modeler.
>

The only place that will prove difficult is when a component's method
implementing an operation wants an object instead of a String or primitive
(say, Container.addChild()).  We also have the choice (in Tomcat 5) to
break the existing APIs a little bit more freely, which I didn't believe
we could really do in 4.1.

>
> > There are a bunch of methods on the Connector implementations that are not
> > exposed in Connector.java itself -- and we didn't want to change Connector
> > due to backwards compatibility concerns.  Therefore, there's some special
> > case stuff on the various implementations.
>
> I don't think the interface needs to change - the modeler wraps the real
> object and uses introspection on it.
>
> That means attributes in CoyoteConnector should be visible without need
> to have them in Connector. If not, we should fix modeler to allow this.
>

That's a good idea -- it will reduce the need to write custom MBean
implementations without eliminating the opportunity to do so when it's
helpful.

>
> > In 5.0, this is definitely something that should be refactored in the
> > Connector interfaces so it doesn't have to be special cased.
>
> +1
>
> Costin
>

Craig


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: catalina.mbeans package

Posted by co...@covalent.net.
On Mon, 29 Jul 2002, Craig R. McClanahan wrote:

> Most of the time, you want MBeans to directly delegate attribute read and
> write operations to the corresponding component object.  Sometimes,
> though, that is not possible (for example, when the component getter takes
> an actual object, and the MBean takes a string containing the MBean name).
> Thus, you can subclass the provided base ModelMBean class and override
> just the methods you care about -- everything else will pass through with
> no changes.

Many classes are just extending BaseModelMBean and do nothing ( all those
with around 4k size :-).

For all others - I think we should try to move the method implementation
in the real code, and keep using 'plain' modeler.  


> There are a bunch of methods on the Connector implementations that are not
> exposed in Connector.java itself -- and we didn't want to change Connector
> due to backwards compatibility concerns.  Therefore, there's some special
> case stuff on the various implementations.

I don't think the interface needs to change - the modeler wraps the real
object and uses introspection on it. 

That means attributes in CoyoteConnector should be visible without need
to have them in Connector. If not, we should fix modeler to allow this.


> In 5.0, this is definitely something that should be refactored in the
> Connector interfaces so it doesn't have to be special cased.

+1

Costin


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: catalina.mbeans package

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Mon, 29 Jul 2002 costinm@covalent.net wrote:

> Date: Mon, 29 Jul 2002 11:10:14 -0700 (PDT)
> From: costinm@covalent.net
> Reply-To: Tomcat Developers List <to...@jakarta.apache.org>
> To: List Tomcat-Dev <to...@jakarta.apache.org>
> Subject: catalina.mbeans package
>
> I'm a bit confused of what's in catalina.mbeans.
>
> My understanding of model mbeans is that we use the modeler
> and the xml description - what's the role of all the
> classes like LoggerMBean, etc ?
>

Most of the time, you want MBeans to directly delegate attribute read and
write operations to the corresponding component object.  Sometimes,
though, that is not possible (for example, when the component getter takes
an actual object, and the MBean takes a string containing the MBean name).
Thus, you can subclass the provided base ModelMBean class and override
just the methods you care about -- everything else will pass through with
no changes.

> There is also some logic that goes inside the Mbean wrapper
> that is very strange - for example ConnectorMBean.getClientAuth().
> The logic should be in the object itself ( i.e. add get/setClientAuth
> to CoyoteConnector ), not in the JMX wrappers.
>
> Can anyone clarify this a bit ?

There are a bunch of methods on the Connector implementations that are not
exposed in Connector.java itself -- and we didn't want to change Connector
due to backwards compatibility concerns.  Therefore, there's some special
case stuff on the various implementations.

In 5.0, this is definitely something that should be refactored in the
Connector interfaces so it doesn't have to be special cased.

>
> Costin
>

Craig


>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>