Example #1
0
  protected void startNode()
      throws IMTPException, ProfileException, ServiceException, JADESecurityException,
          NotFoundException {
    // Initialize all services (without activating them)
    List services = new ArrayList();
    initMandatoryServices(services);

    List l = myProfile.getSpecifiers(Profile.SERVICES);
    myProfile.setSpecifiers(Profile.SERVICES, l); // Avoid parsing services twice
    initAdditionalServices(l.iterator(), services);

    // Register with the platform
    ServiceDescriptor[] descriptors = new ServiceDescriptor[services.size()];
    for (int i = 0; i < descriptors.length; ++i) {
      descriptors[i] = (ServiceDescriptor) services.get(i);
    }
    if (theBEManager != null) {
      myNodeDescriptor.setParentNode(theBEManager.getNode());
    }
    // Actually join the platform (this call can modify the name of this container)
    getServiceManager().addNode(myNodeDescriptor, descriptors);
    if (theBEManager != null) {
      theBEManager.register(myNodeDescriptor);
    }

    // Once we are connected, boot all services
    bootAllServices(services);
  }