Class ClockFactory
java.lang.Object
org.apache.logging.log4j.core.util.ClockFactory
Factory for
Clock objects.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName of the system property that can be used to specify aClockimplementation class. -
Method Summary
Modifier and TypeMethodDescriptionstatic ClockgetClock()Returns aClockinstance depending on the value of system propertyPROPERTY_NAME.
-
Field Details
-
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:
-
-
Method Details
-
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
-