Пример #1
0
 protected Map<String, VirtualMachine> memory(String machine) {
   if (!memory.containsKey(machine)) {
     VirtualMachine vm = new VirtualMachine();
     vm.setName("Good VM from " + machine);
     Map<String, VirtualMachine> map = new HashMap<String, VirtualMachine>();
     map.put(vm.getName(), vm);
     memory.put(machine, map);
   }
   return memory.get(machine);
 }
Пример #2
0
 @Override
 public void migrate(VirtualMachine vm, Machine source, Machine dest) {
   migrationHistory.add(new Object[] {vm, source, dest});
   memory(source.getId()).remove(vm.getName());
   memory(dest.getId()).put(vm.getName(), vm);
 }