Example #1
0
  /**
   * Starts XMPP component.
   *
   * @param component the instance of XMPP component to start.
   * @return <tt>true</tt> if XMPP component has been started successfully.
   */
  private boolean startComponent(ComponentBase component) {
    this.component = component;

    String host = component.getHostname();
    int port = component.getPort();

    this.componentManager = new ExternalComponentManager(host, port);

    String componentSubDomain = component.getSubdomain();
    componentManager.setSecretKey(componentSubDomain, component.getSecret());

    componentManager.setServerName(component.getDomain());

    ScheduledExecutorService executorService = Executors.newScheduledThreadPool(1);

    component.init();

    connectRetry = new RetryStrategy(executorService);

    connectRetry.runRetryingTask(new SimpleRetryTask(0, 5000, true, getConnectCallable()));

    return true;
  }