|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.lib.servlet.MDCFilter
@InterfaceAudience.Private public class MDCFilter
Filter that sets request contextual information for the slf4j MDC.
It sets the following values:HostnameFilter
is present and configured
before this filterHttpServletRequest.getUserPrincipal().getName()
Constructor Summary | |
---|---|
MDCFilter()
|
Method Summary | |
---|---|
void |
destroy()
Destroys the filter. |
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain)
Sets the slf4j MDC and delegates the request to the chain. |
void |
init(javax.servlet.FilterConfig config)
Initializes the filter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MDCFilter()
Method Detail |
---|
public void init(javax.servlet.FilterConfig config) throws javax.servlet.ServletException
init
in interface javax.servlet.Filter
config
- filter configuration.
javax.servlet.ServletException
- thrown if the filter could not be initialized.public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException
MDC
and delegates the request to the chain.
doFilter
in interface javax.servlet.Filter
request
- servlet request.response
- servlet response.chain
- filter chain.
IOException
- thrown if an IO error occurrs.
javax.servlet.ServletException
- thrown if a servet error occurrs.public void destroy()
destroy
in interface javax.servlet.Filter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |