Re: [xSocket-develop] ConnectionUtils.registerMBean()
Status: Inactive
Brought to you by:
grro
|
From: Gregor R. <gre...@gm...> - 2010-02-20 07:36:30
|
Hi,
the ConnectionUtils.registerMBean() implementation supports reading and writing properties only. Performing other methods such as getter or setter is not supported currently.
Gregor
----- Original Message -----
From: e-m...@we...
Sent: 02/19/10 09:27 AM
To: xso...@li...
Subject: [xSocket-develop] ConnectionUtils.registerMBean()
Hello together,
i hope anyone can help me. I have a problem with using the registerMBean method.
If i register an IServer i can see (with the jconsole) any attributes (get method), but i can not see/use an operation.
My task is to find a way for closing a thread with using the jconsole ore an other tool.
Thanks for any help!!!
My Quellcode:
public class ServiceServer {
public static void main(String args[]) throws Exception {
// creates the server by passing over the port number & handler
IServer srv = new Server(8091, new ServiceHandler());
// 08.07.2009: JMX-Registrierung
ConnectionUtils.registerMBean(srv);
// run it within the current thread.
srv.run(); // the call will not return
// ... or start it by using a dedicated thread
// srv.start(); // returns after the server has been started
}
}
public interface ServiceServerMBean {
// Attribute
public String getTestMessage();
public String setTestMessage( String t );
// Operation
public void closing( boolean b );
}
public class ServiceHandler implements IDataHandler,IConnectHandler,IDisconnectHandler,IConnectionScoped, ServiceServerMBean {
public String getTestMessage()
{
meldung = "1000 Kühe machen keine Milchstrasse";
return meldung;
}
public String setTestMessage( String t )
{
meldung = t;
return meldung;
}
public void closing( boolean b )
{
if(b == true) {
System.exit(0);
}
}
}
GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://movieflat.web.de
|