/**
  * Configure and reload the load balancer
  *
  * @throws LoadBalancerExtensionException if the configuration or reload process fails
  */
 private void configureAndReload() throws LoadBalancerExtensionException {
   // Configure load balancer
   if (loadBalancer.configure(topologyProvider.getTopology())) {
     // Reload the load balancer
     loadBalancer.reload();
   }
 }
  /**
   * Configure and start the load balancer
   *
   * @throws LoadBalancerExtensionException if configuration or start process fails
   */
  private void configureAndStart() throws LoadBalancerExtensionException {
    // Initialize topology
    if (!topologyEventReceiver.isInitialized()) {
      topologyEventReceiver.initializeTopology();
    }

    // Configure load balancer
    Topology topology = topologyProvider.getTopology();
    if (topologyPopulated(topology) && loadBalancer.configure(topology)) {
      // Start load balancer
      loadBalancer.start();
      loadBalancerStarted = true;
    }
  }
  /** Stop load balancer instance. */
  public void stop() {
    try {
      if (topologyEventReceiver != null) {
        topologyEventReceiver.terminate();
      }
    } catch (Exception ignore) {
    }

    try {
      if (statisticsNotifier != null) {
        statisticsNotifier.terminate();
      }
    } catch (Exception ignore) {
    }

    try {
      loadBalancer.stop();
    } catch (Exception ignore) {
    }
  }