/** {@inheritDoc} */
 @Override
 public void stopGCMMonitoring() {
   if (started) {
     jmxNotificationManager.unsubscribe(
         FactoryName.createActiveObjectName(PAActiveObject.getBodyOnThis().getID()), this);
     started = false;
   }
 }
 /** {@inheritDoc} */
 @Override
 public void startGCMMonitoring() {
   if (statistics == null) {
     registerMethods();
   }
   if (!started) {
     initMethodStatistics();
     try {
       jmxNotificationManager.subscribe(
           FactoryName.createActiveObjectName(PAActiveObject.getBodyOnThis().getID()),
           this,
           FactoryName.getCompleteUrl(ProActiveRuntimeImpl.getProActiveRuntime().getURL()));
     } catch (IOException e) {
       throw new ProActiveRuntimeException(
           "JMX subscribtion for the MonitorController has failed", e);
     }
     started = true;
   }
 }
 private void subscribeJMXRuntimeEvent() {
   if (debug) {
     System.out.println(
         "["
             + new java.util.Date()
             + " "
             + host
             + " "
             + this.getClass().getSimpleName()
             + "] Subscribe JMX Runtime");
     outDebug.println(
         "["
             + new java.util.Date()
             + " "
             + host
             + " "
             + this.getClass().getSimpleName()
             + "] Subscribe JMX Runtime");
   }
   ProActiveRuntimeImpl part = ProActiveRuntimeImpl.getProActiveRuntime();
   part.addDeployment(listener.getDeployID());
   JMXNotificationManager.getInstance().subscribe(part.getMBean().getObjectName(), this);
   if (debug) {
     System.out.println(
         "["
             + new java.util.Date()
             + " "
             + host
             + " "
             + this.getClass().getSimpleName()
             + "] Subscribed");
     outDebug.println(
         "["
             + new java.util.Date()
             + " "
             + host
             + " "
             + this.getClass().getSimpleName()
             + "] Subscribed");
   }
 }
 /**
  * Creates a {@link PAMonitorControllerImpl}.
  *
  * @param owner Component owning the controller.
  */
 public PAMonitorControllerImpl(Component owner) {
   super(owner);
   jmxNotificationManager = JMXNotificationManager.getInstance();
 }
 /*
  * ---------- PRIVATE METHODS FOR SERIALIZATION ----------
  */
 private void readObject(java.io.ObjectInputStream in)
     throws java.io.IOException, ClassNotFoundException {
   in.defaultReadObject();
   jmxNotificationManager = JMXNotificationManager.getInstance();
 }