Esempio n. 1
0
 /** Execute the given runnable within the context of this CDC. */
 public void execute(Runnable r) {
   String session = MDC.get(MDC_SESSION);
   String cell = MDC.get(MDC_CELL);
   String domain = MDC.get(MDC_DOMAIN);
   NDC ndc = NDC.cloneNdc();
   try {
     apply();
     r.run();
   } finally {
     setMdc(MDC_DOMAIN, domain);
     setMdc(MDC_CELL, cell);
     setMdc(MDC_SESSION, session);
     NDC.set(ndc);
   }
 }
Esempio n. 2
0
 /**
  * Restore the cells diagnostic context to the calling thread. The old diagnostic context is
  * captured and returned.
  */
 public CDC restore() {
   CDC cdc = new CDC();
   apply();
   return cdc;
 }
Esempio n. 3
0
 @Override
 public void close() {
   apply();
 }