[xSocket-develop] ConnectionUtils.registerMBean()
Status: Inactive
Brought to you by:
grro
|
From: <e-m...@we...> - 2010-02-19 10:46:49
|
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());
ConnectionUtils.registerMBean(srv);
// run it within the current thread.
srv.run(); // the call will not return
}
}
public interface ServiceHandlerMBean {
// Attribute
public String getTestMessage();
public String setTestMessage( String t );
// Operation
public void closing( boolean b );
}
public class ServiceHandler implements ServiceHandlerMBean {
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);
}
}
}
___________________________________________________________
NEU: Mit WEB.DE DSL über 1000,- ¿ sparen!
http://produkte.web.de/go/02/
|