public class PeriodicalTimeUpdaterV2 extends Object
EUpdateIntervalRegistration are possible,
where as a year is composed by 365 days and a month has always 30 days. So these periods are
not really exact.| Modifier and Type | Field and Description |
|---|---|
private com.google.common.eventbus.AsyncEventBus |
clientServerEventBus |
private ch.sahits.game.openpatrician.model.Date |
date |
private EUpdateIntervalRegistration |
intervall |
private org.apache.logging.log4j.Logger |
logger |
private int |
tickInterval
Period of the clock ticking
|
private int |
timePassed
Time passed since the start of the period
|
private com.google.common.eventbus.AsyncEventBus |
timerEventBus |
private int |
updateInterval
Period that the listener should be notified
|
| Constructor and Description |
|---|
PeriodicalTimeUpdaterV2(EUpdateIntervalRegistration intervall) |
| Modifier and Type | Method and Description |
|---|---|
void |
handleClockTick(ClockTick event) |
void |
initializeEventBus() |
void |
unregisterFromEventBus() |
void |
updateTick(ClockTickIntervalChange event) |
private final org.apache.logging.log4j.Logger logger
private int tickInterval
@Autowired private ch.sahits.game.openpatrician.model.Date date
private int updateInterval
private final EUpdateIntervalRegistration intervall
private int timePassed
@Autowired @Qualifier(value="serverClientEventBus") private com.google.common.eventbus.AsyncEventBus clientServerEventBus
@Autowired @Qualifier(value="timerEventBus") private com.google.common.eventbus.AsyncEventBus timerEventBus
public PeriodicalTimeUpdaterV2(EUpdateIntervalRegistration intervall)
@PostConstruct public void initializeEventBus()
public void updateTick(ClockTickIntervalChange event)
public void handleClockTick(ClockTick event)
@PreDestroy public void unregisterFromEventBus()
Copyright © 2011-2016 Sahits GmbH. All Rights Reserved.