code: public synchronized void start() throws Exception {
      if (state == State.RUNNING) {
        LOG.debug("Ignore start() call on HTTP service {} since it has already been started.", serviceName);
        return;
      }
      if (state != State.NOT_STARTED) {
        if (state == State.STOPPED) {
          throw new IllegalStateException("Cannot start the HTTP service "
                                            + serviceName + " again since it has been stopped");
        }
        throw new IllegalStateException("Cannot start the HTTP service "
                                          + serviceName + " because it was failed earlier");
      }
  
      try {
        LOG.info("Starting HTTP Service {} at address {}", serviceName, bindAddress);
        channelGroup = new DefaultChannelGroup(ImmediateEventExecutor.INSTANCE);
        resourceHandler.init(handlerContext);
        eventExecutorGroup = createEventExecutorGroup(execThreadPoolSize);
        bootstrap = createBootstrap(channelGroup);
        Channel serverChannel = bootstrap.bind(bindAddress).sync().channel();
        channelGroup.add(serverChannel);
  
        bindAddress = (InetSocketAddress) serverChannel.localAddress();
  
        LOG.debug("Started HTTP Service {} at address {}", serviceName, bindAddress);
        state = State.RUNNING;
      } catch (Throwable t) {
        // Release resources if there is any failure
        channelGroup.close().awaitUninterruptibly();
        try {
          if (bootstrap != null) {
            shutdownExecutorGroups(0, 5, TimeUnit.SECONDS,
                                   bootstrap.config().group(), bootstrap.config().childGroup(), eventExecutorGroup);
          } else {
            shutdownExecutorGroups(0, 5, TimeUnit.SECONDS, eventExecutorGroup);
          }
        } catch (Throwable t2) {
          t.addSuppressed(t2);
        }
        state = State.FAILED;
        throw t;
      }
    }
docs: Starts the HTTP service.
  
  @throws Exception if the service failed to started