|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.norther.tammi.core.pool.RecyclableSupport
org.norther.tammi.core.pool.PoolableSupport
org.norther.tammi.spray.engine.tool.GlobalTool
org.norther.tammi.spray.engine.tool.ContextTool
org.norther.tammi.spray.engine.tool.ChainTool
public class ChainTool
A request context tool for filter chaining.
| Constructor Summary | |
|---|---|
ChainTool()
Constructs a new chain. |
|
| Method Summary | |
|---|---|
void |
bindToRequest(ObjectName name)
Binds an MBean to the current request. |
void |
bindToSession(ObjectName name)
Binds an MBean to the current session. |
void |
clearErrors()
Clears throwables from the error stack of this chain. |
void |
closeResponse()
Closes the current response after committing. |
boolean |
containsErrors()
Checks whether this chain contains errors. |
void |
doFilter(ServletRequest request,
ServletResponse response)
Passes the request and response to the next filter. |
void |
doFilter(ServletRequest request,
ServletResponse response,
Filter filter)
Invokes the specified filter. |
void |
doFilter(ServletRequest request,
ServletResponse response,
FilterMBeanReference[] filters)
Invokes the first filter in a list of filter handles and continues with the rest as long as the preceding filter passes the request forward. |
ConnectorExtension |
getConnector()
Gets the connector extension. |
Filter |
getCurrentFilter()
Gets the current filter of this chain. |
Pipe |
getCurrentPipe()
Gets the current pipe of this chain. |
Throwable |
getError()
Gets the last throwable from the error stack of this chain. |
List |
getErrors()
Gets a list of all throwables in the error stack of this chain. |
Locale |
getLocale()
Gets the current locale. |
MBeanServer |
getMBeanServer()
Gets the current MBean server if available. |
Filter |
getNearestFilter(Class clazz)
Gets the nearest registered filter of the specified class from the filter stack of this chain. |
Filter |
getNextFilter(Class clazz)
Gets the next registered filter of the specified class in the current pipe to be activated after the current one. |
String |
getParameter(String name)
Gets the named request parameter. |
String |
getParameter(String name,
String def)
Gets a named request parameter with a default value. |
Map |
getParameterMap()
Gets the request parameter map. |
String[] |
getParameters(String name)
Gets the named request parameters. |
Filter |
getPreviousFilter(Class clazz)
Gets the previous registered filter of the specified class activated before the current one from the filter stack of this chain. |
List |
getPreviousFilters()
Gets a list of all filters activated before the current one from the filter stack of this chain. |
ProtocolExtension |
getProtocol()
Gets the protocol extension. |
ServletRequest |
getRequest()
Gets the current request if available. |
ServletResponse |
getResponse()
Gets the current response if available. |
HttpSession |
getSession()
Gets or creates the current session. |
TerminalExtension |
getTerminal()
Gets the terminal extension. |
boolean |
isInvalidatedSession()
Checks whether the the active session is invalidated. |
Throwable |
popError()
Pops a throwable from the error stack. |
void |
pushError(Throwable error)
Pushes a throwable to the error stack without throwing one. |
void |
releaseFromRequest(ObjectName name)
Releases an MBean from the current request without unregistering. |
void |
releaseFromSession(ObjectName name)
Releases an MBean from the current session without unregistering. |
void |
setInvalidatedSession(boolean flag)
Sets whether the the active session is invalidated. |
void |
terminate()
Terminates the filter chain. |
| Methods inherited from class org.norther.tammi.spray.engine.tool.ContextTool |
|---|
dispose, getFilter, getFilterChain, getFilterKey, getPrincipal, isFilterChanged |
| Methods inherited from class org.norther.tammi.spray.engine.tool.GlobalTool |
|---|
clone, getContext, getContextToolFilter, getName, isBound, nop, toString, valueBound, valueUnbound |
| Methods inherited from class org.norther.tammi.core.pool.PoolableSupport |
|---|
disposed, recycled |
| Methods inherited from class org.norther.tammi.core.pool.RecyclableSupport |
|---|
isDisposed, recycle |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.norther.tammi.core.pool.Recyclable |
|---|
isDisposed, recycle |
| Constructor Detail |
|---|
public ChainTool()
| Method Detail |
|---|
public ServletRequest getRequest()
ContextTool
getRequest in interface HttpFilterChaingetRequest in class ContextToolpublic ServletResponse getResponse()
ContextTool
getResponse in interface HttpFilterChaingetResponse in class ContextToolpublic boolean isInvalidatedSession()
HttpFilterChain
isInvalidatedSession in interface HttpFilterChainpublic void setInvalidatedSession(boolean flag)
HttpFilterChain
setInvalidatedSession in interface HttpFilterChainflag - true if invalidated, false otherwise.public Pipe getCurrentPipe()
HttpFilterChain
getCurrentPipe in interface HttpFilterChainpublic Filter getCurrentFilter()
HttpFilterChain
getCurrentFilter in interface HttpFilterChainpublic Filter getNearestFilter(Class clazz)
HttpFilterChain
getNearestFilter in interface HttpFilterChainclazz - the class or interface of the filter or null for any.
public Filter getPreviousFilter(Class clazz)
HttpFilterChain
getPreviousFilter in interface HttpFilterChainclazz - the class or interface of the filter or null for any.
public List getPreviousFilters()
HttpFilterChain
getPreviousFilters in interface HttpFilterChainpublic Filter getNextFilter(Class clazz)
HttpFilterChain
getNextFilter in interface HttpFilterChainclazz - the class or interface of the filter or null for any.
public MBeanServer getMBeanServer()
GlobalTool
getMBeanServer in interface HttpFilterChaingetMBeanServer in class GlobalToolpublic Throwable getError()
HttpFilterChain
getError in interface HttpFilterChainpublic List getErrors()
HttpFilterChain
getErrors in interface HttpFilterChainpublic void pushError(Throwable error)
HttpFilterChain
pushError in interface HttpFilterChainerror - the reason throwable.public Throwable popError()
HttpFilterChain
popError in interface HttpFilterChainpublic boolean containsErrors()
HttpFilterChain
containsErrors in interface HttpFilterChainpublic void clearErrors()
HttpFilterChain
clearErrors in interface HttpFilterChain
public void doFilter(ServletRequest request,
ServletResponse response)
throws ServletException,
IOException
HttpFilterChain
doFilter in interface FilterChaindoFilter in interface HttpFilterChainrequest - the request to pass along in the chain.response - the response to pass along in the chain.
ServletException - for servlet errors.
IOException - for general errors.
public void doFilter(ServletRequest request,
ServletResponse response,
Filter filter)
throws ServletException,
IOException
HttpFilterChain
doFilter in interface HttpFilterChainrequest - the request to pass along in the chain.response - the response to pass along in the chain.filter - the filter to invoke.
ServletException - for servlet errors.
IOException - for general errors.
public void doFilter(ServletRequest request,
ServletResponse response,
FilterMBeanReference[] filters)
throws ServletException,
IOException
HttpFilterChain
doFilter in interface HttpFilterChainrequest - the request to pass along in the chain.response - the response to pass along in the chain.filters - an array of filter references.
ServletException - for servlet errors.
IOException - for general errors.public void terminate()
HttpFilterChain
terminate in interface HttpFilterChainpublic String getParameter(String name)
name - the name of the parameter.
public String getParameter(String name,
String def)
name - the name of the parameter.def - the default value.
public String[] getParameters(String name)
name - the name of the parameter.
public Map getParameterMap()
public HttpSession getSession()
public Locale getLocale()
public ConnectorExtension getConnector()
public ProtocolExtension getProtocol()
public TerminalExtension getTerminal()
public void closeResponse()
public void bindToSession(ObjectName name)
name - the object name of the bound MBean.public void releaseFromSession(ObjectName name)
name - the object name of the bound MBean.public void bindToRequest(ObjectName name)
name - the object name of the bound MBean.public void releaseFromRequest(ObjectName name)
name - the object name of the bound MBean.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||