@SuppressWarnings("unchecked") public Map<String, Object> getMdcMap() { return MDC.getContext(); }
@SuppressWarnings({ "rawtypes", "unchecked" }) public Map getCopyOfContextMap() { Map old = org.apache.log4j.MDC.getContext(); if (old != null) { return new HashMap(old); } else { return null; } }
public void clear() { @SuppressWarnings("rawtypes") Map map = org.apache.log4j.MDC.getContext(); if (map != null) { map.clear(); } }
/** Obtain a copy of this thread's MDC prior to serialization or asynchronous logging. */ public void getMDCCopy() { if(mdcCopyLookupRequired) { mdcCopyLookupRequired = false; // the clone call is required for asynchronous logging. // See also bug #5932. Hashtable t = (Hashtable) MDC.getContext(); if(t != null) { mdcCopy = (Hashtable) t.clone(); } } }
/** Obtain a copy of this thread's MDC prior to serialization or asynchronous logging. */ public void getMDCCopy() { if(mdcCopyLookupRequired) { mdcCopyLookupRequired = false; // the clone call is required for asynchronous logging. // See also bug #5932. Hashtable t = (Hashtable) MDC.getContext(); if(t != null) { mdcCopy = (Hashtable) t.clone(); } } }
public Map<String, Object> getMdcMap() { @SuppressWarnings("unchecked") final Map<String, Object> map = MDC.getContext(); return map == null ? Collections.<String, Object>emptyMap() : map; }
@SuppressWarnings({ "rawtypes", "unchecked" }) public void setContextMap(Map contextMap) { Map old = org.apache.log4j.MDC.getContext(); if (old == null) { Iterator entrySetIterator = contextMap.entrySet().iterator(); while (entrySetIterator.hasNext()) { Map.Entry mapEntry = (Map.Entry) entrySetIterator.next(); org.apache.log4j.MDC.put((String) mapEntry.getKey(), mapEntry.getValue()); } } else { old.clear(); old.putAll(contextMap); } } }
public LoadBatchCommand( Locus locus, SegmentCacheManager cacheMgr, Dialect dialect, RolapCube cube, List<CellRequest> cellRequests) { this.locus = locus; this.cacheMgr = cacheMgr; this.dialect = dialect; this.cube = cube; this.cellRequests = cellRequests; if (MDC.getContext() != null) { this.mdc.putAll(MDC.getContext()); } }
/** * Copy the current MDC so it can be used later */ public void copyMDC() { this.mdc.clear(); final Map<String, Object> currentMdc = MDC.getContext(); if (currentMdc != null) { this.mdc.putAll(currentMdc); } }
/** * Set the copied mdc into the current MDC. This should be called * any time there will be logging in a thread handled by the * RolapResultShepherd where original MDC needs to be retrieved */ public void setContextMap() { final Map<String, Object> old = MDC.getContext(); if (old != null) { old.clear(); old.putAll(mdc); } }
/** Obtain a copy of this thread's MDC prior to serialization or asynchronous logging. */ public void getMDCCopy() { if(mdcCopyLookupRequired) { mdcCopyLookupRequired = false; // the clone call is required for asynchronous logging. // See also bug #5932. Hashtable t = (Hashtable) MDC.getContext(); if(t != null) { mdcCopy = (Hashtable) t.clone(); } } }
/** Obtain a copy of this thread's MDC prior to serialization or asynchronous logging. */ public void getMDCCopy() { if(mdcCopyLookupRequired) { mdcCopyLookupRequired = false; // the clone call is required for asynchronous logging. // See also bug #5932. Hashtable t = MDC.getContext(); if(t != null) { mdcCopy = (Hashtable) t.clone(); } } }
/** Obtain a copy of this thread's MDC prior to serialization or asynchronous logging. */ public void getMDCCopy() { if(mdcCopyLookupRequired) { mdcCopyLookupRequired = false; // the clone call is required for asynchronous logging. // See also bug #5932. Hashtable t = MDC.getContext(); if(t != null) { mdcCopy = (Hashtable) t.clone(); } } }
public LoadBatchResponse call() { if (MDC.getContext() != null) { final Map<String, Object> old = MDC.getContext(); old.clear(); old.putAll(mdc); } return new BatchLoader(locus, cacheMgr, dialect, cube) .load(cellRequests); }
@SuppressWarnings("unchecked") public Map<String, Object> getMap() { return MDC.getContext(); }
public Map<String, Object> getMdcMap() { @SuppressWarnings("unchecked") final Map<String, Object> map = MDC.getContext(); return map == null ? Collections.<String, Object>emptyMap() : map; }
public Map<String, Object> getMdcMap() { @SuppressWarnings("unchecked") final Map<String, Object> map = MDC.getContext(); return map == null ? Collections.<String, Object>emptyMap() : map; }
public void clear() { @SuppressWarnings("rawtypes") Map map = org.apache.log4j.MDC.getContext(); if (map != null) { map.clear(); } }
public void clear() { Map map = org.apache.log4j.MDC.getContext(); if (map != null) { map.clear(); } }
private void clearDelegateContext() { m_service.getConfigLock().readLock().unlock(); if( MDC.getContext() != null ) { MDC.getContext().clear(); } }