@Override
  public Collection<ViewInstanceDefinition> getViewInstanceDefinitions() {
    Collection<ViewInstanceEntity> instanceDefinitions = new HashSet<>();
    for (ViewEntity viewEntity : viewRegistry.getDefinitions()) {
      instanceDefinitions.addAll(viewRegistry.getInstanceDefinitions(viewEntity));
    }
    return Collections.unmodifiableCollection(instanceDefinitions);
  }
Construct a view context from the given view entity.

@param viewEntity    the view entity
@param viewRegistry  the view registry
ambari-server/src/main/java/org/apache/ambari/server/view/ViewContextImpl.java