public static void main(String[] args) {
    final RestServer restServer;
    int exitCode = 0;
    ClusterMap clusterMap = null;
    try {
      InvocationOptions options = new InvocationOptions(args);
      Properties properties = Utils.loadProps(options.serverPropsFilePath);
      VerifiableProperties verifiableProperties = new VerifiableProperties(properties);
      ClusterMapConfig clusterMapConfig = new ClusterMapConfig(verifiableProperties);
      ClusterAgentsFactory clusterAgentsFactory =
          Utils.getObj(clusterMapConfig.clusterMapClusterAgentsFactory, clusterMapConfig,
              options.hardwareLayoutFilePath, options.partitionLayoutFilePath);
      clusterMap = clusterAgentsFactory.getClusterMap();
      SSLFactory sslFactory = getSSLFactoryIfRequired(verifiableProperties);
      logger.info("Bootstrapping RestServer");
      restServer = new RestServer(verifiableProperties, clusterMap, new LoggingNotificationSystem(), sslFactory);
      // attach shutdown handler to catch control-c
      Runtime.getRuntime().addShutdownHook(new Thread(() -> {
        logger.info("Received shutdown signal. Shutting down RestServer");
        restServer.shutdown();
      }));
      restServer.start();
      restServer.awaitShutdown();
    } catch (Exception e) {
      logger.error("Exception during bootstrap of RestServer", e);
      exitCode = 1;
    } finally {
      if (clusterMap != null) {
        clusterMap.close();
      }
    }
    logger.info("Exiting RestServerMain");
    System.exit(exitCode);
  }
Start point for creating an instance of {@link RestServer} and starting/shutting it down.
ambry-rest/src/main/java/com/github/ambry/rest/RestServerMain.java