You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Mircea Toma <mi...@home.com> on 2001/07/23 01:22:38 UTC
Re: MBeanComponentManager...again!....I got it!
Hi,
Ok, I think I got it! My goal was to have components created and configured
by a ComponentManager but in the same time I wanted to manage them at
runtime using a JMX adaptor. Since the ComponentManager has to keep
references to components the only way to manage a components at runtime was
to pass the component instance to the MBean server using
MBeanServer.registerMBean(Object, ObjectName). The only components that
would make sense to register with the MBeanServer are only the components
that have one instance within the application.
As a result I extended the ExcaliburComponentManager and overridden the
addComponent and addComponentInstance by adding the step of registering the
component with the MBeanServer if it implements the ThreadSafe interface
(same thing for ExcaliburComponentSelector).
... This is it. Right now I'm using this approach and it works wonderfully!
...thoughts are welcomed!
Cheers,
Mircea
P.S.: Leo, I think you where right to have doubts about a
MBeanComponentManager....what I'm doing in this approach can be done in
other parts of the code. It also proves that Avalon is general enough to
cover different patterns encountered in development.
----- Original Message -----
From: "Leo Simons" <ma...@leosimons.com>
To: "Avalon Development" <av...@jakarta.apache.org>
Sent: Tuesday, July 17, 2001 1:44 PM
Subject: RE: MBeanComponentManager...again!
> <<I need to have a better integration between Avalon and JMX but because
> there
> are some overlaps I want to solve them elegantly. I know that the attached
> code is very primitive but its purpose is only to get a better feedback.>>
>
> I'm sorry to take so long in responding...I've installed windows for the
4th
> time in two weeks now and it still keeps hanging, and linux still chokes
on
> my DSL connection (or rather, my ISP chokes on linux...)
>
> << So, my questions are:
> a) Is this MBeanComponentManager the right approach (eventually the
> MBeanComponentSelector too...when I'll understand more about the
> framework...maybe when Berin's docs will be done)?! >>
>
> I personally have my doubts about the entire concept of an
> MBeanComponentManager
> (see the archive), but this is probably because I'm still too unused to
> using
> a ComponentManager. I'll try and find time this sunday to finally finish
up
> the
> mess I left JMX within phoenix in.
>
> << b) Did you have in mind federated component managers that will
> register/lookup the components with JNDI contexts and/or JMX server-s in a
> consistent way? >>
>
> I'm not sure, but this sounds more like an app to run on top of phoenix
(or
> beside it) and not like a phoenix core capability. There's been talk 'bout
> this
> before. I for one have nothing against it.
>
> To cut a long story short, we're not quite sure yet about how to handle
JMX
> w/
> phoenix. Input is welcome =)
>
> regards,
>
> Leo, who really hopes he'll be able to send this out...
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: avalon-dev-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org
Re: MBeanComponentManager...again!....I got it!
Posted by Mircea Toma <mi...@home.com>.
----- Original Message -----
From: "Peter Donald" <do...@apache.org>
To: "Avalon Development" <av...@jakarta.apache.org>
Sent: Sunday, July 22, 2001 8:11 PM
Subject: Re: MBeanComponentManager...again!....I got it!
> On Mon, 23 Jul 2001 09:22, Mircea Toma wrote:
> > Hi,
> >
> > Ok, I think I got it! My goal was to have components created and
configured
> > by a ComponentManager but in the same time I wanted to manage them at
> > runtime using a JMX adaptor. Since the ComponentManager has to keep
> > references to components the only way to manage a components at runtime
was
> > to pass the component instance to the MBean server using
> > MBeanServer.registerMBean(Object, ObjectName). The only components that
> > would make sense to register with the MBeanServer are only the
components
> > that have one instance within the application.
> > As a result I extended the ExcaliburComponentManager and overridden the
> > addComponent and addComponentInstance by adding the step of registering
the
> > component with the MBeanServer if it implements the ThreadSafe interface
> > (same thing for ExcaliburComponentSelector).
> > ... This is it. Right now I'm using this approach and it works
wonderfully!
> >
> > ...thoughts are welcomed!
>
> Sounds good to me. I guess I would do it a little
> differently though.
Can you explain the reasons why you would do it like that?
> Something like
>
> MyContainer creates the components and places applicable
> ones in JMX.
... you mean the container will add one by one the components to the CM and
applicable one to JMX ?
> It then
> creates a DefaultComponentManager and populates it as
> appropriate. It passes
> this CM onto Composables.
... I don't understand why should I use the DefaultComponentManager ... do
you mean ExcaliburComponentManager?
Mircea
>
> Cheers,
>
> Pete
>
> *-----------------------------------------------------*
> | "Faced with the choice between changing one's mind, |
> | and proving that there is no need to do so - almost |
> | everyone gets busy on the proof." |
> | - John Kenneth Galbraith |
> *-----------------------------------------------------*
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: avalon-dev-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org
Re: MBeanComponentManager...again!....I got it!
Posted by Peter Donald <do...@apache.org>.
On Mon, 23 Jul 2001 09:22, Mircea Toma wrote:
> Hi,
>
> Ok, I think I got it! My goal was to have components created and configured
> by a ComponentManager but in the same time I wanted to manage them at
> runtime using a JMX adaptor. Since the ComponentManager has to keep
> references to components the only way to manage a components at runtime was
> to pass the component instance to the MBean server using
> MBeanServer.registerMBean(Object, ObjectName). The only components that
> would make sense to register with the MBeanServer are only the components
> that have one instance within the application.
> As a result I extended the ExcaliburComponentManager and overridden the
> addComponent and addComponentInstance by adding the step of registering the
> component with the MBeanServer if it implements the ThreadSafe interface
> (same thing for ExcaliburComponentSelector).
> ... This is it. Right now I'm using this approach and it works wonderfully!
>
> ...thoughts are welcomed!
Sounds good to me. I guess I would do it a little differently though.
Something like
MyContainer creates the components and places applicable ones in JMX. It then
creates a DefaultComponentManager and populates it as appropriate. It passes
this CM onto Composables.
Cheers,
Pete
*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof." |
| - John Kenneth Galbraith |
*-----------------------------------------------------*
---------------------------------------------------------------------
To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org