|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.norther.tammi.core.base.Adaptee
org.norther.tammi.core.base.DefaultContainer
org.norther.tammi.spray.filter.AbstractContainerFilter
org.norther.tammi.spray.filter.DefaultContainerFilter
org.norther.tammi.spray.engine.DefaultContextToolFilter
public class DefaultContextToolFilter
A default implementation of ContextToolFilter. The filter places tools available for templates into the context. As session context tools are saved into the session, a new session will be created if one is not available.
Based on TurbinePullService in the Apache Jakarta Turbine
project.
| Nested Class Summary | |
|---|---|
static class |
DefaultContextToolFilter.InternalTemplateContext
An internal implementation of TemplateContext. |
| Field Summary |
|---|
| Fields inherited from class org.norther.tammi.core.base.Adaptee |
|---|
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS |
| Fields inherited from interface org.norther.tammi.core.base.MBeanDelegate |
|---|
ARRAY_TYPE, OBJECT_TYPE, PRIMITIVE_TYPE, STRING_TYPE |
| Constructor Summary | |
|---|---|
DefaultContextToolFilter()
Constructs a new filter. |
|
| Method Summary | |
|---|---|
void |
clearGlobalTools()
Clears all global context tools. |
void |
clearRequestTools()
Clears all request context tools. |
void |
clearSessionTools()
Clears all session context tools. |
void |
doFilter(ServletRequest request,
ServletResponse response,
FilterChain chain)
|
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 |
postmanaged()
This method is called when the implementing adaptee has been managed either during post-registration of the corresponding adapter MBean or just after it is explicitly added to the adapter MBean during run-time. |
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. |
void |
unmanaged()
This method is called when the implementing adaptee is unmanaged either during pre-deregistration of the corresponding adapter MBean or just before it is explicitly removed from the adapter MBean during run-time. |
| Methods inherited from class org.norther.tammi.spray.filter.DefaultContainerFilter |
|---|
getFilter |
| Methods inherited from class org.norther.tammi.spray.filter.AbstractContainerFilter |
|---|
destroy, getFilterConfig, getRequestMap, getSessionMap, init |
| Methods inherited from class org.norther.tammi.core.base.DefaultContainer |
|---|
clear, containsKey, get, getContainerKey, getContainerKey, getContainerKey, getMBean, getMBeanHandle, getMBeanHandles, getMBeanInterface, getMBeanInterface, getObjectName, getObjectNames, getQueryPattern, registryKeySet, registryKeySet, registryKeySet, registryKeySet, registryMap, registrySize, remove, setMBeanInterface, setQueryPattern, setQueryPattern |
| Methods inherited from class org.norther.tammi.core.base.Adaptee |
|---|
addAdaptee, addNotificationListener, getAttributeSupport, getBroker, getCanonicalName, getDomain, getFactory, getLoader, getLog, getLog, getMBean, getMBeanServer, getNotificationInfo, getObjectName, getRegistrationTime, getSequenceNumber, hasListeners, isRegistered, premanaged, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification, sendNotification, unregister |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 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, init |
| Constructor Detail |
|---|
public DefaultContextToolFilter()
| Method Detail |
|---|
public void postmanaged()
Manageable
postmanaged in interface Manageablepostmanaged in class Adaptee
public void unmanaged()
throws Exception
Manageable
unmanaged in interface Manageableunmanaged in class AdapteeException - if the adaptee refused to be unmanaged.public String getRequestTool(String key)
ContextToolFilter
getRequestTool in interface ContextToolFilterkey - the context key of the tool.
public void setRequestTool(String key,
String tool)
ContextToolFilter
setRequestTool in interface ContextToolFilterkey - the context key of the tool.tool - the class name of the tool.public void removeRequestTool(String key)
ContextToolFilter
removeRequestTool in interface ContextToolFilterkey - the context key of the tool.public void clearRequestTools()
ContextToolFilter
clearRequestTools in interface ContextToolFilterpublic Set requestKeySet()
ContextToolFilter
requestKeySet in interface ContextToolFilterpublic String getSessionTool(String key)
ContextToolFilter
getSessionTool in interface ContextToolFilterkey - the context key of the tool.
public void setSessionTool(String key,
String tool)
ContextToolFilter
setSessionTool in interface ContextToolFilterkey - the context key of the tool.tool - the class name of the tool.public void removeSessionTool(String key)
ContextToolFilter
removeSessionTool in interface ContextToolFilterkey - the context key of the tool.public void clearSessionTools()
ContextToolFilter
clearSessionTools in interface ContextToolFilterpublic Set sessionKeySet()
ContextToolFilter
sessionKeySet in interface ContextToolFilterpublic String getGlobalTool(String key)
ContextToolFilter
getGlobalTool in interface ContextToolFilterkey - the context key of the tool.
public void setGlobalTool(String key,
String tool)
ContextToolFilter
setGlobalTool in interface ContextToolFilterkey - the context key of the tool.tool - the class name of the tool.public void removeGlobalTool(String key)
ContextToolFilter
removeGlobalTool in interface ContextToolFilterkey - the context key of the tool.public void clearGlobalTools()
ContextToolFilter
clearGlobalTools in interface ContextToolFilterpublic Set globalKeySet()
ContextToolFilter
globalKeySet in interface ContextToolFilter
public TemplateContext getTemplateContext(ServletRequest request,
ServletResponse response,
FilterChain chain)
throws TemplateException
ContextToolFilter
getTemplateContext in interface ContextToolFilterrequest - the servlet request.response - the servlet response.chain - the filter chain.
TemplateException - on errors.
public void doFilter(ServletRequest request,
ServletResponse response,
FilterChain chain)
throws ServletException,
IOException
doFilter in interface FilterdoFilter in class AbstractContainerFilterServletException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||