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 static java.lang.StringPROPERTY_NAMEName of the system property that can be used to specify aClockimplementation class.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ClockgetClock()Returns aClockinstance depending on the value of system propertyPROPERTY_NAME.
-
-
-
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
-
-
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
-
-