Package org.slf4j.reload4j
Class Reload4jMDCAdapter
java.lang.Object
org.slf4j.reload4j.Reload4jMDCAdapter
- All Implemented Interfaces:
MDCAdapter
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clear all entries in the MDC.void
clearDequeByKey
(String key) Clear the deque(stack) referenced by 'key'.Get the context identified by thekey
parameter.Return a copy of the current thread's context map, with keys and values of type String.Returns a copy of the deque(stack) referenced by 'key'.Pop the stack referenced by 'key' and return the value possibly null.void
Push a value into the deque(stack) referenced by 'key'.void
Put a context value (theval
parameter) as identified with thekey
parameter into the current thread's context map.void
Remove the context identified by thekey
parameter.void
setContextMap
(Map<String, String> contextMap) Set the current thread's context map by first clearing any existing map and then copying the map passed as parameter.
-
Constructor Details
-
Reload4jMDCAdapter
public Reload4jMDCAdapter()
-
-
Method Details
-
clear
Description copied from interface:MDCAdapter
Clear all entries in the MDC.- Specified by:
clear
in interfaceMDCAdapter
-
get
Description copied from interface:MDCAdapter
Get the context identified by thekey
parameter. Thekey
parameter cannot be null.- Specified by:
get
in interfaceMDCAdapter
- Returns:
- the string value identified by the
key
parameter.
-
put
Put a context value (theval
parameter) as identified with thekey
parameter into the current thread's context map. Thekey
parameter cannot be null. Log4j does not support null for theval
parameter.This method delegates all work to log4j's MDC.
- Specified by:
put
in interfaceMDCAdapter
- Throws:
IllegalArgumentException
- in case the "key" or "val" parameter is null
-
remove
Description copied from interface:MDCAdapter
Remove the context identified by thekey
parameter. Thekey
parameter cannot be null.This method does nothing if there is no previous value associated with
key
.- Specified by:
remove
in interfaceMDCAdapter
-
getCopyOfContextMap
Description copied from interface:MDCAdapter
Return a copy of the current thread's context map, with keys and values of type String. Returned value may be null.- Specified by:
getCopyOfContextMap
in interfaceMDCAdapter
- Returns:
- A copy of the current thread's context map. May be null.
-
setContextMap
Description copied from interface:MDCAdapter
Set the current thread's context map by first clearing any existing map and then copying the map passed as parameter. The context map parameter must only contain keys and values of type String. Implementations must support null valued map passed as parameter.- Specified by:
setContextMap
in interfaceMDCAdapter
- Parameters:
contextMap
- must contain only keys and values of type String
-
pushByKey
Description copied from interface:MDCAdapter
Push a value into the deque(stack) referenced by 'key'.- Specified by:
pushByKey
in interfaceMDCAdapter
- Parameters:
key
- identifies the appropriate stackvalue
- the value to push into the stack
-
popByKey
Description copied from interface:MDCAdapter
Pop the stack referenced by 'key' and return the value possibly null.- Specified by:
popByKey
in interfaceMDCAdapter
- Parameters:
key
- identifies the deque(stack)- Returns:
- the value just popped. May be null/
-
getCopyOfDequeByKey
Description copied from interface:MDCAdapter
Returns a copy of the deque(stack) referenced by 'key'. May be null.- Specified by:
getCopyOfDequeByKey
in interfaceMDCAdapter
- Parameters:
key
- identifies the stack- Returns:
- copy of stack referenced by 'key'. May be null.
-
clearDequeByKey
Description copied from interface:MDCAdapter
Clear the deque(stack) referenced by 'key'.- Specified by:
clearDequeByKey
in interfaceMDCAdapter
- Parameters:
key
- identifies the stack
-