|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ContextToolFilter
ContextToolFilter loads tools available for templates into the context. The
tools are used from templates with implementation specific references. E.g.
Velocity templates refer to context tools with $key, where
key is the registration key of the tool. Tools may have an associated MBean
registered to the context filter with their context key.
Tools implementing the ContextBindingListener interface will be notified when bound to the context or unbound from it.
Global tools are visible to all templates for all requests. The same instance of a global tool is shared by all clients and the tool must be threadsafe.
Session tools are instantiated once for each user session, and are stored into the session. Each session contains its own instance of a session tool, but as the same session can be used by several requests, the tool should be threadsafe.
Request tools are instantiated once for each request. Each request will get its own instance of a request tool and the tool needs not to be threadsafe.
Based on PullService in the Apache Jakarta Turbine
project.
| Method Summary | |
|---|---|
void |
clearGlobalTools()
Clears all global context tools. |
void |
clearRequestTools()
Clears all request context tools. |
void |
clearSessionTools()
Clears all session context tools. |
String |
getGlobalTool(String key)
Gets a global context tool. |
String |
getRequestTool(String key)
Gets a request context tool. |
String |
getSessionTool(String key)
Gets a session context tool. |
TemplateContext |
getTemplateContext(ServletRequest request,
ServletResponse response,
FilterChain chain)
Gets a template context loaded with context tools for the specified request. |
Set |
globalKeySet()
Returns a read-only set of global keys. |
void |
removeGlobalTool(String key)
Removes a global context tool. |
void |
removeRequestTool(String key)
Removes a request context tool. |
void |
removeSessionTool(String key)
Removes a session context tool. |
Set |
requestKeySet()
Returns a read-only set of request keys. |
Set |
sessionKeySet()
Returns a read-only set of session keys. |
void |
setGlobalTool(String key,
String tool)
Sets a global context tool. |
void |
setRequestTool(String key,
String tool)
Sets a request context tool. |
void |
setSessionTool(String key,
String tool)
Sets a session context tool. |
| Methods inherited from interface org.norther.tammi.core.base.Container |
|---|
clear, containsKey, get, getContainerKey, getContainerKey, getContainerKey, getMBean, getMBeanInterface, getMBeanInterface, getObjectName, getObjectNames, getQueryPattern, registryKeySet, registryKeySet, registryKeySet, registryKeySet, registryMap, registrySize, remove, setMBeanInterface, setQueryPattern, setQueryPattern |
| Methods inherited from interface javax.servlet.Filter |
|---|
destroy, doFilter, init |
| Method Detail |
|---|
String getRequestTool(String key)
key - the context key of the tool.
void setRequestTool(String key,
String tool)
key - the context key of the tool.tool - the class name of the tool.void removeRequestTool(String key)
key - the context key of the tool.void clearRequestTools()
Set requestKeySet()
String getSessionTool(String key)
key - the context key of the tool.
void setSessionTool(String key,
String tool)
key - the context key of the tool.tool - the class name of the tool.void removeSessionTool(String key)
key - the context key of the tool.void clearSessionTools()
Set sessionKeySet()
String getGlobalTool(String key)
key - the context key of the tool.
void setGlobalTool(String key,
String tool)
key - the context key of the tool.tool - the class name of the tool.void removeGlobalTool(String key)
key - the context key of the tool.void clearGlobalTools()
Set globalKeySet()
TemplateContext getTemplateContext(ServletRequest request,
ServletResponse response,
FilterChain chain)
throws TemplateException
request - the servlet request.response - the servlet response.chain - the filter chain.
TemplateException - on errors.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||