Class ClockFactory
- java.lang.Object
-
- org.apache.logging.log4j.core.util.ClockFactory
-
public final class ClockFactory extends java.lang.ObjectFactory forClockobjects.
-
-
Field Summary
Fields Modifier and Type Field Description private static StatusLoggerLOGGERstatic java.lang.StringPROPERTY_NAMEName of the system property that can be used to specify aClockimplementation class.
-
Constructor Summary
Constructors Modifier Constructor Description privateClockFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static java.util.Map<java.lang.String,Supplier<Clock>>aliases()private static ClockcreateClock()static ClockgetClock()Returns aClockinstance depending on the value of system propertyPROPERTY_NAME.private static ClocklogSupportedPrecision(Clock clock)
-
-
-
Field Detail
-
PROPERTY_NAME
public static final java.lang.String PROPERTY_NAME
Name of the system property that can be used to specify aClockimplementation class. The value of this property is "log4j.Clock".- See Also:
- Constant Field Values
-
LOGGER
private static final StatusLogger LOGGER
-
-
Method Detail
-
getClock
public static Clock getClock()
Returns aClockinstance depending on the value of system propertyPROPERTY_NAME.If system property
log4j.Clock=CachedClockis specified, this method returns an instance ofCachedClock. If system propertylog4j.Clock=CoarseCachedClockis specified, this method returns an instance ofCoarseCachedClock.If another value is specified, this value is taken as the fully qualified class name of a class that implements the
Clockinterface. An object of this class is instantiated and returned.If no value is specified, or if the specified value could not correctly be instantiated or did not implement the
Clockinterface, then an instance ofSystemClockis returned.- Returns:
- a
Clockinstance
-
createClock
private static Clock createClock()
-
-