]> git.argeo.org Git - gpl/argeo-slc.git/blob - sandbox/argeo.slc.executionflow/src/main/java/org/argeo/slc/executionflow/ExecutionRegister.java
Introduce executor and event notifications
[gpl/argeo-slc.git] / sandbox / argeo.slc.executionflow / src / main / java / org / argeo / slc / executionflow / ExecutionRegister.java
1 package org.argeo.slc.executionflow;
2
3 import java.util.Map;
4 import java.util.Set;
5
6 import org.apache.commons.logging.Log;
7 import org.apache.commons.logging.LogFactory;
8 import org.springframework.beans.factory.InitializingBean;
9 import org.springframework.beans.factory.annotation.Autowired;
10
11 public class ExecutionRegister implements InitializingBean {
12 private final static Log log = LogFactory.getLog(ExecutionRegister.class);
13
14 @Autowired
15 private Set<ExecutionFlow> executionFlows;
16
17 @Autowired
18 private Set<ExecutionSpec> executionSpecs;
19
20 public void afterPropertiesSet() throws Exception {
21 log.debug("Register: " + executionSpecs.size() + " specs");
22 for (ExecutionSpec spec : executionSpecs) {
23 log.debug(spec);
24 Map<String, ExecutionSpecAttribute> attributes = spec
25 .getAttributes();
26 log.debug("Spec attributes: ");
27 for (String key : attributes.keySet()) {
28 log.debug(" " + key + "\t" + attributes.get(key));
29 }
30 }
31
32 log.debug("Register: " + executionFlows.size() + " flows");
33 for (ExecutionFlow flow : executionFlows) {
34 log.debug(flow);
35 Map<String, Object> attributes = flow.getAttributes();
36 log.debug("Specified parameters: ");
37 for (String key : flow.getExecutionSpec().getAttributes().keySet()) {
38 log.debug(" "
39 + key
40 + "\t"
41 + (attributes.containsKey(key) ? "SPECIFIED"
42 : "TO SPECIFY"));
43 }
44 }
45
46 }
47 }