Class RequestLifeCycleFilter
- java.lang.Object
-
- de.businesscode.bcdui.web.filters.RequestLifeCycleFilter
-
- All Implemented Interfaces:
javax.servlet.Filter
public class RequestLifeCycleFilter extends java.lang.Object implements javax.servlet.Filter
This class is a very first entry point of any requests. Responsibilities: - tags the MDC for the logger in order to trace events in debug mode
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
LOGGER_NAME
static java.lang.String
MDC_KEY_BCD_PAGEHASH
static java.lang.String
MDC_KEY_BCD_REQUESTHASH
static java.lang.String
MDC_KEY_IS_CLIENT_LOG
static java.lang.String
MDC_KEY_SESSION_ID
static java.lang.String
SESSION_KEY_BCD_SESSIONCREATED
-
Constructor Summary
Constructors Constructor Description RequestLifeCycleFilter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
void
doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)
static org.apache.logging.log4j.Logger
getLogger()
void
init(javax.servlet.FilterConfig filterConfig)
static boolean
isThreadBoundToHttpRequest()
-
-
-
Field Detail
-
SESSION_KEY_BCD_SESSIONCREATED
public static final java.lang.String SESSION_KEY_BCD_SESSIONCREATED
- See Also:
- Constant Field Values
-
MDC_KEY_BCD_REQUESTHASH
public static final java.lang.String MDC_KEY_BCD_REQUESTHASH
- See Also:
- Constant Field Values
-
MDC_KEY_BCD_PAGEHASH
public static final java.lang.String MDC_KEY_BCD_PAGEHASH
- See Also:
- Constant Field Values
-
MDC_KEY_IS_CLIENT_LOG
public static final java.lang.String MDC_KEY_IS_CLIENT_LOG
- See Also:
- Constant Field Values
-
MDC_KEY_SESSION_ID
public static final java.lang.String MDC_KEY_SESSION_ID
- See Also:
- Constant Field Values
-
LOGGER_NAME
public static final java.lang.String LOGGER_NAME
-
-
Method Detail
-
isThreadBoundToHttpRequest
public static boolean isThreadBoundToHttpRequest()
- Returns:
- TRUE if the current thread is bound to a HTTP request managed by a
RequestLifeCycleFilter
-
getLogger
public static org.apache.logging.log4j.Logger getLogger()
- Returns:
- RequestLifeCycleLogger which allows to track any logstreams realted to the logical request.
-
destroy
public void destroy()
- Specified by:
destroy
in interfacejavax.servlet.Filter
-
doFilter
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws java.io.IOException, javax.servlet.ServletException
- Specified by:
doFilter
in interfacejavax.servlet.Filter
- Throws:
java.io.IOException
javax.servlet.ServletException
-
init
public void init(javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException
- Specified by:
init
in interfacejavax.servlet.Filter
- Throws:
javax.servlet.ServletException
-
-