Creates new Docker command instance of given type.
@param commandType
@return
503923
private DockerCommand createCommand(Class<? extends DockerCommand> commandType) {
        try {
            return commandType.newInstance();
        } catch (InstantiationException | IllegalAccessException e) {
            throw new BeanCreationException("Failed to create Docker command of type: " + commandType, e);
        }
    }
314221
public alluxio.grpc.FileSystemCommandOrBuilder getCommandOrBuilder() {
    return command_ == null ? alluxio.grpc.FileSystemCommand.getDefaultInstance() : command_;
  }
1063565
private CommandLine createCommandForChildProcess() throws IOException {
        LOGGER.entering();

        CommandLine cmdLine = CommandLine.parse("appium");

        // add the program argument / dash options
        cmdLine.addArguments(getProgramArguments());

        LOGGER.exiting(cmdLine.toString());
        return cmdLine;
    }
996122
protected static CommandExecutor create(int timeout, String param) {
        String[] params = param.split(" ");
        CommandExecutor processModel = null;
        synchronized (PRC) {
            try {
                Process process = PRC.command(params)
                        .redirectErrorStream(true)
                        .start();
                processModel = new CommandExecutor(process, timeout);
                // Sleep 10 to create next
                try {
                    Thread.sleep(10);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

        return processModel;
    }
176139
public DockerCLI createCliForInspect(InspectContainerResponse inspect)
            throws IOException, InterruptedException {
        LOG.debug("Creating CLI for {}", inspect);
        Integer httpPort = null;
        // CLI mess around ports
        Integer cliPort = null; // should be this
        Integer jnlpAgentPort = null; // but in reality used this

        final Map<ExposedPort, Ports.Binding[]> bindings = inspect.getNetworkSettings().getPorts().getBindings();
        LOG.trace("Bindings: {}", bindings);
        for (Map.Entry<ExposedPort, Ports.Binding[]> entry : bindings.entrySet()) {
            if (entry.getKey().getPort() == JENKINS_DEFAULT.httpPort) {
                httpPort = Integer.valueOf(entry.getValue()[0].getHostPortSpec());
            }
            if (entry.getKey().getPort() == JENKINS_DEFAULT.tcpPort) {
                final Ports.Binding binding = entry.getValue()[0];
                jnlpAgentPort = Integer.valueOf(binding.getHostPortSpec());
            }
            if (entry.getKey().getPort() == JENKINS_DEFAULT.jnlpPort) {
                cliPort = Integer.valueOf(entry.getValue()[0].getHostPortSpec());
            }
        }
        LOG.trace("Creating URL {}", bindings);
        final URL url = new URL("http://" + getHost() + ":" + httpPort.toString());
        LOG.trace("Created URL {}", url.toExternalForm());

        if (isNull(jnlpAgentPort)) {
            throw new IOException("Can't get jnlpPort." + bindings.toString());
        }
        return createCliWithWait(url, jnlpAgentPort);
    }
1374566
private T buildInstance(CommandLine cli) {
    String[] constructorArgs = new String[this.constructor.getParameterTypes().length];
    for (Option option : cli.getOptions()) {
      if (this.constructoArgumentsMap.containsKey(option.getOpt())) {
        int idx = this.constructoArgumentsMap.get(option.getOpt());
        constructorArgs[idx] = option.getValue();
      }
    }

    T embeddedGobblin;
    try {
      embeddedGobblin = this.constructor.newInstance((Object[]) constructorArgs);
      return embeddedGobblin;
    } catch (IllegalAccessException | InvocationTargetException | InstantiationException exc) {
      throw new RuntimeException("Could not instantiate " + this.klazz.getName(), exc);
    }
  }
862113
public static BaseType createGenericClass(Class<?> type)
  {
    TypeVariable<?> []typeParam = type.getTypeParameters();
      
    if (typeParam == null || typeParam.length == 0)
      return ClassType.create(type);

    BaseType []args = new BaseType[typeParam.length];

    HashMap<String,BaseType> newParamMap = new HashMap<String,BaseType>();
    String paramDeclName = null;

    for (int i = 0; i < args.length; i++) {
      args[i] = create(typeParam[i], 
                       newParamMap, paramDeclName, 
                       ClassFill.TARGET);

      if (args[i] == null) {
        throw new NullPointerException("unsupported BaseType: " + type);
      }

      newParamMap.put(typeParam[i].getName(), args[i]);
    }
    
    // ioc/07f2

    return new GenericParamType(type, args, newParamMap);
  }
791466
public static ServiceDependencyBuilder copyOf(final ServiceDependency prototype) {
        return new ServiceDependencyBuilder()
                .withName(prototype.getName())
                .withDescription(prototype.getDescription())
                .withUrl(prototype.getUrl())
                .withType(prototype.getType())
                .withSubtype(prototype.getSubtype())
                .withMethods(prototype.getMethods())
                .withMediaTypes(prototype.getMediaTypes())
                .withAuthentication(prototype.getAuthentication())
                .withCriticality(prototype.getCriticality())
                .withExpectations(prototype.getExpectations());
    }
802124
private CommandLine createJavaCommandForChildProcess() throws IOException {
        LOGGER.entering();

        // start command with java
        CommandLine cmdLine = CommandLine.parse("java");

        // add the -D system properties
        cmdLine.addArguments(getJavaSystemPropertiesArguments());

        // Set the classpath
        cmdLine.addArguments(getJavaClassPathArguments("selendroid-", mainClass));

        // add the program argument / dash options
        cmdLine.addArguments(getProgramArguments());

        LOGGER.exiting(cmdLine.toString());
        return cmdLine;
    }
335034
public static Pool createPool(String type, ConnectionManager cm, PoolConfiguration pc)
   {
      if (type == null || type.equals(""))
         return new DefaultPool(cm, pc);

      type = type.toLowerCase(Locale.US);
      
      switch (type)
      {
         case "default":
            return new DefaultPool(cm, pc);
         case "stable":
            return new StablePool(cm, pc);
         default:
         {
            Class<? extends Pool> clz = customPoolTypes.get(type);

            if (clz == null)
               throw new RuntimeException(type + " can not be found");

            try
            {
               Constructor constructor = clz.getConstructor(ConnectionManager.class, PoolConfiguration.class);
               return (Pool)constructor.newInstance(cm, pc);
            }
            catch (Exception e)
            {
               throw new RuntimeException(type + " can not be created", e);
            }
         }
      }
   }
1033145
private CommandLine createCommandLine() throws IOException {
        return new CommandLine(getJavaExecutablePath())
                .addArguments(getBundleJavaOptsArgument())
                .addArgument(getLoggerConfigurationArgument())
                .addArgument("-jar")
                .addArgument(getExecutableJar())
                .addArguments(results.toArray(new String[results.size()]), false)
                .addArgument(getReportDirectoryPath().toString(), false);
    }
68185
func CreateCommand(commandType CommandType) (Command, error) {
	commandsMu.RLock()
	defer commandsMu.RUnlock()
	if factory, ok := commands[commandType]; ok {
		return factory(), nil
	}
	return nil, ErrCommandNotRegistered
}
211721
public static PostgreSQLCommandPacket newInstance(
            final PostgreSQLCommandPacketType commandPacketType, final PostgreSQLPacketPayload payload, final int connectionId) throws SQLException {
        switch (commandPacketType) {
            case QUERY:
                return new PostgreSQLComQueryPacket(payload);
            case PARSE:
                return new PostgreSQLComParsePacket(payload);
            case BIND:
                return new PostgreSQLComBindPacket(payload, connectionId);
            case DESCRIBE:
                return new PostgreSQLComDescribePacket(payload);
            case EXECUTE:
                return new PostgreSQLComExecutePacket(payload);
            case SYNC:
                return new PostgreSQLComSyncPacket(payload);
            case TERMINATE:
                return new PostgreSQLComTerminationPacket(payload);
            default:
                return new PostgreSQLUnsupportedCommandPacket(commandPacketType.getValue());
        }
    }
60091
public SagaInstanceInfo createNew(final SagaType type) {
        Saga newSaga = startNewSaga(type.getSagaClass());
        return SagaInstanceInfo.define(newSaga, true);
    }
929983
public static Argon2 create(Argon2Types type) {
        return createInternal(type, Argon2Constants.DEFAULT_SALT_LENGTH, Argon2Constants.DEFAULT_HASH_LENGTH);
    }
885711
@Override
  public <T> ServiceBuilder service(Class<T> type)
  {
    Key<?> key = Key.of(type, ServiceImpl.class);

    return service(key, type);
  }
689994
public <T extends KubernetesCommand> T command(T command) {
		action.setCommand(command);
		return command;
	}