+ processesThreadGroup = new ThreadGroup("SLC Processes of Agent #"
+ + agentDescriptor.getUuid());
+ modulesManager.registerProcessNotifier(this,
+ new HashMap<String, String>());
+ }
+
+ public void dispose() {
+ modulesManager.unregisterProcessNotifier(this,
+ new HashMap<String, String>());
+ }
+
+ /**
+ * Called during initialization in order to determines the agent UUID. To be
+ * overridden. By default creates a new one per instance.
+ */
+ protected String initAgentUuid() {
+ return UUID.randomUUID().toString();
+ }
+
+ /*
+ * SLC AGENT
+ */
+ public void runSlcExecution(SlcExecution slcExecution) {
+ process(slcExecution);
+ }
+
+ public void process(ExecutionProcess process) {
+ ProcessThread processThread = createProcessThread(processesThreadGroup,
+ modulesManager, process);
+ processThread.start();
+ runningProcesses.put(process.getUuid(), processThread);
+ // FIXME find a way to remove them from this register
+ }
+
+ public void kill(ExecutionProcess process) {
+ String processUuid = process.getUuid();
+ if (runningProcesses.containsKey(processUuid)) {
+ runningProcesses.get(processUuid).interrupt();
+ }