|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.magnolia.cms.filters.SafeDestroyMgnlFilterWrapper
public class SafeDestroyMgnlFilterWrapper
Wrapper for a MgnlFilter that using a read/write lock ensures that the destroy method waits for requests to complete before destroying the target filter. All use of the wrapper must be done while holding the read lock. The exception to this is the destroy method that MUST NOT be called while holding the read lock, doing so would result in dead lock.
Nested Class Summary | |
---|---|
static class |
SafeDestroyMgnlFilterWrapper.Switcher
Construct for keeping a reference to a SafeDestroyMgnlFilterWrapper and change it with the guarantee that
the returned previous reference will not get more read locks. |
Constructor Summary | |
---|---|
SafeDestroyMgnlFilterWrapper(MgnlFilter target)
|
Method Summary | |
---|---|
void |
acquireReadLock()
|
void |
destroy()
Destroys the target filter after waiting for all requests to complete. |
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain)
Read lock must be held when invoking this method. |
String |
getName()
Read lock must be held when invoking this method. |
MgnlFilter |
getTargetFilter()
|
void |
init(javax.servlet.FilterConfig filterConfig)
|
boolean |
matches(javax.servlet.http.HttpServletRequest request)
Read lock must be held when invoking this method. |
void |
releaseReadLock()
|
void |
setName(String name)
Read lock must be held when invoking this method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SafeDestroyMgnlFilterWrapper(MgnlFilter target)
Method Detail |
---|
public void acquireReadLock()
public void releaseReadLock()
public void init(javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException
init
in interface javax.servlet.Filter
javax.servlet.ServletException
public String getName()
getName
in interface MgnlFilter
public void setName(String name)
setName
in interface MgnlFilter
public boolean matches(javax.servlet.http.HttpServletRequest request)
matches
in interface MgnlFilter
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException
doFilter
in interface javax.servlet.Filter
IOException
javax.servlet.ServletException
public void destroy()
destroy
in interface javax.servlet.Filter
public MgnlFilter getTargetFilter()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |