Package jade.core.event

Examples of jade.core.event.NotificationHelper


    getContentManager().registerLanguage(codec, FIPANames.ContentLanguage.FIPA_SL2);
    getContentManager().registerLanguage(codec, FIPANames.ContentLanguage.FIPA_SL);
   
    // Register to be notified about the REATTACHED event in order to handle Main Container faults
    try {
      NotificationHelper helper = (NotificationHelper) getHelper(NotificationService.NAME);
      myContainerListener = new ContainerAdapter() {
        public void reattached(ContainerEvent ev) {
          // The Main Container lost my subscription --> Subscribe again
          send(getSubscribe());
        }
      };
      helper.registerContainerListener(myContainerListener);
    }
    catch (ServiceException se) {
      // Just print a warning since this does not affect the normal operation of a ToolAgent
      logger.log(Logger.WARNING, "NotificationService not installed. Some tool may not work properly.");
    }
View Full Code Here


  }
 
  private void clean() {
    if (myContainerListener != null) {
      try {
        NotificationHelper helper = (NotificationHelper) getHelper(NotificationService.NAME);
        helper.deregisterContainerListener(myContainerListener);
      }
      catch (ServiceException se) {
        // Just do nothing since this does not affect the normal operation of a ToolAgent
      }
    }
View Full Code Here

    return observedAgents.isEmpty();
  }
 
  private void suicide() {
    try {
      NotificationHelper helper = (NotificationHelper) getHelper(NotificationService.NAME);
      helper.deregisterMessageListener(this);
      helper.deregisterAgentListener(this);
    }
    catch (Exception e) {
      // Should never happen
      e.printStackTrace();
    }
View Full Code Here

TOP

Related Classes of jade.core.event.NotificationHelper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.