Top Description Fields Constructors Methods
org.apache.logging.log4j.spi

public Class Provider

extends Object
Class Inheritance
Imports
java.lang.ref.WeakReference, java.net.URL, java.util.Properties, org.apache.logging.log4j.Logger, org.apache.logging.log4j.status.StatusLogger

Model class for a Log4j 2 provider. The properties in this class correspond to the properties used in a META-INF/log4j-provider.properties file. Note that this class is automatically created by Log4j and should not be used by providers.

Field Summary

Modifier and TypeField and Description
private final WeakReference<ClassLoader>
private final String
private static final Integer
public static final String
FACTORY_PRIORITY

Property name to set for a Log4j 2 provider to specify the priority of this implementation.

private static final Logger
public static final String
LOGGER_CONTEXT_FACTORY

Property name to set to the implementation of org.apache.logging.log4j.spi.LoggerContextFactory.

private final Class<? extends LoggerContextFactory>
private final Integer
public static final String
THREAD_CONTEXT_MAP

Property name to set to the implementation of org.apache.logging.log4j.spi.ThreadContextMap.

private final String
private final Class<? extends ThreadContextMap>
private final URL
private final String

Constructor Summary

AccessConstructor and Description
public
Provider(final Properties props, final URL url, final ClassLoader classLoader)

public
Provider(final Integer priority, final String versions, final Class<? extends LoggerContextFactory> loggerContextFactoryClass)

public
Provider(final Integer priority, final String versions, final Class<? extends LoggerContextFactory> loggerContextFactoryClass, final Class<? extends ThreadContextMap> threadContextMapClass)

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(final Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public String

Returns:

the class name of a LoggerContextFactory implementation
getClassName
()

Gets the class name of the org.apache.logging.log4j.spi.LoggerContextFactory implementation of this Provider.

public Integer

Returns:

the priority of this Provider
getPriority
()

Gets the priority (natural ordering) of this Provider.

public String

Returns:

the class name of a ThreadContextMap implementation
getThreadContextMap
()

Gets the class name of the org.apache.logging.log4j.spi.ThreadContextMap implementation of this Provider.

public URL

Returns:

the URL corresponding to the Provider META-INF/log4j-provider.properties file
getUrl
()

Gets the URL containing this Provider's Log4j details.

public String

Returns:

A String containing the Log4j versions supported.
getVersions
()

Returns the Log4j API versions supported by the implementation.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public Class<? extends LoggerContextFactory>

Returns:

the LoggerContextFactory implementation class or null if there was an error loading it
loadLoggerContextFactory
()

Loads the org.apache.logging.log4j.spi.LoggerContextFactory class specified by this Provider.

public Class<? extends ThreadContextMap>

Returns:

the ThreadContextMap implementation class or null if there was an error loading it
loadThreadContextMap
()

Loads the org.apache.logging.log4j.spi.ThreadContextMap class specified by this Provider.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

classLoaderback to summary
private final WeakReference<ClassLoader> classLoader
classNameback to summary
private final String className
DEFAULT_PRIORITYback to summary
private static final Integer DEFAULT_PRIORITY
FACTORY_PRIORITYback to summary
public static final String FACTORY_PRIORITY

Property name to set for a Log4j 2 provider to specify the priority of this implementation.

LOGGERback to summary
private static final Logger LOGGER
LOGGER_CONTEXT_FACTORYback to summary
public static final String LOGGER_CONTEXT_FACTORY

Property name to set to the implementation of org.apache.logging.log4j.spi.LoggerContextFactory.

loggerContextFactoryClassback to summary
private final Class<? extends LoggerContextFactory> loggerContextFactoryClass
priorityback to summary
private final Integer priority
THREAD_CONTEXT_MAPback to summary
public static final String THREAD_CONTEXT_MAP

Property name to set to the implementation of org.apache.logging.log4j.spi.ThreadContextMap.

threadContextMapback to summary
private final String threadContextMap
threadContextMapClassback to summary
private final Class<? extends ThreadContextMap> threadContextMapClass
urlback to summary
private final URL url
versionsback to summary
private final String versions

Constructor Detail

Providerback to summary
public Provider(final Properties props, final URL url, final ClassLoader classLoader)
Providerback to summary
public Provider(final Integer priority, final String versions, final Class<? extends LoggerContextFactory> loggerContextFactoryClass)
Providerback to summary
public Provider(final Integer priority, final String versions, final Class<? extends LoggerContextFactory> loggerContextFactoryClass, final Class<? extends ThreadContextMap> threadContextMapClass)

Method Detail

equalsback to summary
public boolean equals(final Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getClassNameback to summary
public String getClassName()

Gets the class name of the org.apache.logging.log4j.spi.LoggerContextFactory implementation of this Provider.

Returns:String

the class name of a LoggerContextFactory implementation

getPriorityback to summary
public Integer getPriority()

Gets the priority (natural ordering) of this Provider.

Returns:Integer

the priority of this Provider

getThreadContextMapback to summary
public String getThreadContextMap()

Gets the class name of the org.apache.logging.log4j.spi.ThreadContextMap implementation of this Provider.

Returns:String

the class name of a ThreadContextMap implementation

getUrlback to summary
public URL getUrl()

Gets the URL containing this Provider's Log4j details.

Returns:URL

the URL corresponding to the Provider META-INF/log4j-provider.properties file

getVersionsback to summary
public String getVersions()

Returns the Log4j API versions supported by the implementation.

Returns:String

A String containing the Log4j versions supported.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
loadLoggerContextFactoryback to summary
public Class<? extends LoggerContextFactory> loadLoggerContextFactory()

Loads the org.apache.logging.log4j.spi.LoggerContextFactory class specified by this Provider.

Returns:Class<? extends LoggerContextFactory>

the LoggerContextFactory implementation class or null if there was an error loading it

loadThreadContextMapback to summary
public Class<? extends ThreadContextMap> loadThreadContextMap()

Loads the org.apache.logging.log4j.spi.ThreadContextMap class specified by this Provider.

Returns:Class<? extends ThreadContextMap>

the ThreadContextMap implementation class or null if there was an error loading it

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override