Changeset 3161
- Timestamp:
- 03/06/10 15:42:39 (2 years ago)
- Location:
- trunk/openmole
- Files:
-
- 5 modified
- 1 moved
-
core/org.openmole.core.workflow.implementation/src/main/java/org/openmole/core/workflow/implementation/mole/execution/MoleExecution.java (modified) (3 diffs)
-
core/org.openmole.core.workflow.model/src/main/java/org/openmole/core/workflow/model/mole/execution/IMoleExecution.java (modified) (1 diff)
-
misc/org.openmole.misc.tools/src/main/java/org/openmole/misc/tools/structure/Counter.java (modified) (3 diffs)
-
ui/org.openmole.ui.console/src/main/java/org/openmole/ui/console/Application.java (modified) (2 diffs)
-
ui/org.openmole.ui.console/src/main/java/org/openmole/ui/console/internal/command/Print.java (moved) (moved from trunk/openmole/ui/org.openmole.ui.console/src/main/java/org/openmole/ui/console/internal/command/Echo.java) (2 diffs)
-
ui/org.openmole.ui.console/src/main/java/org/openmole/ui/console/internal/viewer/EnvironmentViewer.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/openmole/core/org.openmole.core.workflow.implementation/src/main/java/org/openmole/core/workflow/implementation/mole/execution/MoleExecution.java
r3147 r3161 17 17 package org.openmole.core.workflow.implementation.mole.execution; 18 18 19 import com.db4o.CorruptionException; 19 20 import java.util.ArrayList; 20 21 import java.util.Collection; 21 22 import java.util.Collections; 23 import java.util.LinkedList; 22 24 import java.util.Map; 23 25 import java.util.TreeMap; … … 212 214 getSubmiter().interrupt(); 213 215 214 for(IMoleJob moleJob : allMoleJobs()) {216 for(IMoleJob moleJob : getAllMoleJobsInternal()) { 215 217 moleJob.cancel(); 216 218 } … … 226 228 } 227 229 228 public Iterable<IMoleJob> allMoleJobs() { 230 231 private Iterable<IMoleJob> getAllMoleJobsInternal() { 229 232 return inProgress.keySet(); 230 233 } 231 234 235 @Override 236 public synchronized Iterable<IMoleJob> getAllMoleJobs() { 237 Collection<IMoleJob> ret = new LinkedList<IMoleJob>(); 238 239 for(IMoleJob moleJob : getAllMoleJobsInternal()) { 240 ret.add(moleJob); 241 } 242 243 return ret; 244 } 232 245 233 246 @Override -
trunk/openmole/core/org.openmole.core.workflow.model/src/main/java/org/openmole/core/workflow/model/mole/execution/IMoleExecution.java
r3147 r3161 59 59 60 60 IExecutionContext getExecutionContext(); 61 62 Iterable<IMoleJob> getAllMoleJobs(); 61 63 } -
trunk/openmole/misc/org.openmole.misc.tools/src/main/java/org/openmole/misc/tools/structure/Counter.java
r3149 r3161 22 22 * @author Romain Reuillon <romain.reuillon at openmole.org> 23 23 */ 24 public class Counter {24 public class Counter implements Comparable<Counter> { 25 25 26 intvalue;26 Integer value; 27 27 28 28 public Counter() { … … 42 42 } 43 43 44 public intgetValue() {44 public Integer getValue() { 45 45 return value; 46 46 } 47 47 48 public void increment( intval) {48 public void increment(Integer val) { 49 49 value+=val; 50 50 } … … 54 54 } 55 55 56 @Override 57 public String toString() { 58 return getValue().toString(); 59 } 60 61 @Override 62 public boolean equals(Object obj) { 63 if (obj == null) { 64 return false; 65 } 66 if (getClass() != obj.getClass()) { 67 return false; 68 } 69 final Counter other = (Counter) obj; 70 if (this.getValue() != other.getValue() && (this.getValue() == null || !this.getValue().equals(other.getValue()))) { 71 return false; 72 } 73 return true; 74 } 75 76 @Override 77 public int hashCode() { 78 int hash = this.getValue().hashCode(); 79 return hash; 80 } 81 82 83 84 public int compareTo(Counter intgr) { 85 return getValue().compareTo(intgr.getValue()); 86 } 87 88 89 90 91 56 92 } -
trunk/openmole/ui/org.openmole.ui.console/src/main/java/org/openmole/ui/console/Application.java
r3159 r3161 9 9 import org.openmole.misc.workspace.ForbidenPasswordProvider; 10 10 import org.openmole.ui.console.internal.Activator; 11 import org.openmole.ui.console.internal.command. Echo;11 import org.openmole.ui.console.internal.command.Print; 12 12 import org.openmole.ui.console.internal.command.Ppasswd; 13 13 //import org.openmole.core.execution.environmentprovider.glite.GliteEnvironment; … … 35 35 Groovysh g = new Groovysh(Groovy.class.getClassLoader(), binding, new IO()); 36 36 37 g.leftShift(new Echo(g,"echo", "\\ec"));38 g.leftShift(new Ppasswd(g,"pp wd", "\\ppwd"));37 g.leftShift(new Print(g,"print", "\\pr")); 38 g.leftShift(new Ppasswd(g,"ppasswd", "\\pp")); 39 39 40 40 g.run(); -
trunk/openmole/ui/org.openmole.ui.console/src/main/java/org/openmole/ui/console/internal/command/Print.java
r3149 r3161 22 22 import org.codehaus.groovy.tools.shell.Shell; 23 23 import org.openmole.core.workflow.model.execution.IEnvironment; 24 import org.openmole.core.workflow.model.mole.execution.IMoleExecution; 24 25 import org.openmole.misc.tools.service.HierarchicalRegistry; 25 26 import org.openmole.ui.console.internal.viewer.EnvironmentViewer; 26 27 import org.openmole.ui.console.internal.viewer.IViewer; 28 import org.openmole.ui.console.internal.viewer.MoleExecutionViewer; 27 29 28 30 /** … … 30 32 * @author Romain Reuillon <romain.reuillon at openmole.org> 31 33 */ 32 public class Echoextends CommandSupport {34 public class Print extends CommandSupport { 33 35 34 36 private HierarchicalRegistry<IViewer> viewers = new HierarchicalRegistry<IViewer>(); 35 37 36 38 37 public Echo(Shell shell, String string, String string1) {39 public Print(Shell shell, String string, String string1) { 38 40 super(shell, string, string1); 39 41 viewers.register(IEnvironment.class, new EnvironmentViewer()); 42 viewers.register(IMoleExecution.class, new MoleExecutionViewer()); 40 43 } 41 44 -
trunk/openmole/ui/org.openmole.ui.console/src/main/java/org/openmole/ui/console/internal/viewer/EnvironmentViewer.java
r3149 r3161 48 48 49 49 for(ExecutionState state : ExecutionState.values()) { 50 System.out.println(state.getLabel() + ": " + accounting.get(state) .getValue());50 System.out.println(state.getLabel() + ": " + accounting.get(state)); 51 51 } 52 52





