Ejemplo n.º 1
0
  /**
   * Broadcast to start a new remote-container for this platform to the Main-Container.
   *
   * @param remoteConfig the configuration of the remote container
   * @param preventUsageOfAlreadyUsedComputers the prevent usage of already used computers
   * @return the name of the new container
   * @throws ServiceException the service exception
   */
  private String broadcastStartNewRemoteContainer(RemoteContainerConfig remoteConfig)
      throws ServiceException {

    logger.debug("Start a new remote container!");

    String sliceName = null;
    try {
      LoadServiceSlice slice = (LoadServiceSlice) getSlice(MAIN_SLICE);
      sliceName = slice.getNode().getName();
      logger.debug("Try to start a new remote container " + sliceName);
      return slice.startNewRemoteContainer(remoteConfig);
    } catch (ServiceException | IMTPException t) {
      // NOTE that slices are always retrieved from the main and not from the cache --> No need to
      // retry in case of failure
      logger.warn("Error while starting a new remote-container from " + sliceName, t);
    }
    return null;
  }