This class also emulates the LogManager functions for creating new objects from string class names. This is to support initial setup of objects such as log filters, formatters, error managers, etc.
This class should never be exposed outside of this package. Keep this class package private (default access).
| Modifier and Type | Field and Description |
|---|---|
| private static final Object | LOG_MANAGER
Caches the LogManager or Properties so we only read the configuration once. |
| private static final Method | LR_GET_INSTANT
Holds the method used to get the LogRecord instant if running on JDK 9 or later. |
| private final String | prefix
The namespace prefix to search LogManager and defaults. |
| private static volatile String[] | REFLECT_NAMES
Caches the read only reflection class names string array. |
| private static final long | serialVersionUID
Generated serial id.
|
| private static final Method | ZDT_OF_INSTANT
Holds the method used to convert and instant to a zoned date time if running on JDK 9 later. |
| private static final Method | ZI_SYSTEM_DEFAULT
Holds the method used to get the default time zone if running on JDK 9 or later. |
| Access | Constructor and Description |
|---|---|
| pack-priv | LogManagerProperties(final Properties
the parent properties. parent, final String the namespace prefix. prefix)Creates a log manager properties object. |
| Modifier and Type | Method and Description |
|---|---|
| private static void | checkLoggingAccess()
Check that the current context is trusted to modify the logging configuration when the LogManager is not present. |
| pack-priv static void | checkLogManagerAccess()
Check that the current context is trusted to modify the logging configuration. |
| public synchronized Object | Returns: the snapshot.Overrides java. |
| public synchronized boolean | Returns: the value for the key or null.any key. key)Overrides java. Implements java. |
| public boolean | Returns: true if equal, otherwise false.any object or null. o)Overrides java. Implements java. |
| private Properties | Returns: the safe snapshot.the defaults to use with the snapshot. parent)Creates a public snapshot of this properties object using the given parent properties. |
| private static Class | |
| pack-priv static String | Returns: the LogManager.the property name. name)Gets LogManger property for the running JVM. |
| public synchronized Object | Returns: the value for the key or null.any key. key)Overrides java. Implements java. |
| private static ClassLoader[] | Returns: any array of class loaders. Indexes may be null.Gets the class loaders using elevated privileges. |
| pack-priv static String | Returns: the local host name or null.the service to examine. s)Gets the local host name from the given service. |
| public synchronized String | Returns: the value for that key.a non null key. key)Overrides java. |
| public String | Returns: the value for the key.a key to search for. key, final String the default value to use if not found. def)Overrides java. |
| pack-priv static Comparable | Returns: null if LogRecord doesn't support nanoseconds otherwise a new zoned date time is returned.used to generate the zoned date time. record)Gets the ZonedDateTime from the given log record. |
| public int | Returns: the hash code.Overrides java. Implements java. |
| pack-priv static boolean | Returns: true if a LogManager is present.Determines if access to the |
| pack-priv static boolean | Returns: true if the given class namethe fully qualified class name. name)Determines if the given class name is a reflection class name responsible for invoking methods and or constructors. |
| pack-priv static boolean | Returns: true if the given class namethe fully qualified class name. name)Determines if the given class name identifies a utility class. |
| private static Object | Returns: the LogManager or a loaded Properties object.Get the LogManager or loads a Properties object to use as the LogManager. |
| pack-priv static Comparator | Returns: a new comparator.the fully qualified class name. name)Creates a new log record comparator from the given class name. |
| pack-priv static ErrorManager | Returns: a new error manager.the fully qualified class name. name)Creates a new error manager from the given class name. |
| pack-priv static Filter | |
| pack-priv static Formatter | Returns: a new formatter.the fully qualified class name. name)Creates a new formatter from the given class name. |
| pack-priv static < The generic class type. T> T | Returns: a new object assignable to the given type.the fully qualified class name. name, Class<T> the assignable type for the given name. type)Creates a new object from the given class name. |
| private static Exception | Returns: the exception.any invocation target. ite)Returns the given exception or throws the escaping cause. |
| pack-priv static long | Returns: the number of milliseconds parsed from the duration.an ISO-8601 duration character sequence. value)Used to parse an ISO-8601 duration format of |
| private Object | |
| public Enumeration | Returns: the property namesOverrides java. |
| public synchronized Object | Returns: the value for the key or the default value for the key.any key. key, final Object the value value)Overrides java. Implements java. |
| private static Properties | Returns: a properties object loaded with the default configuration.Create a properties object from the default logging configuration file. |
| private static String[] | Returns: a string array containing the fully qualified class names.Determines all of the reflection class names used to invoke methods. |
| public synchronized Object | Returns: the value for the key or the default value for the key.any key. key)Overrides java. Implements java. |
| pack-priv static < the element type to be compared T> Comparator | Returns: A comparator that imposes the reverse ordering of the specified comparator.a comparator whose ordering is to be reversed by the returned
comparator c)Returns a comparator that imposes the reverse ordering of the specified
|
| public Object | Returns: the value for the key or the default value for the key.any key. key, String the value corresponding to value)key.Overrides java. |
| pack-priv static String | Returns: the language tag.the locale to convert. locale)Converts a locale to a language tag. |
| private static Class | Returns: the raw class.the class name. name, ClassLoader any class loader or null. l)Loads a class using the given loader or the class loader of this class. |
| private static InvocationTargetException | Returns: an InvocationTargetException.the error. eiie)Throws the given error if the cause is an error otherwise the given error is wrapped. |
| private synchronized Object |
| LOG_MANAGER | back to summary |
|---|---|
| private static final Object LOG_MANAGER Caches the LogManager or Properties so we only read the configuration once. | |
| LR_GET_INSTANT | back to summary |
|---|---|
| private static final Method LR_GET_INSTANT Holds the method used to get the LogRecord instant if running on JDK 9 or later. | |
| prefix | back to summary |
|---|---|
| private final String prefix The namespace prefix to search LogManager and defaults. | |
| REFLECT_NAMES | back to summary |
|---|---|
| private static volatile String[] REFLECT_NAMES Caches the read only reflection class names string array. Declared volatile for safe publishing only. The VO_VOLATILE_REFERENCE_TO_ARRAY warning is a false positive.
| |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. Generated serial id. | |
| ZDT_OF_INSTANT | back to summary |
|---|---|
| private static final Method ZDT_OF_INSTANT Holds the method used to convert and instant to a zoned date time if running on JDK 9 later. | |
| ZI_SYSTEM_DEFAULT | back to summary |
|---|---|
| private static final Method ZI_SYSTEM_DEFAULT Holds the method used to get the default time zone if running on JDK 9 or later. | |
| LogManagerProperties | back to summary |
|---|---|
| pack-priv LogManagerProperties(final Properties parent, final String prefix) Creates a log manager properties object.
| |
| checkLoggingAccess | back to summary |
|---|---|
| private static void checkLoggingAccess() Check that the current context is trusted to modify the logging configuration when the LogManager is not present. This requires LoggingPermission("control").
| |
| checkLogManagerAccess | back to summary |
|---|---|
| pack-priv static void checkLogManagerAccess() Check that the current context is trusted to modify the logging configuration. This requires LoggingPermission("control").
| |
| clone | back to summary |
|---|---|
| public synchronized Object clone() Overrides java. Returns a properties object that contains a snapshot of the current state. This method violates the clone contract so that no instances of LogManagerProperties is exported for public use.
| |
| containsKey | back to summary |
|---|---|
| public synchronized boolean containsKey(final Object key) Overrides java. Implements java. Required to work with PropUtil. An updated copy of the key is fetched from the log manager prior to returning. | |
| equals | back to summary |
|---|---|
| public boolean equals(final Object o) Overrides java. Implements java. It is assumed that this method will never be called. The prefix value is not used for the equals method. | |
| exportCopy | back to summary |
|---|---|
| private Properties exportCopy(final Properties parent) Creates a public snapshot of this properties object using the given parent properties.
| |
| findClass | back to summary |
|---|---|
| private static Class This code is modified from the LogManager, which explictly states searching the system class loader first, then the context class loader. There is resistance (compatibility) to change this behavior to simply searching the context class loader.
| |
| fromLogManager | back to summary |
|---|---|
| pack-priv static String fromLogManager(final String name) Gets LogManger property for the running JVM. If the LogManager doesn't exist then the default LogManger properties are used.
| |
| get | back to summary |
|---|---|
| public synchronized Object get(final Object key) Overrides java. Implements java. Required to work with PropUtil. Calls getProperty directly if the given key is a string. Otherwise, performs a get operation on the defaults followed by the normal hash table get. | |
| getClassLoaders | back to summary |
|---|---|
| private static ClassLoader[] getClassLoaders() Gets the class loaders using elevated privileges.
| |
| getLocalHost | back to summary |
|---|---|
| pack-priv static String getLocalHost(final Object s) throws Exception Gets the local host name from the given service.
| |
| getProperty | back to summary |
|---|---|
| public synchronized String getProperty(final String key) Overrides java. Searches defaults, then searches the log manager if available or the system properties by the prefix property, and then by the key itself. | |
| getProperty | back to summary |
|---|---|
| public String getProperty(final String key, final String def) Overrides java. Calls getProperty directly. If getProperty returns null the default value is returned. | |
| getZonedDateTime | back to summary |
|---|---|
| pack-priv static Comparable Gets the ZonedDateTime from the given log record.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Implements java. It is assumed that this method will never be called. See equals.
| |
| hasLogManager | back to summary |
|---|---|
| pack-priv static boolean hasLogManager() Determines if access to the
| |
| isReflectionClass | back to summary |
|---|---|
| pack-priv static boolean isReflectionClass(String name) throws Exception Determines if the given class name is a reflection class name responsible for invoking methods and or constructors.
| |
| isStaticUtilityClass | back to summary |
|---|---|
| pack-priv static boolean isStaticUtilityClass(String name) throws Exception Determines if the given class name identifies a utility class.
| |
| loadLogManager | back to summary |
|---|---|
| private static Object loadLogManager() Get the LogManager or loads a Properties object to use as the LogManager.
| |
| newComparator | back to summary |
|---|---|
| pack-priv static Comparator Creates a new log record comparator from the given class name.
| |
| newErrorManager | back to summary |
|---|---|
| pack-priv static ErrorManager newErrorManager(String name) throws Exception Creates a new error manager from the given class name.
| |
| newFilter | back to summary |
|---|---|
| pack-priv static Filter newFilter(String name) throws Exception Creates a new filter from the given class name.
| |
| newFormatter | back to summary |
|---|---|
| pack-priv static Formatter newFormatter(String name) throws Exception Creates a new formatter from the given class name.
| |
| newObjectFrom | back to summary |
|---|---|
| pack-priv static <T> T newObjectFrom(String name, Class<T> type) throws Exception Creates a new object from the given class name.
| |
| paramOrError | back to summary |
|---|---|
| private static Exception paramOrError(InvocationTargetException ite) Returns the given exception or throws the escaping cause.
| |
| parseDurationToMillis | back to summary |
|---|---|
| pack-priv static long parseDurationToMillis(final CharSequence value) throws Exception Used to parse an ISO-8601 duration format of
| |
| preWrite | back to summary |
|---|---|
| private Object preWrite(final Object key) Called before a write operation of a key. Caches a key read from the log manager in this properties object. The key is only cached if it is an instance of a String and this properties doesn't contain a copy of the key. | |
| propertyNames | back to summary |
|---|---|
| public Enumeration Overrides java. It is assumed that this method will never be called. No way to get the property names from LogManager.
| |
| put | back to summary |
|---|---|
| public synchronized Object put(final Object key, final Object value) Overrides java. Implements java. Required to work with PropUtil. An updated copy of the key is fetched from the log manager if the key doesn't exist in this properties.
| |
| readConfiguration | back to summary |
|---|---|
| private static Properties readConfiguration() Create a properties object from the default logging configuration file. Since the LogManager is not available in restricted environments, only the default configuration is applicable.
| |
| reflectionClassNames | back to summary |
|---|---|
| private static String[] reflectionClassNames() throws Exception Determines all of the reflection class names used to invoke methods. This method performs indirect and direct calls on a throwable to capture the standard class names and the implementation class names. | |
| remove | back to summary |
|---|---|
| public synchronized Object remove(final Object key) Overrides java. Implements java. Required to work with PropUtil. An updated copy of the key is fetched from the log manager if the key doesn't exist in this properties. | |
| reverseOrder | back to summary |
|---|---|
| pack-priv static <T> Comparator Returns a comparator that imposes the reverse ordering of the specified
| |
| setProperty | back to summary |
|---|---|
| public Object setProperty(String key, String value) Overrides java. Calls the put method directly.
| |
| toLanguageTag | back to summary |
|---|---|
| pack-priv static String toLanguageTag(final Locale locale) Converts a locale to a language tag.
| |
| tryLoad | back to summary |
|---|---|
| private static Class Loads a class using the given loader or the class loader of this class.
| |
| wrapOrThrow | back to summary |
|---|---|
| private static InvocationTargetException wrapOrThrow(ExceptionInInitializerError eiie) Throws the given error if the cause is an error otherwise the given error is wrapped.
| |
| writeReplace | back to summary |
|---|---|
| private synchronized Object writeReplace() throws ObjectStreamException It is assumed that this method will never be called. We return a safe copy for export to avoid locking this properties object or the defaults during write.
| |