protected int execInternal(Map<String, ?> props, List<String> commands, Map<String, ?> env) { execScriptCmds.add(new ExecCmd(ownConstructorProps, props, "", commands, env)); for (String cmd : commands) { for (Entry<String, CustomResponseGenerator> entry : customResponses.entrySet()) { if (cmd.matches(entry.getKey())) { CustomResponseGenerator responseGenerator = entry.getValue(); CustomResponse response; try { response = responseGenerator.generate(new ExecParams(ownConstructorProps, props, commands, env)); } catch (Exception e) { throw Exceptions.propagate(e); } writeCustomResponseStreams(props, response); return response.exitCode; } } } return 0; } protected void writeCustomResponseStreams(Map<String, ?> props, CustomResponse response) {