Top Description Fields Constructors Methods
org.jboss.logmanager

public final Class MDC

extends Object
Class Inheritance
Imports
java.security.AccessController, .PrivilegedAction, java.util.Iterator, .Map, .ServiceConfigurationError, .ServiceLoader

Mapped diagnostic context. This is a thread-local map used to hold loggable information.

Field Summary

Modifier and TypeField and Description
private static final MDCProvider

Constructor Summary

AccessConstructor and Description
private
MDC()

Method Summary

Modifier and TypeMethod and Description
public static void
clear()

Clear the current MDC map.

public static Map<String, String>

Returns:

a copy of the map
copy
()

Get a copy of the MDC map.

public static Map<String, Object>

Returns:

a copy of the map
copyObject
()

Get a copy of the MDC map.

private static MDCProvider
public static String

Returns:

the value
get
(String
the key
key
)

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

private static MDCProvider
pack-priv static MDCProvider
public static Object

Returns:

the value
getObject
(String
the key
key
)

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

public static boolean

Returns:

true if the MDC map is empty, otherwise false
isEmpty
()

Checks of the MDC map is empty.

public static String

Returns:

the old value or null if there was none
put
(String
the key
key
,
String
the new value
value
)

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

public static Object

Returns:

the old value or null if there was none
putObject
(String
the key
key
,
Object
the new value
value
)

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

public static String

Returns:

the old value or null if there was none
remove
(String
the key
key
)

Remove a key.

public static Object

Returns:

the old value or null if there was none
removeObject
(String
the key
key
)

Remove a key.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

mdcProviderback to summary
private static final MDCProvider mdcProvider

Constructor Detail

MDCback to summary
private MDC()

Method Detail

clearback to summary
public static void clear()

Clear the current MDC map.

copyback to summary
public static Map<String, String> copy()

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

Returns:Map<String, String>

a copy of the map

copyObjectback to summary
public static Map<String, Object> copyObject()

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

Returns:Map<String, Object>

a copy of the map

doGetDefaultMDCProviderback to summary
private static MDCProvider doGetDefaultMDCProvider()
getback to summary
public static String get(String key)

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

Parameters
key:String

the key

Returns:String

the value

getDefaultMDCProviderback to summary
private static MDCProvider getDefaultMDCProvider()
getMDCProviderback to summary
pack-priv static MDCProvider getMDCProvider()
getObjectback to summary
public static Object getObject(String key)

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

Parameters
key:String

the key

Returns:Object

the value

isEmptyback to summary
public static boolean isEmpty()

Checks of the MDC map is empty.

Returns:boolean

true if the MDC map is empty, otherwise false

putback to summary
public static String put(String key, String value)

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

putObjectback to summary
public static Object putObject(String key, Object value)

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

removeback to summary
public static String remove(String key)

Remove a key.

Parameters
key:String

the key

Returns:String

the old value or null if there was none

removeObjectback to summary
public static Object removeObject(String key)

Remove a key.

Parameters
key:String

the key

Returns:Object

the old value or null if there was none