stack or map and them removes them when the object is closed, e.g. as part
of a try-with-resources. User code can now look like this:
try (final CloseableThreadContext.Instance ignored = CloseableThreadContext.put(key1, value1).put(key2, value2)) {
callSomeMethodThatLogsALot();
// Entries for key1 and key2 are automatically removed from the ThreadContext map when done.
}
| Modifier and Type | Class and Description |
|---|---|
| public static class |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static CloseableThreadContext. | |
| public static CloseableThreadContext. | |
| public static CloseableThreadContext. | |
| public static CloseableThreadContext. | |
| public static CloseableThreadContext. |
| CloseableThreadContext | back to summary |
|---|---|
| private CloseableThreadContext() | |
| push | back to summary |
|---|---|
| public static CloseableThreadContext. Pushes new diagnostic context information on to the Thread Context Stack. The information will be popped off when the instance is closed.
| |
| push | back to summary |
|---|---|
| public static CloseableThreadContext. Pushes new diagnostic context information on to the Thread Context Stack. The information will be popped off when the instance is closed.
| |
| pushAll | back to summary |
|---|---|
| public static CloseableThreadContext. Populates the Thread Context Stack with the supplied stack. The information will be popped off when the instance is closed.
| |
| put | back to summary |
|---|---|
| public static CloseableThreadContext. Populates the Thread Context Map with the supplied key/value pair. Any existing key in the
| |
| putAll | back to summary |
|---|---|
| public static CloseableThreadContext. Populates the Thread Context Map with the supplied key/value pairs. Any existing keys in the
| |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| private void | |
| private void | |
| public CloseableThreadContext. | |
| public CloseableThreadContext. | |
| public CloseableThreadContext. | |
| public CloseableThreadContext. | |
| public CloseableThreadContext. |
| originalValues | back to summary |
|---|---|
| private final Map<String, String> originalValues | |
| pushCount | back to summary |
|---|---|
| private int pushCount | |
| Instance | back to summary |
|---|---|
| private Instance() | |
| close | back to summary |
|---|---|
| public void close() Implements java. Removes the values from the
Values pushed to the
Values put on the
| |
| closeMap | back to summary |
|---|---|
| private void closeMap() | |
| closeStack | back to summary |
|---|---|
| private void closeStack() | |
| push | back to summary |
|---|---|
| public CloseableThreadContext. Pushes new diagnostic context information on to the Thread Context Stack. The information will be popped off when the instance is closed.
| |
| push | back to summary |
|---|---|
| public CloseableThreadContext. Pushes new diagnostic context information on to the Thread Context Stack. The information will be popped off when the instance is closed.
| |
| pushAll | back to summary |
|---|---|
| public CloseableThreadContext. Populates the Thread Context Stack with the supplied stack. The information will be popped off when the instance is closed.
| |
| put | back to summary |
|---|---|
| public CloseableThreadContext. Populates the Thread Context Map with the supplied key/value pair. Any existing key in the
| |
| putAll | back to summary |
|---|---|
| public CloseableThreadContext. Populates the Thread Context Map with the supplied key/value pairs. Any existing keys in the
| |