com.hazelcast.util
Class Clock

java.lang.Object
  extended by com.hazelcast.util.Clock

public final class Clock
extends Object

Utility class to be able to simulate different time zones. Time offset can be configured with the property com.hazelcast.clock.offset


Nested Class Summary
static class Clock.ClockImpl
          Clock abstraction to be able to simulate different clocks without changing actual system time.
 
Field Summary
static String HAZELCAST_CLOCK_IMPL
          Classname of a Clock.ClockImpl implementation.
static String HAZELCAST_CLOCK_OFFSET
          Clock offset property in milliseconds.
 
Method Summary
static long currentTimeMillis()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HAZELCAST_CLOCK_OFFSET

public static final String HAZELCAST_CLOCK_OFFSET
Clock offset property in milliseconds. When it is set to a non-zero value, currentTimeMillis() will return a shifted System.currentTimeMillis() time by the given offset value.

See Also:
Constant Field Values

HAZELCAST_CLOCK_IMPL

public static final String HAZELCAST_CLOCK_IMPL
Classname of a Clock.ClockImpl implementation. When this property is set, currentTimeMillis() will call the currentTimeMillis() method of given ClockImpl.

See Also:
Constant Field Values
Method Detail

currentTimeMillis

public static long currentTimeMillis()


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.