mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niklas Therning <nik...@trillian.se>
Subject Re: Mina with Spring and JMX
Date Tue, 09 Oct 2007 13:04:54 GMT
I haven't used the JMX stuff myself but from the tutorial it seems like 
you need to tell the IoServiceManager to start collecting stats:

IoServiceManager serviceManager = new IoServiceManager( acceptor );
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
ObjectName name = new ObjectName("mina.example.http.server:type=IoServiceManager");
mbs.registerMBean(serviceManager, name);

So it seems like you need to call startCollectingStats(...) somehow. I 
don't think you can do this from within Spring (AFAIK init-method cannot 
take parameters). For now you could try to call it programmatically from 
within the MyServer.initialise() method and see if JMX starts working.

MINA should probably provide some Spring integration for 
IoServiceManager. A IoServieManagerFactoryBean would solve this problem 
I guess. Any contributions are welcome as always.



Martyn Thompson wrote:
> What happens? Nothing. I was expecting the bean "Port81JMX" to be added to
> the MBeanServer and viewable in JConsole, but this does not the case
> I've created a very basic test example (attached) that sets up the server to
> listen on port 81. To use, start the Server class and then telnet to port
> 81. Anything typed in the console will be echoed back. This is all
> configured in Spring.
> All I need to see is the MBeans that are supplied by default with Mina by
> configuring them with Spring.
> HTH and thanks
> http://www.nabble.com/file/p13114900/MinaJmxExample.zip MinaJmxExample.zip 
> Niklas Therning wrote:
>> Martyn Thompson wrote:
>>> Hi,
>>> I've only been using MINA for 1 day and had great success in getting it
>>> working with the Spring Framework, rewritting an app within 3 days which
>>> is
>>> great. I've been able to get the JMX working as per the example and hard
>>> coding but my preference is to use Spring but just can't seem to get the
>>> MINA JMX beans registered as part of the Spring config.
>>> Could someone give the config snippet I've attached and see where I am
>>> going
>>> wrong. I've search the forums but can't find an answer
>>> Thanks in advance for all and any help.
>>> Martyn
>>> http://www.nabble.com/file/p13019309/MINA_Spring_JMX_conf_snippet.txt
>>> MINA_Spring_JMX_conf_snippet.txt 
>> Well, what happens? Do you get an exception of some kind? Could you 
>> provide us with your code as well?
>> /Niklas

View raw message