public void addProcess(final String processName, int id, final String authKey, final List<String> command, final Map<String, String> env, final String workingDirectory, final boolean isPrivileged, final boolean respawn) { for (String s : command) { if (s == null) { throw ProcessLogger.ROOT_LOGGER.nullCommandComponent(); } } synchronized (lock) { if (shutdown) { return; } final Map<String, ManagedProcess> processes = this.processes; if (processes.containsKey(processName)) { ProcessLogger.ROOT_LOGGER.duplicateProcessName(processName); // ignore return; } final ManagedProcess process = new ManagedProcess(processName, id, command, env, workingDirectory, lock, this, authKey, isPrivileged, respawn); processes.put(processName, process); processesByKey.put(new Key(authKey.getBytes(Charset.forName("US-ASCII"))), process); processAdded(processName); } }
public void addProcess(final String processName, int id, final String authKey, final List<String> command, final Map<String, String> env, final String workingDirectory, final boolean isPrivileged, final boolean respawn) { for (String s : command) { if (s == null) { throw ProcessLogger.ROOT_LOGGER.nullCommandComponent(); } } synchronized (lock) { if (shutdown) { return; } final Map<String, ManagedProcess> processes = this.processes; if (processes.containsKey(processName)) { ProcessLogger.ROOT_LOGGER.duplicateProcessName(processName); // ignore return; } final ManagedProcess process = new ManagedProcess(processName, id, command, env, workingDirectory, lock, this, authKey, isPrivileged, respawn); processes.put(processName, process); processesByKey.put(new Key(authKey.getBytes(Charset.forName("US-ASCII"))), process); processAdded(processName); } }
public void addProcess(final String processName, final byte[] authKey, final List<String> command, final Map<String, String> env, final String workingDirectory, final boolean isPrivileged, final boolean respawn) { for (String s : command) { if (s == null) { throw MESSAGES.nullCommandComponent(); } } synchronized (lock) { if (shutdown) { return; } final Map<String, ManagedProcess> processes = this.processes; if (processes.containsKey(processName)) { ROOT_LOGGER.duplicateProcessName(processName); // ignore return; } final ManagedProcess process = new ManagedProcess(processName, command, env, workingDirectory, lock, this, authKey, isPrivileged, respawn); processes.put(processName, process); processesByKey.put(new Key(authKey), process); processAdded(processName); } }