コード例 #1
0
 private void setUpJmxExecutionListener() {
   if (System.getProperty("com.sun.management.jmxremote") != null) {
     ExecutionListener l =
         AwtSafeListener.getAwtInvokeLaterListener(frame, ExecutionListener.class);
     RemoteExecutionListener r = new RemoteExecutionListener(l);
     MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
     try {
       mbs.registerMBean(
           r, new ObjectName(RemoteExecutionListenerMBean.JMX_EXECUTION_LISTENER_NAME));
     } catch (Exception e) {
       log.error("Failed to register jmx execution listener", e);
     }
   }
 }
コード例 #2
0
 private boolean runFeatures(String[] args) throws Exception {
   boolean success = true;
   if (args.length > 0) {
     // we are executing in standalone one off test mode
     // run the tests, adding the ChorusViewer as the execution listener
     ExecutionListener l =
         AwtSafeListener.getAwtInvokeLaterListener(frame, ExecutionListener.class);
     Chorus chorus = new Chorus(args);
     chorus.setExecutionListener(l);
     chorus.run();
   }
   setUpJmxExecutionListener();
   return success;
 }