Package io.quarkus.vertx.core.runtime
Enum VertxMDC
- java.lang.Object
-
- java.lang.Enum<VertxMDC>
-
- io.quarkus.vertx.core.runtime.VertxMDC
-
- All Implemented Interfaces:
Serializable
,Comparable<VertxMDC>
,org.jboss.logmanager.MDCProvider
public enum VertxMDC extends Enum<VertxMDC> implements org.jboss.logmanager.MDCProvider
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INSTANCE
-
Field Summary
Fields Modifier and Type Field Description (package private) InheritableThreadLocal<Map<String,Object>>
inheritableThreadLocalMap
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clear the current MDC map.void
clear(io.vertx.core.Context vertxContext)
Clear the current MDC map.Map<String,String>
copy()
Get a copy of the MDC map.Map<String,String>
copy(io.vertx.core.Context vertxContext)
Get a copy of the MDC map.Map<String,Object>
copyObject()
Get a copy of the MDC map.Map<String,Object>
copyObject(io.vertx.core.Context vertxContext)
Get a copy of the MDC map.String
get(String key)
Get the value for a key, ornull
if there is no mapping.String
get(String key, io.vertx.core.Context vertxContext)
Get the value for a key the in specified Context, ornull
if there is no mapping.Object
getObject(String key)
Get the value for a key, ornull
if there is no mapping.Object
getObject(String key, io.vertx.core.Context vertxContext)
Get the value for a key the in specified Context, ornull
if there is no mapping.String
put(String key, String value)
Set the value of a key, returning the old value (if any) ornull
if there was none.String
put(String key, String value, io.vertx.core.Context vertxContext)
Set the value of a key, returning the old value (if any) ornull
if there was none.Object
putObject(String key, Object value)
Set the value of a key, returning the old value (if any) ornull
if there was none.Object
putObject(String key, Object value, io.vertx.core.Context vertxContext)
Set the value of a key, returning the old value (if any) ornull
if there was none.String
remove(String key)
Removes a key.String
remove(String key, io.vertx.core.Context vertxContext)
Removes a key.Object
removeObject(String key)
Removes a key.Object
removeObject(String key, io.vertx.core.Context vertxContext)
Removes a key.static VertxMDC
valueOf(String name)
Returns the enum constant of this type with the specified name.static VertxMDC[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INSTANCE
public static final VertxMDC INSTANCE
-
-
Field Detail
-
inheritableThreadLocalMap
final InheritableThreadLocal<Map<String,Object>> inheritableThreadLocalMap
-
-
Method Detail
-
values
public static VertxMDC[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (VertxMDC c : VertxMDC.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static VertxMDC valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
get
public String get(String key)
Get the value for a key, ornull
if there is no mapping. Tries to use the current Vert.x Context, if the context is non-existent meaning that it was called out of a Vert.x thread it will fall back to the thread local context map.- Specified by:
get
in interfaceorg.jboss.logmanager.MDCProvider
- Parameters:
key
- the key- Returns:
- the value
-
getObject
public Object getObject(String key)
Get the value for a key, ornull
if there is no mapping. Tries to use the current Vert.x Context, if the context is non-existent meaning that it was called out of a Vert.x thread it will fall back to the thread local context map.- Specified by:
getObject
in interfaceorg.jboss.logmanager.MDCProvider
- Parameters:
key
- the key- Returns:
- the value
-
get
public String get(String key, io.vertx.core.Context vertxContext)
Get the value for a key the in specified Context, ornull
if there is no mapping. If the informed context is null it falls back to the thread local context map.- Parameters:
key
- the keyvertxContext
- the context- Returns:
- the value
-
getObject
public Object getObject(String key, io.vertx.core.Context vertxContext)
Get the value for a key the in specified Context, ornull
if there is no mapping. If the context is null it falls back to the thread local context map.- Parameters:
key
- the keyvertxContext
- the context- Returns:
- the value
-
put
public String put(String key, String value)
Set the value of a key, returning the old value (if any) ornull
if there was none. Tries to use the current Vert.x Context, if the context is non-existent meaning that it was called out of a Vert.x thread it will fall back to the thread local context map.- Specified by:
put
in interfaceorg.jboss.logmanager.MDCProvider
- Parameters:
key
- the keyvalue
- the new value- Returns:
- the old value or
null
if there was none
-
putObject
public Object putObject(String key, Object value)
Set the value of a key, returning the old value (if any) ornull
if there was none. Tries to use the current Vert.x Context, if the context is non-existent meaning that it was called out of a Vert.x thread it will fall back to the thread local context map.- Specified by:
putObject
in interfaceorg.jboss.logmanager.MDCProvider
- Parameters:
key
- the keyvalue
- the new value- Returns:
- the old value or
null
if there was none
-
put
public String put(String key, String value, io.vertx.core.Context vertxContext)
Set the value of a key, returning the old value (if any) ornull
if there was none. If the informed context is null it falls back to the thread local context map.- Parameters:
key
- the keyvalue
- the new value- Returns:
- the old value or
null
if there was none
-
putObject
public Object putObject(String key, Object value, io.vertx.core.Context vertxContext)
Set the value of a key, returning the old value (if any) ornull
if there was none. If the informed context is null it falls back to the thread local context map.- Parameters:
key
- the keyvalue
- the new value- Returns:
- the old value or
null
if there was none
-
remove
public String remove(String key)
Removes a key. Tries to use the current Vert.x Context, if the context is non-existent meaning that it was called out of a Vert.x thread it will fall back to the thread local context map.- Specified by:
remove
in interfaceorg.jboss.logmanager.MDCProvider
- Parameters:
key
- the key- Returns:
- the old value or
null
if there was none
-
removeObject
public Object removeObject(String key)
Removes a key. Tries to use the current Vert.x Context, if the context is non-existent meaning that it was called out of a Vert.x thread it will fall back to the thread local context map.- Specified by:
removeObject
in interfaceorg.jboss.logmanager.MDCProvider
- Parameters:
key
- the key- Returns:
- the old value or
null
if there was none
-
remove
public String remove(String key, io.vertx.core.Context vertxContext)
Removes a key. If the informed context is null it falls back to the thread local context map.- Parameters:
key
- the key- Returns:
- the old value or
null
if there was none
-
removeObject
public Object removeObject(String key, io.vertx.core.Context vertxContext)
Removes a key. If the informed context is null it falls back to the thread local context map.- Parameters:
key
- the key- Returns:
- the old value or
null
if there was none
-
copy
public Map<String,String> copy()
Get a copy of the MDC map. This is a relatively expensive operation. Tries to use the current Vert.x Context, if the context is non-existent meaning that it was called out of a Vert.x thread it will fall back to the thread local context map.- Specified by:
copy
in interfaceorg.jboss.logmanager.MDCProvider
- Returns:
- a copy of the map
-
copyObject
public Map<String,Object> copyObject()
Get a copy of the MDC map. This is a relatively expensive operation. Tries to use the current Vert.x Context, if the context is non-existent meaning that it was called out of a Vert.x thread it will fall back to the thread local context map.- Specified by:
copyObject
in interfaceorg.jboss.logmanager.MDCProvider
- Returns:
- a copy of the map
-
copy
public Map<String,String> copy(io.vertx.core.Context vertxContext)
Get a copy of the MDC map. This is a relatively expensive operation. If the informed context is null it falls back to the thread local context map.- Returns:
- a copy of the map
-
copyObject
public Map<String,Object> copyObject(io.vertx.core.Context vertxContext)
Get a copy of the MDC map. This is a relatively expensive operation. If the informed context is null it falls back to the thread local context map.- Returns:
- a copy of the map
-
clear
public void clear()
Clear the current MDC map. Tries to use the current Vert.x Context, if the context is non-existent meaning that it was called out of a Vert.x thread it will fall back to the thread local context map.- Specified by:
clear
in interfaceorg.jboss.logmanager.MDCProvider
-
clear
public void clear(io.vertx.core.Context vertxContext)
Clear the current MDC map. If the informed context is null it falls back to the thread local context map.
-
-