Package org.apache.ambari.server.view

Examples of org.apache.ambari.server.view.ViewInstanceDefinition


public class ViewExternalSubResourceServiceTest {
  @Test
  public void testAddResourceService() throws Exception {
    Resource.Type type = new Resource.Type("resource");

    ViewInstanceDefinition definition = ViewInstanceDefinitionTest.getViewInstanceDefinition();
    ViewExternalSubResourceService service = new ViewExternalSubResourceService(type, definition);

    Object fooService = new Object();

    service.addResourceService("foo", fooService);
View Full Code Here


   */
  @Path("{instanceName}/{resources}")
  public Object getResourceHandler(@PathParam("instanceName") String instanceName,
                                            @PathParam("resources") String resources) {

    ViewInstanceDefinition instanceDefinition =
        ViewRegistry.getInstance().getInstanceDefinition(m_viewName, instanceName);

    if (instanceDefinition == null) {
      throw new IllegalArgumentException("A view instance " +
          m_viewName + "/" + instanceName + " can not be found.");
    }

    Object service = instanceDefinition.getService(resources);

    if (service == null) {
      throw new IllegalArgumentException("A resource type " + resources + " for view instance " +
          m_viewName + "/" + instanceName + " can not be found.");
    }
View Full Code Here

TOP

Related Classes of org.apache.ambari.server.view.ViewInstanceDefinition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.