private void registerResourceProcessors(ResourceInstance resource) {
    //todo: reconsider registration mechanism
    Resource.Type type = resource.getResourceDefinition().getType();
    List<ResourceDefinition.PostProcessor> listProcessors = m_mapPostProcessors.get(type);
    if (listProcessors == null) {
      listProcessors = new ArrayList<>();
      m_mapPostProcessors.put(type, listProcessors);
    }
    listProcessors.addAll(resource.getResourceDefinition().getPostProcessors());

    for (ResourceInstance child : resource.getSubResources().values()) {
      // avoid cycle
      if (!m_mapPostProcessors.containsKey(child.getResourceDefinition().getType())) {
        registerResourceProcessors(child);
      }
    }

    // always add Request post processors since they may be returned but will not be a child
    m_mapPostProcessors.put(Resource.Type.Request, new RequestResourceDefinition().getPostProcessors());
  }
Registers the resource processors.
Recursively registers child resource processors.

@param resource the root resource
ambari-server/src/main/java/org/apache/ambari/server/api/services/ResultPostProcessorImpl.java