|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.shiro.web.servlet.ServletContextSupport
org.apache.shiro.web.servlet.AbstractFilter
public abstract class AbstractFilter
Base abstract Filter simplifying Filter initialization and access to init parameters.
Subclass initialization logic should be performed by overriding the onFilterConfigSet() template method.
FilterChain execution logic (the
Filter.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain) method
is left to subclasses.
| Field Summary | |
|---|---|
protected javax.servlet.FilterConfig |
filterConfig
FilterConfig provided by the Servlet container at start-up. |
| Constructor Summary | |
|---|---|
AbstractFilter()
|
|
| Method Summary | |
|---|---|
void |
destroy()
Default no-op implementation that can be overridden by subclasses for custom cleanup behavior. |
javax.servlet.FilterConfig |
getFilterConfig()
Returns the servlet container specified FilterConfig instance provided at
startup. |
protected String |
getInitParam(String paramName)
Returns the value for the named init-param, or null if there was no init-param
specified by that name. |
void |
init(javax.servlet.FilterConfig filterConfig)
Sets the filter's filterConfig and then immediately calls
onFilterConfigSet() to trigger any processing a subclass might wish to perform. |
protected void |
onFilterConfigSet()
Template method to be overridden by subclasses to perform initialization logic at start-up. |
void |
setFilterConfig(javax.servlet.FilterConfig filterConfig)
Sets the FilterConfig and the ServletContext as attributes of this class for use by
subclasses. |
| Methods inherited from class org.apache.shiro.web.servlet.ServletContextSupport |
|---|
getContextAttribute, getContextInitParam, getServletContext, removeContextAttribute, setContextAttribute, setServletContext, toString, toStringBuilder |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface javax.servlet.Filter |
|---|
doFilter |
| Field Detail |
|---|
protected javax.servlet.FilterConfig filterConfig
| Constructor Detail |
|---|
public AbstractFilter()
| Method Detail |
|---|
public javax.servlet.FilterConfig getFilterConfig()
FilterConfig instance provided at
startup.
FilterConfig instance provided at start-up.public void setFilterConfig(javax.servlet.FilterConfig filterConfig)
ServletContext as attributes of this class for use by
subclasses. That is:
this.filterConfig = filterConfig; setServletContext(filterConfig.getServletContext());
filterConfig - the FilterConfig instance provided by the Servlet container at start-up.protected String getInitParam(String paramName)
init-param, or null if there was no init-param
specified by that name.
paramName - the name of the init-param
init-param, or null if there was no init-param
specified by that name.
public final void init(javax.servlet.FilterConfig filterConfig)
throws javax.servlet.ServletException
filterConfig and then immediately calls
onFilterConfigSet() to trigger any processing a subclass might wish to perform.
init in interface javax.servlet.FilterfilterConfig - the servlet container supplied FilterConfig instance.
javax.servlet.ServletException - if onFilterConfigSet() throws an Exception.
protected void onFilterConfigSet()
throws Exception
ServletContext and FilterConfig will be accessible
(and non-null) at the time this method is invoked via the
getServletContext() and getFilterConfig()
methods respectively.
init-param values may be conveniently obtained via the getInitParam(String) method.
Exception - if the subclass has an error upon initialization.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 | |||||||||