public void addStage(Stage stage) throws AmbariException {
    RoleGraph roleGraph = roleGraphFactory.createNew(roleCommandOrder);
    roleGraph.build(stage);
    requestStageContainer.addStages(roleGraph.getStages());
  }
An extension of RequestStageContainer that takes the role command order into consideration when adding stages
ambari-server/src/main/java/org/apache/ambari/server/controller/OrderedRequestStageContainer.java