public final class BigFatLock extends OncePerRequestFilter
The lock can be acquired using runWithLock(java.lang.Runnable). This class can also be used as a servlet filter.
Trace-level logging for displaying lock acquire and release events is included.
ALREADY_FILTERED_SUFFIXlogger| Constructor and Description |
|---|
BigFatLock() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doFilterInternal(HttpServletRequest request,
HttpServletResponse response,
FilterChain filterChain) |
static boolean |
isLockHeld()
Verify that the current thread is holding the big fat lock.
|
static <V> V |
runWithLock(Callable<V> action)
Invoke the given action after acquiring the big fat lock.
|
static void |
runWithLock(Runnable action)
Invoke the given action after acquiring the big fat lock.
|
String |
toString() |
doFilter, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterAsyncDispatch, shouldNotFilterErrorDispatchaddRequiredProperty, afterPropertiesSet, destroy, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContextprotected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException
doFilterInternal in class OncePerRequestFilterServletExceptionIOExceptionpublic static void runWithLock(Runnable action)
action - action to perform while lockedpublic static <V> V runWithLock(Callable<V> action) throws Exception
V - action return typeaction - action to perform while lockedactionException - if action throws an exceptionpublic static boolean isLockHeld()
Copyright © 2016. All rights reserved.