1718192021222324252627
list.add(ev); notifyAll(); } public synchronized CartagoActionEvent waitFor(long id) throws InterruptedException { CartagoActionEvent ev = remove(id); while (ev == null){ wait(); ev = remove(id); } return ev;
282930313233343536373839
} private CartagoActionEvent remove(long id){ Iterator<CartagoActionEvent> it = list.iterator(); while (it.hasNext()){ CartagoActionEvent ev = it.next(); if (ev.getActionId() == id){ it.remove(); return ev; } } return null;