Package io.quarkus.vertx.core.runtime
Enum Class VertxMDC
- All Implemented Interfaces:
Serializable,Comparable<VertxMDC>,Constable,org.jboss.logmanager.MDCProvider
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final InheritableThreadLocal<Map<String, Object>> -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear the contents of the current MDC map.voidclear(io.vertx.core.Context vertxContext) Clears the contents of the current MDC map in the Context.(package private) voidclearVertxMdcFromContext(io.vertx.core.Context vertxContext) Clears out the object ref from the context to force a new one to be created and prevent thread crosstalk.copy()Get a copy of the MDC map.copy(io.vertx.core.Context vertxContext) Get a copy of the MDC map.Get a copy of the MDC map.copyObject(io.vertx.core.Context vertxContext) Get a copy of the MDC map.Get the value for a key, ornullif there is no mapping.Get the value for a key the in specified Context, ornullif there is no mapping.getKeys()Get the value for a key, ornullif there is no mapping.Get the value for a key the in specified Context, ornullif there is no mapping.booleanisEmpty()Determine whether the current MDC map is empty.booleanisEmpty(io.vertx.core.Context vertxContext) Determine whether the current MDC map is empty on the provided contextSet the value of a key, returning the old value (if any) ornullif there was none.Set the value of a key, returning the old value (if any) ornullif there was none.voidSets several entries.Set the value of a key, returning the old value (if any) ornullif there was none.Set the value of a key, returning the old value (if any) ornullif there was none.voidreinitializeVertxMdc(io.vertx.core.Context vertxContext, Set<String> discardMdcKeys) Clears out the object ref from the context to force a new one to be created and prevent thread crosstalk.Removes a key.Removes a key.removeObject(String key) Removes a key.removeObject(String key, io.vertx.core.Context vertxContext) Removes a key.static VertxMDCReturns the enum constant of this class with the specified name.static VertxMDC[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
-
-
Field Details
-
inheritableThreadLocalMap
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-
get
Get the value for a key, ornullif 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:
getin interfaceorg.jboss.logmanager.MDCProvider- Parameters:
key- the key- Returns:
- the value
-
getObject
Get the value for a key, ornullif 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:
getObjectin interfaceorg.jboss.logmanager.MDCProvider- Parameters:
key- the key- Returns:
- the value
-
get
Get the value for a key the in specified Context, ornullif 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
Get the value for a key the in specified Context, ornullif 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
Set the value of a key, returning the old value (if any) ornullif 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:
putin interfaceorg.jboss.logmanager.MDCProvider- Parameters:
key- the keyvalue- the new value- Returns:
- the old value or
nullif there was none
-
putObject
Set the value of a key, returning the old value (if any) ornullif 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:
putObjectin interfaceorg.jboss.logmanager.MDCProvider- Parameters:
key- the keyvalue- the new value- Returns:
- the old value or
nullif there was none
-
put
Set the value of a key, returning the old value (if any) ornullif 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
nullif there was none
-
putObject
Set the value of a key, returning the old value (if any) ornullif 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
nullif there was none
-
putAll
Sets several entries.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. Will look up the contextual data map just once.
- Parameters:
map- contents to addvertxContext-
-
remove
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:
removein interfaceorg.jboss.logmanager.MDCProvider- Parameters:
key- the key- Returns:
- the old value or
nullif there was none
-
removeObject
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:
removeObjectin interfaceorg.jboss.logmanager.MDCProvider- Parameters:
key- the key- Returns:
- the old value or
nullif there was none
-
remove
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
nullif there was none
-
removeObject
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
nullif there was none
-
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:
copyin interfaceorg.jboss.logmanager.MDCProvider- Returns:
- a copy of the map
-
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:
copyObjectin interfaceorg.jboss.logmanager.MDCProvider- Returns:
- a copy of the map
-
isEmpty
public boolean isEmpty()Determine whether the current MDC map is empty.- Specified by:
isEmptyin interfaceorg.jboss.logmanager.MDCProvider- Returns:
trueif there are no bound MDC values, orfalseotherwise
-
isEmpty
public boolean isEmpty(io.vertx.core.Context vertxContext) Determine whether the current MDC map is empty on the provided context- Parameters:
vertxContext-- Returns:
-
getKeys
-
copy
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
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 contents of 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:
clearin interfaceorg.jboss.logmanager.MDCProvider
-
clear
public void clear(io.vertx.core.Context vertxContext) Clears the contents of the current MDC map in the Context. If the informed context is null it falls back to the thread local context map. -
clearVertxMdcFromContext
void clearVertxMdcFromContext(io.vertx.core.Context vertxContext) Clears out the object ref from the context to force a new one to be created and prevent thread crosstalk. Should be used before adding data to the VertxMCD context on a new thread.- Parameters:
vertxContext-
-
reinitializeVertxMdc
Clears out the object ref from the context to force a new one to be created and prevent thread crosstalk. Also copies to the new reference any previous data not in the set of MDC keys to discard.- Parameters:
vertxContext-discardMdcKeys- Entries not to be copied over to the new MDC
-