Top Description Fields Constructors Methods
net.sf.ehcache.util

public final Class Timestamper

extends Object
Class Inheritance
Imports
org.slf4j.Logger, .LoggerFactory, java.util.concurrent.atomic.AtomicLong

Generates increasing identifiers (in a single VM only). Not valid across multiple VMs. Yet, the identifier is based on time, so that the drifting across a cluster should not ever be large...
Author
Alex Snaps

Field Summary

Modifier and TypeField and Description
public static final int
BIN_DIGITS

Value for left shifting System.currentTimeMillis, freeing some space for the counter

private static final Logger
private static final AtomicLong
private static final int
public static final int
ONE_MS

What is one milliseconds, based on "counter value reserved space", for this Timestamper

private static final AtomicLong

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static void
log(final long base, final String message, final Object... params)

public static long

Returns:

uniquely & increasing value
next
()

Returns an increasing unique value based on the System.currentTimeMillis() with some additional reserved space for a counter.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BIN_DIGITSback to summary
public static final int BIN_DIGITS

Value for left shifting System.currentTimeMillis, freeing some space for the counter

LOGback to summary
private static final Logger LOG
LOGGEDback to summary
private static final AtomicLong LOGGED
MAX_LOGback to summary
private static final int MAX_LOG
ONE_MSback to summary
public static final int ONE_MS

What is one milliseconds, based on "counter value reserved space", for this Timestamper

VALUEback to summary
private static final AtomicLong VALUE

Constructor Detail

Timestamperback to summary
private Timestamper()

Method Detail

logback to summary
private static void log(final long base, final String message, final Object... params)
nextback to summary
public static long next()

Returns an increasing unique value based on the System.currentTimeMillis() with some additional reserved space for a counter.

Returns:long

uniquely & increasing value

See Also
net.sf.ehcache.util.Timestamper#BIN_DIGITS