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...");
posted 11 years ago
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.
We noticed he had no friends. So we gave him this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user