|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.calendar.AtomicTime
public class AtomicTime
works based on an AtomicClock instance adding reliability by using multiple server if one fails.
AtomicClock| Field Summary |
|---|
| Fields inherited from interface com.antelmann.calendar.TimeSystem |
|---|
systemTime |
| Constructor Summary | |
|---|---|
AtomicTime()
immediately activates the instance and schedules updates in the interval given. |
|
AtomicTime(boolean activateNow)
Interval is 24h. |
|
AtomicTime(boolean activateNow,
long updateIntervalMillis)
immediately activates the instance and schedules updates in the interval given. |
|
AtomicTime(boolean activateNow,
long updateIntervalMillis,
Logger logger)
|
|
| Method Summary | |
|---|---|
void |
activate()
activates the embedded timer for automatic updates |
long |
currentTimeMillis()
returns the current time |
void |
deactivate()
deactivates the embedded timer for automatic updates |
protected void |
finalize()
|
AtomicClock |
getAtomicClock()
returns the clock in use |
Logger |
getLogger()
may be null |
Set<String> |
getServerNames()
returned set allows to add/remove server names if required |
long |
getUpdateIntervalMillis()
|
boolean |
isActivated()
|
void |
setLogger(Logger logger)
may be set to null |
void |
setUpdateIntervalMillis(long updateIntervalMillis)
must be called while the instance is deactivated. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AtomicTime()
public AtomicTime(boolean activateNow)
public AtomicTime(boolean activateNow,
long updateIntervalMillis)
throws IllegalArgumentException
updateIntervalMillis - must represent more than a minute
IllegalArgumentException - if the interval represents less than a minute
public AtomicTime(boolean activateNow,
long updateIntervalMillis,
Logger logger)
throws IllegalArgumentException
activateNow - if true, the instance is immediately activatedupdateIntervalMillis - must represent more than a minutelogger - used to log the scheduled delta updates for the atomic clock
IllegalArgumentException - if the interval represents less than 5 minutes| Method Detail |
|---|
public boolean isActivated()
public long getUpdateIntervalMillis()
public void setUpdateIntervalMillis(long updateIntervalMillis)
throws IllegalStateException,
IllegalArgumentException
IllegalStateException - if this instance is currently activated
IllegalArgumentException - if the interval represents less than 5 minutesisActivated()public void activate()
public void deactivate()
protected void finalize()
finalize in class Objectpublic long currentTimeMillis()
currentTimeMillis in interface TimeSystempublic AtomicClock getAtomicClock()
public void setLogger(Logger logger)
public Logger getLogger()
public Set<String> getServerNames()
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||