Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
SLF4J API Source Code
SLF4J API is a simple API that allows to plug in any desired logging library at deployment time.
Here is the source code for SLF4J API 2.0.4. You can download its pre-compiled version slf4j-api-2.0.4.jar at SLF4J Download Website.
✍: FYIcenter.com
⏎ org/slf4j/helpers/ThreadLocalMapOfStacks.java
package org.slf4j.helpers; import java.util.ArrayDeque; import java.util.Deque; import java.util.HashMap; import java.util.Map; /** * A simple implementation of ThreadLocal backed Map containing values of type * Deque<String>. * * @author Ceki Guuml;cü * @since 2.0.0 */ public class ThreadLocalMapOfStacks { // BEWARE: Keys or values placed in a ThreadLocal should not be of a type/class // not included in the JDK. See also https://jira.qos.ch/browse/LOGBACK-450 final ThreadLocal<Map<String, Deque<String>>> tlMapOfStacks = new ThreadLocal<>(); public void pushByKey(String key, String value) { if (key == null) return; Map<String, Deque<String>> map = tlMapOfStacks.get(); if (map == null) { map = new HashMap<>(); tlMapOfStacks.set(map); } Deque<String> deque = map.get(key); if (deque == null) { deque = new ArrayDeque<>(); } deque.push(value); map.put(key, deque); } public String popByKey(String key) { if (key == null) return null; Map<String, Deque<String>> map = tlMapOfStacks.get(); if (map == null) return null; Deque<String> deque = map.get(key); if (deque == null) return null; return deque.pop(); } public Deque<String> getCopyOfDequeByKey(String key) { if (key == null) return null; Map<String, Deque<String>> map = tlMapOfStacks.get(); if (map == null) return null; Deque<String> deque = map.get(key); if (deque == null) return null; return new ArrayDeque<String>(deque); } /** * Clear the deque(stack) referenced by 'key'. * * @param key identifies the stack * * @since 2.0.0 */ public void clearDequeByKey(String key) { if (key == null) return; Map<String, Deque<String>> map = tlMapOfStacks.get(); if (map == null) return; Deque<String> deque = map.get(key); if (deque == null) return; deque.clear(); } }
⏎ org/slf4j/helpers/ThreadLocalMapOfStacks.java
Or download all of them as a single archive file:
File name: slf4j-api-2.0.4-sources.jar File size: 70304 bytes Release date: 2022-11-17 Download
⇒ Source Code for SLF4J Simple Logging
⇐ Downloading SLF4J Components
2020-02-13, 26777👍, 2💬
Popular Posts:
What Is HttpComponents httpclient-4.2.2.jar? HttpComponents httpclient-4.2.2.jar is the JAR file for...
What is the sax\Counter.java provided in the Apache Xerces package? I have Apache Xerces 2.11.0 inst...
Provides a simple high-level Http server API, which can be used to build embedded HTTP servers. Both...
JDK 17 jdk.compiler.jmod is the JMOD file for JDK 17 Compiler tool, which can be invoked by the "jav...
JLayer is a library that decodes/plays/converts MPEG 1/2/2.5 Layer 1/2/3 (i.e. MP3) in real time for...