Top Inners Fields Constructors Methods
org.jboss.logmanager

pack-priv final Class ThreadLocalMDC

extends Object
implements MDCProvider
Class Inheritance
All Implemented Interfaces
org.jboss.logmanager.MDCProvider
Imports
java.util.Map

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private static final ThreadLocalMDC.Holder

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Implements org.jboss.logmanager.MDCProvider.clear.

Clear the current MDC map.

public Map<String, String>
copy()

Implements org.jboss.logmanager.MDCProvider.copy.

Get a copy of the MDC map.

public Map<String, Object>
copyObject()

Implements org.jboss.logmanager.MDCProvider.copyObject.

Get a copy of the MDC map.

public String
get(String
the key
key
)

Implements org.jboss.logmanager.MDCProvider.get.

Get the value for a key, or null if there is no mapping.

public Object
getObject(String
the key
key
)

Implements org.jboss.logmanager.MDCProvider.getObject.

Get the value for a key, or null if there is no mapping.

public boolean
isEmpty()

Implements org.jboss.logmanager.MDCProvider.isEmpty.

Returns true if the backing MDC map is empty, otherwise false.

public String
put(String
the key
key
,
String
the new value
value
)

Implements org.jboss.logmanager.MDCProvider.put.

Set the value of a key, returning the old value (if any) or null if there was none.

public Object
putObject(String
the key
key
,
Object
the new value
value
)

Implements org.jboss.logmanager.MDCProvider.putObject.

Set the value of a key, returning the old value (if any) or null if there was none.

public String
remove(String
the key
key
)

Implements org.jboss.logmanager.MDCProvider.remove.

Remove a key.

public Object
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

mdcback to summary
private static final ThreadLocalMDC.Holder mdc

Constructor Detail

ThreadLocalMDCback to summary
pack-priv ThreadLocalMDC()

Method Detail

clearback to summary
public void clear()

Implements org.jboss.logmanager.MDCProvider.clear.

Doc from org.jboss.logmanager.MDCProvider.clear.

Clear the current MDC map.

Annotations
@Override
copyback to summary
public Map<String, String> copy()

Implements org.jboss.logmanager.MDCProvider.copy.

Doc from org.jboss.logmanager.MDCProvider.copy.

Get a copy of the MDC map. This is a relatively expensive operation.

Returns:Map<String, String>

a copy of the map

Annotations
@Override
copyObjectback to summary
public Map<String, Object> copyObject()

Implements org.jboss.logmanager.MDCProvider.copyObject.

Doc from org.jboss.logmanager.MDCProvider.copyObject.

Get a copy of the MDC map. This is a relatively expensive operation.

Returns:Map<String, Object>

a copy of the map

Annotations
@Override
getback to summary
public String get(String key)

Implements org.jboss.logmanager.MDCProvider.get.

Doc from org.jboss.logmanager.MDCProvider.get.

Get the value for a key, or null if there is no mapping.

Parameters
key:String

the key

Returns:String

the value

Annotations
@Override
getObjectback to summary
public Object getObject(String key)

Implements org.jboss.logmanager.MDCProvider.getObject.

Doc from org.jboss.logmanager.MDCProvider.getObject.

Get the value for a key, or null if there is no mapping.

Parameters
key:String

the key

Returns:Object

the value

Annotations
@Override
isEmptyback to summary
public boolean isEmpty()

Implements org.jboss.logmanager.MDCProvider.isEmpty.

Doc from org.jboss.logmanager.MDCProvider.isEmpty.

Returns true if the backing MDC map is empty, otherwise false.

Returns:boolean

true if the MDC map is empty

Annotations
@Override
putback to summary
public String put(String key, String value)

Implements org.jboss.logmanager.MDCProvider.put.

Doc from org.jboss.logmanager.MDCProvider.put.

Set the value of a key, returning the old value (if any) or null if there was none.

Parameters
key:String

the key

value:String

the new value

Returns:String

the old value or null if there was none

Annotations
@Override
putObjectback to summary
public Object putObject(String key, Object value)

Implements org.jboss.logmanager.MDCProvider.putObject.

Doc from org.jboss.logmanager.MDCProvider.putObject.

Set the value of a key, returning the old value (if any) or null if there was none.

Parameters
key:String

the key

value:Object

the new value

Returns:Object

the old value or null if there was none

Annotations
@Override
removeback to summary
public String remove(String key)

Implements org.jboss.logmanager.MDCProvider.remove.

Doc from org.jboss.logmanager.MDCProvider.remove.

Remove a key.

Parameters
key:String

the key

Returns:String

the old value or null if there was none

Annotations
@Override
removeObjectback to summary
public Object removeObject(String key)

Implements org.jboss.logmanager.MDCProvider.removeObject.

Doc from org.jboss.logmanager.MDCProvider.removeObject.

Remove a key.

Parameters
key:String

the key

Returns:Object

the old value or null if there was none

Annotations
@Override
org.jboss.logmanager back to summary

private final Class ThreadLocalMDC.Holder

extends InheritableThreadLocal<FastCopyHashMap<String, Object>>
Class Inheritance

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
protected FastCopyHashMap<String, Object>
childValue(final FastCopyHashMap<String, Object>
the parent thread's value
parentValue
)

Overrides java.lang.InheritableThreadLocal.childValue.

Computes the child's initial value for this inheritable thread-local variable as a function of the parent's value at the time the child thread is created.

protected FastCopyHashMap<String, Object>
initialValue()

Overrides java.lang.ThreadLocal.initialValue.

Returns the current thread's "initial value" for this thread-local variable.

Constructor Detail

Holderback to summary
private Holder()

Method Detail

childValueback to summary
protected FastCopyHashMap<String, Object> childValue(final FastCopyHashMap<String, Object> parentValue)

Overrides java.lang.InheritableThreadLocal.childValue.

Doc from java.lang.InheritableThreadLocal.childValue.

Computes the child's initial value for this inheritable thread-local variable as a function of the parent's value at the time the child thread is created. This method is called from within the parent thread before the child is started.

This method merely returns its input argument, and should be overridden if a different behavior is desired.

Parameters
parentValue:FastCopyHashMap<String, Object>

the parent thread's value

Returns:FastCopyHashMap<String, Object>

the child thread's initial value

Annotations
@Override
initialValueback to summary
protected FastCopyHashMap<String, Object> initialValue()

Overrides java.lang.ThreadLocal.initialValue.

Doc from java.lang.ThreadLocal.initialValue.

Returns the current thread's "initial value" for this thread-local variable. This method will be invoked the first time a thread accesses the variable with the get method, unless the thread previously invoked the set method, in which case the initialValue method will not be invoked for the thread. Normally, this method is invoked at most once per thread, but it may be invoked again in case of subsequent invocations of remove followed by get.

Returns:FastCopyHashMap<String, Object>

the initial value for this thread-local

Annotations
@Override