Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JMX MBeanServer question

 
Stephanie Smith
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the JMX example, it starts a Server application.
Basically it initiates the MBeanServer, creates the ConnectorServer
and then starts the connector and that is it as far as the code goes.

Why does the server application not exit but continue to run? Is that because the RMI connector server is listening for incoming connections?
Is another thread created to do this?

// Create an RMI connector server
//
System.out.println("\nCreate an RMI connector server");
JMXServiceURL url = new JMXServiceURL(
"service:jmx:rmi:///jndi/rmi://localhost:9999/server");
JMXConnectorServer cs =
JMXConnectorServerFactory.newJMXConnectorServer(url, env, mbs);


// Start the RMI connector server
//
System.out.println("\nStart the RMI connector server");
cs.start();
System.out.println("\nRMI connector server successfully started");
System.out.println("\nWaiting for incoming connections...");
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the app would quit, then the ConnectorServer would quit along with it, if I understand what's supposed to happen correctly; that would defeat its purpose. If it is a thread (possible since it can be started and stopped), it's not a daemon thread, because that would quit automatically if the hosting app quits.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic