Class TimedUpdatableTaskList
- java.lang.Object
-
- ch.sahits.game.openpatrician.model.event.TimedUpdatableTaskList
-
public class TimedUpdatableTaskList extends java.lang.Object
List of tasks that are to be executed at a certain time.- Author:
- Andi Hotz, (c) Sahits GmbH, 2013 Created on Jan 28, 2013
-
-
Constructor Summary
Constructors Constructor Description TimedUpdatableTaskList()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(TimedTask task)
Add a new task.(package private) TimedTask
getFirst()
Retrieve the first task.void
handleClockTick(ClockTick event)
void
registerWithClock()
Register as Clock update listener.void
remove(TimedTask task)
Cancel a timed task prematurely.private void
unregister()
-
-
-
Field Detail
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
log
private final org.slf4j.Logger log
-
date
@Autowired private Date date
-
timerEventBus
@Autowired @Qualifier("timerEventBus") private com.google.common.eventbus.AsyncEventBus timerEventBus
-
tasks
private final java.util.List<TimedTask> tasks
-
-
Method Detail
-
registerWithClock
@PostConstruct public void registerWithClock()
Register as Clock update listener.
-
unregister
@PreDestroy private void unregister()
-
add
public void add(TimedTask task)
Add a new task.- Parameters:
task
- to be added
-
remove
public void remove(TimedTask task)
Cancel a timed task prematurely.- Parameters:
task
- to be removed
-
handleClockTick
public void handleClockTick(ClockTick event)
-
getFirst
TimedTask getFirst()
Retrieve the first task. Only used for tests.- Returns:
- first task in the list.
-
-