You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Vic <vi...@friendvu.com> on 2004/12/03 01:10:22 UTC
[modeler] Intro: How do I monitor?
Intro: I assume I just create a new Registry() and registerComponents()
in it. Nothing more? Yes?
In Sun's JMX they have an HTML monitor "servlet" to see what we can see.
Is there anything like that here?
Should I just write my own thing to examine the Registry?
Can I use the Sun JMX dummy monitor thing?
tia,
.V
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [modeler] Intro: How do I monitor?
Posted by Craig McClanahan <cr...@gmail.com>.
On Thu, 02 Dec 2004 21:29:59 -0600, Vic <vi...@friendvu.com> wrote:
> Thanks.
> So let me see if I understand:
>
> 1. I have "Registry" create my objects and then my applications gets a
> handle to those objects via the "Registry". Or do I create the objects
> and then register. I think the 2nd.
Actually, both strategies are possible. Tomcat, for example, has a
bunch of events that are fired when something interesting happens
(say, a new webapp is deployed). When Tomcat starts up, a
particularly interesting listener class
(org.apache.catalina.mbeans.ServerLifecycleListener) registers itself
on all of the interesting events. When it sees the event that some
particular new service object got created, it uses the Registry to
create and register a corresponding MBean in the JMX server. Note
that the service objects themselves don't have to be JMX-aware for
this to work -- only the event listeners need to know about it.
However, your service objects need to be instrumented with al the
event broadcasting stuff (for example, all the major objects in Tomcat
fire a PropertyChangedEvent when any property value is changed at
runtime) for this to work.
The alternative strategy would be to make each new service object
responsible for creating and registering its own MBean during its
startup processing. However, this ties the service object
implementation classes to JMX, and is probably not the most desirable
approach.
A third approach, if you're using something like an IoC framework
where you get instances from a factory, would be to make a customized
factory that creates and registers MBeans for each service object that
it hands back to the application.
>
> 2.THEN I have "traditional" JMX agent register those same MBeans that I
> get from the "Registry" to the "Sun HTML monitor thing"?
> And now I can monitor my registered objects.
>
That totally depends on the capabilities and configuration of whatever
JMX server implementation you're using -- and that is where you
rapidly go beyond my current experience (indeed, you've pretty much
exhausted my memory cache of knowledge about JMX with the last couple
of questions :-).
> Do I have that right? It would make sense to me like that.
>
> Jumping to what I want to try: if my MBeans interfaces are also "CoR"
> Commands, I am cool. But .... I can't configure my "MBeans Commands"
> using commons-chain XML... I guess I have to live with that. I realy do
> not want to configure my objects using JMX XML, mostly becuase I just
> don't know it (and I did not see much writen up about it so I could follow)
I bet you could create a single MBean that would take "catalog" and
"command" as parameters, and offer an execute method that would run
any possible chain. No need to register them each as individual
MBeans, unless you needed to examine the results in some way that was
dependent on which chain you executed.
>
> .V
>
Craig
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [modeler] Intro: How do I monitor?
Posted by Vic <vi...@friendvu.com>.
Thanks.
So let me see if I understand:
1. I have "Registry" create my objects and then my applications gets a
handle to those objects via the "Registry". Or do I create the objects
and then register. I think the 2nd.
2.THEN I have "traditional" JMX agent register those same MBeans that I
get from the "Registry" to the "Sun HTML monitor thing"?
And now I can monitor my registered objects.
Do I have that right? It would make sense to me like that.
Jumping to what I want to try: if my MBeans interfaces are also "CoR"
Commands, I am cool. But .... I can't configure my "MBeans Commands"
using commons-chain XML... I guess I have to live with that. I realy do
not want to configure my objects using JMX XML, mostly becuase I just
don't know it (and I did not see much writen up about it so I could follow)
.V
Craig McClanahan wrote:
> Modeler is really about making it easy for the server side application
> you want to embed JMX support in to do so. As such, you woudn't focus
> on monitoring the Registery itself, but you would monitor the JMX
> server that is created ... using the usual techniques, such as the
> remote HTML monitor thing.
>
> If you want to instrument a webapp with JMX support, you might want to
> glance at how Tomcat integrates it. I'm afraid my knowledge of the
> details there is a couple of years out of date, but they use Modeler
> to configure the MBeans that are registered in the MBean server, which
> is then made accessible (just like any other MBeans server) to JMX
> clients.
>
> Craig
>
>
> On Thu, 02 Dec 2004 18:10:22 -0600, Vic <vi...@friendvu.com> wrote:
>
>>Intro: I assume I just create a new Registry() and registerComponents()
>> in it. Nothing more? Yes?
>>
>>In Sun's JMX they have an HTML monitor "servlet" to see what we can see.
>>Is there anything like that here?
>>
>>Should I just write my own thing to examine the Registry?
>>Can I use the Sun JMX dummy monitor thing?
>>
>>tia,
>>.V
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [modeler] Intro: How do I monitor?
Posted by Craig McClanahan <cr...@gmail.com>.
Modeler is really about making it easy for the server side application
you want to embed JMX support in to do so. As such, you woudn't focus
on monitoring the Registery itself, but you would monitor the JMX
server that is created ... using the usual techniques, such as the
remote HTML monitor thing.
If you want to instrument a webapp with JMX support, you might want to
glance at how Tomcat integrates it. I'm afraid my knowledge of the
details there is a couple of years out of date, but they use Modeler
to configure the MBeans that are registered in the MBean server, which
is then made accessible (just like any other MBeans server) to JMX
clients.
Craig
On Thu, 02 Dec 2004 18:10:22 -0600, Vic <vi...@friendvu.com> wrote:
> Intro: I assume I just create a new Registry() and registerComponents()
> in it. Nothing more? Yes?
>
> In Sun's JMX they have an HTML monitor "servlet" to see what we can see.
> Is there anything like that here?
>
> Should I just write my own thing to examine the Registry?
> Can I use the Sun JMX dummy monitor thing?
>
> tia,
> .V
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org