@Override
public void initialize(Map<String, Object> config) {
command = (String[]) config.get(COMMAND);
processTimeoutMills = (int) config.get(PROCESS_TIMEOUT_MILLS);
Map<String, Object> processorConfig = (Map<String, Object>) config.get(PROCESS_CONFIG);
ShellContext shellContext = (ShellContext) config.get(SHELL_CONTEXT);
List<String> outputStreams = (List<String>) config.get(OUTPUT_STREAMS);
Map<String, String> envMap = (Map<String, String>) config.get(SHELL_ENVIRONMENT);
String className = (String) config.get(MULTILANG_SERIALIZER);
shellProcess = new ShellProcess(command);
if(className != null)
shellProcess.setSerializerClassName(className);
shellProcess.setEnv(envMap);
Long subpid = shellProcess.launch(processorConfig, shellContext, outputStreams);
LOG.info("Launched subprocess with pid " + subpid);
LOG.info("Start checking heartbeat...");
setHeartbeat();
heartBeatExecutorService = MoreExecutors.getExitingScheduledExecutorService(new ScheduledThreadPoolExecutor(1));
heartBeatExecutorService.scheduleAtFixedRate(new HeartbeatTimerTask(this), 1, 1, TimeUnit.SECONDS);
}