> -----Original Message-----
> From: helander [mailto:[email protected]]
> Sent: Sunday, January 20, 2013 2:19 AM
> To: [email protected]
> Subject: Enabling JMX monitoring on existing bus
>
> I would like to enable JMX access to an existing bus. I just want to be able
> to do a "process" connect using jconsole.
>
> How do I do this without using Spring configuration? Do anyone have , or
> could point to, some code example?
>
> Is the procedure independent on the deployment method? I am currently using
> cxf in a web app on JBoss AS 7.
I know how to configure Spring to publish the beans you specify as JMX mbeans,
but you should go through the Spring documentation for more details.
For what I do, I'm only using annotations to specify the beans I want to
publish. You may need to publish beans only specified in your XML application
context. The Spring doc will show how to do this.
In your applicationContext, the first step is just to add the following
declaration:
<context:mbean-export/>
In every Java source file that represents a bean you want to publish, use the
"@ManagedResource" annotation at the class level. This lets you specify the
JMX objectname and also a description of the resulting mbean.
For each operation in the class you want to make available, use the
"@ManagedOperation" annotation along with "@ManagedOperationParameters".
The other part of this is getting the jmx server in your web container to
publish your managed beans. That is outside of the control of Spring. Look in
your application server documentation for this.