-
-
Save seyedsahil/ca59b567fd71fad6d2aab445f289e3f6 to your computer and use it in GitHub Desktop.
Creating a ThreadLocal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public final class SessionContextHolder { | |
private static final SessionContextHolder sessionContextHolder; | |
static { sessionContextHolder = new SessionContextHolder(); } | |
public static SessionContextHolder getInstance() { return sessionContextHolder; } | |
private final ThreadLocal<Session> sessionContext; | |
private SessionContextHolder() { | |
super(); | |
sessionContext = new ThreadLocal<>(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment