mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martyn Thompson <thompson_mar...@hotmail.com>
Subject Re: Mina with Spring and JMX
Date Tue, 09 Oct 2007 13:22:43 GMT

I tried your suggestion, but that does not work. This only indicates how
often to collect the stats and has a default value of 5000 so does not need
to be set. 

The problem lies in actually registering the IoServiceManager with the the
MBeanServer within the Spring config.



Niklas Therning wrote:
> 
> 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 );
> serviceManager.startCollectingStats(1000);
> 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.
> 
> HTH
> 
> /Niklas
> 
> 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 this message in context: http://www.nabble.com/Mina-with-Spring-and-JMX-tf4561940s16868.html#a13115496
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.


Mime
View raw message