org.sonatype.gossip.support
Class DC

java.lang.Object
  extended by org.sonatype.gossip.support.DC

public class DC
extends Object

Diagnostic context; provides map and stack facilities.

Since:
1.6
Author:
Jason Dillon

Nested Class Summary
static class DC.State
           
 
Field Summary
static String KEY
          The key in which we publish our contents to in the Slf4j MDC.
static String PREFIX
          String prefixed to MDC value when there is content to publish.
static String SEPARATOR
          String used to separate the stack and context values when both are present.
 
Constructor Summary
DC()
           
 
Method Summary
static void clear()
           
static String get(Class key)
           
static String get(Object key)
           
static DC.State getState()
          Get a copy of the state for the current thread.
static boolean isEmpty()
           
static String peek()
           
static String pop()
           
static void push(Object value)
           
static void put(Class key, Object value)
           
static void put(Object key, Object value)
           
static void remove(Class key)
           
static void remove(Object key)
           
static StringBuilder render()
           
static void reset()
           
static void setState(DC.State state)
          Set the state for the current thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY

public static final String KEY
The key in which we publish our contents to in the Slf4j MDC.


PREFIX

public static final String PREFIX
String prefixed to MDC value when there is content to publish.

Since:
1.7

SEPARATOR

public static final String SEPARATOR
String used to separate the stack and context values when both are present.

Since:
1.7
Constructor Detail

DC

public DC()
Method Detail

getState

public static DC.State getState()
Get a copy of the state for the current thread.

Since:
1.7

setState

public static void setState(DC.State state)
Set the state for the current thread.

Since:
1.7

isEmpty

public static boolean isEmpty()
Since:
1.7

clear

public static void clear()
Since:
1.7

reset

public static void reset()
Since:
1.7

render

public static StringBuilder render()
Since:
1.7

put

public static void put(Object key,
                       Object value)

put

public static void put(Class key,
                       Object value)

get

public static String get(Object key)

get

public static String get(Class key)

remove

public static void remove(Object key)

remove

public static void remove(Class key)

push

public static void push(Object value)

pop

public static String pop()

peek

public static String peek()


Copyright © 2008-2011 Sonatype. All Rights Reserved.