Package org.cache2k.operation
Class TimeReference.Default
- java.lang.Object
-
- org.cache2k.operation.TimeReference.Milliseconds
-
- org.cache2k.operation.TimeReference.Default
-
- All Implemented Interfaces:
TimeReference
- Enclosing interface:
- TimeReference
public static final class TimeReference.Default extends TimeReference.Milliseconds
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.cache2k.operation.TimeReference
TimeReference.Default, TimeReference.Milliseconds
-
-
Field Summary
-
Fields inherited from interface org.cache2k.operation.TimeReference
DEFAULT, MINIMUM_TICKS
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
sleep(long ticks)
Wait for the specified amount of time.long
ticks()
Returns the timer ticks since a reference point, typically milliseconds since epoch.-
Methods inherited from class org.cache2k.operation.TimeReference.Milliseconds
ticksToInstant, ticksToMillisCeiling, toTicks
-
-
-
-
Method Detail
-
ticks
public long ticks()
Description copied from interface:TimeReference
Returns the timer ticks since a reference point, typically milliseconds since epoch. Expected to be always equal or higher than 100L.
-
sleep
public void sleep(long ticks) throws InterruptedException
Description copied from interface:TimeReference
Wait for the specified amount of time. This is only executed by tests and never by the cache itself.The value of 0 means that the thread should pause and other processing should be done. In a simulated clock this would wait for concurrent processing and, if no processing is happening, advance the time to the next event.
- Throws:
InterruptedException
-
-