private ServerAction createServerAction(String classname, Map<String, ServiceInfo> services) throws AmbariException {
      Class<?> actionClass = null;
      actionClass = getServerActionClass(classname);
      if (actionClass == null) {
        LOG.debug(String.format("Did not find %s in Ambari, try to load it from external directories", classname));
        actionClass = getServiceLevelServerActionClass(classname, services);
      }

      if (actionClass == null) {
        throw new AmbariException("Unable to load server action class: " + classname);
      } else {
        LOG.debug(String.format("Ready to init server action %s", classname));
        Class<? extends ServerAction> serverActionClass = actionClass.asSubclass(ServerAction.class);
        if (serverActionClass == null) {
          throw new AmbariException("Unable to execute server action class, invalid type: " + classname);
        } else {
          return injector.getInstance(serverActionClass);
        }
      }
    }
Attempts to create an instance of the ServerAction class implementation specified in
classname.

@param classname a String declaring the classname of the ServerAction class to instantiate
@return the instantiated ServerAction implementation
@throws AmbariException
ambari-server/src/main/java/org/apache/ambari/server/serveraction/ServerActionExecutor.java