|
||||||||||
| 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.core.security.DefaultSecureContainer
org.norther.tammi.spray.filter.AbstractSecureContainerFilter
org.norther.tammi.spray.filter.AbstractSecureContainerKeyFilter
org.norther.tammi.spray.filter.DefaultSecureContainerKeyFilter
org.norther.tammi.spray.template.DefaultPageFilter
public class DefaultPageFilter
A default implementation of PageFilter.
Based on TurbineTemplateService in the Apache Jakarta Turbine
project.
| Field Summary | |
|---|---|
static String |
TEMPLATE_KEY
The default key for the template. |
| Fields inherited from class org.norther.tammi.core.base.Adaptee |
|---|
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS |
| Fields inherited from interface org.norther.tammi.spray.template.PageFilter |
|---|
ANY_EXTENSION |
| Fields inherited from interface org.norther.tammi.spray.engine.TemplateExecutor |
|---|
PROPERTY_ENCODING, PROPERTY_EXTENSION |
| Fields inherited from interface org.norther.tammi.core.base.MBeanDelegate |
|---|
ARRAY_TYPE, OBJECT_TYPE, PRIMITIVE_TYPE, STRING_TYPE |
| Constructor Summary | |
|---|---|
DefaultPageFilter()
Constructs a new filter. |
|
DefaultPageFilter(String key)
Constructs a new filter with a key. |
|
| Method Summary | |
|---|---|
boolean |
checkPermission(String template,
int mask,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Checks whether or not the specified request has a permission to access the masked actions of the specified template. |
boolean |
checkPermission(String template,
String actions,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Checks whether or not the specified request has a permission to access the named actions of the specified template. |
void |
clearCached()
Clears all cached entries without notifying. |
void |
doFilter(ServletRequest request,
ServletResponse response,
FilterChain chain)
Activates template evaluation. |
CharSequence |
evaluate(CharSequence raw,
String template,
boolean local,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Evaluates the named run-time content. |
CharSequence |
evaluate(CharSequence raw,
String template,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Evaluates the named run-time content. |
CharSequence |
evaluate(String template,
boolean local,
boolean localized,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Evaluates an optionally local template by resolving its optionally localized name and template engine specific extension based on terminal properties of the request. |
CharSequence |
evaluate(String template,
boolean local,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Evaluates an optionally local template by resolving its name and template engine specific extension based on terminal properties of the request. |
CharSequence |
evaluate(String template,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Evaluates the named template. |
CharSequence |
evaluate(String template,
String encoding,
boolean local,
boolean localized,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Evaluates an optionally local template with the specified encoding by resolving its optionally localized name and template engine specific extension based on terminal properties of the request. |
CharSequence |
evaluate(String template,
String encoding,
boolean local,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Evaluates an optionally local template with the specified encoding by resolving its name and template engine specific extension based on terminal properties of the request. |
CharSequence |
evaluate(String template,
String encoding,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Evaluates the named template with the specified encoding. |
void |
execute(CharSequence raw,
String template,
boolean local,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Executes the named run-time content. |
void |
execute(CharSequence raw,
String template,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Executes the named run-time content. |
void |
execute(String template,
boolean local,
boolean localized,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Executes an optionally local template by resolving its optionally localized name and template engine specific extension based on terminal properties of the request. |
void |
execute(String template,
boolean local,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Executes an optionally local template by resolving its name and template engine specific extension based on terminal properties of the request. |
void |
execute(String template,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Executes the named template. |
void |
execute(String template,
String encoding,
boolean local,
boolean localized,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Executes an optionally local template with the specified encoding by resolving its optionally localized name and template engine specific extension based on terminal properties of the request. |
void |
execute(String template,
String encoding,
boolean local,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Executes an optionally local template with the specified encoding by resolving its name and template engine specific extension based on terminal properties of the request. |
void |
execute(String template,
String encoding,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Executes the named template with the specified encoding. |
void |
expireCached(long timestamp)
Expires all cached entries notifying them about expiration. |
void |
expireFraction(long timestamp,
float fraction)
Expires the specified fraction of cached entries notifying them about expiration. |
ConcurrentMap |
getCache(boolean create)
Gets and optionally creates the cache. |
String |
getDefaultBuilder()
Gets the default template builder. |
String |
getErrorTemplate()
Gets the error template. |
String |
getPageEncoding(ServletRequest request,
ServletResponse response)
Gets the current page encoding of the specified request. |
String |
getPageTemplate()
Gets the default page template. |
String |
getPageTemplate(ServletRequest request,
ServletResponse response,
FilterChain chain)
Gets the current page template of the specified request. |
long |
getRefreshed()
Gets the last refresh timestamp. |
ObjectName |
getTaskLoaderName()
Gets the the task loader of this filter. |
TemplateEngine |
getTemplateEngine(String template)
Gets the referent of the template engine MBean to be applied to the specified template. |
boolean |
isCachingDisabled()
Checks whether the caching is disabled. |
boolean |
isLocalContext()
Gets local context flag. |
boolean |
isLocalizedTemplates()
Gets the localized templates flag. |
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 |
refresh()
Refreshes the MBean. |
void |
removeCache()
Removes the cache. |
CharSequence |
resolve(String template,
boolean local,
boolean localized,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Resolves the named and optionally localized template content. |
protected CharSequence |
resolve(StringBuilder buffer,
String encoding,
boolean local,
boolean localized,
boolean directly,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Resolves the template content either by evaluation or execution. |
CharSequence |
resolve(String template,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Resolves the named template content. |
CharSequence |
resolve(String template,
String encoding,
boolean local,
boolean localized,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Resolves the named and optionally localized template content with the specified encoding. |
CharSequence |
resolve(String template,
String encoding,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Resolves the named template content with the specified encoding. |
String |
resolveTemplatePath(String template,
boolean localized,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Resolves an optionally localized template path for the specified request and response. |
String |
resolveTemplatePath(String template,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Resolves a template path for the specified request and response. |
void |
setCachingDisabled(boolean flag)
Sets the caching disabled flag. |
void |
setDefaultBuilder(String name)
Sets the default template builder. |
void |
setErrorTemplate(String template)
Sets the error template. |
void |
setLocalContext(boolean flag)
Sets the local context flag. |
void |
setLocalizedTemplates(boolean flag)
Sets the localized templates flag. |
void |
setPageTemplate(String template)
Sets the default page template. |
void |
setPageTemplate(String template,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Sets the current page template of the specified request. |
void |
setPageTemplate(String template,
String encoding,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Sets the current page template of the specified request with encoding. |
void |
setTaskLoaderName(ObjectName loader)
Sets the task loader of this filter. |
boolean |
templateExists(String template,
boolean localized,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Checks whether the optionally localized template exists. |
boolean |
templateExists(String template,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Checks whether the template exists. |
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.DefaultSecureContainerKeyFilter |
|---|
getFilter |
| Methods inherited from class org.norther.tammi.spray.filter.AbstractSecureContainerKeyFilter |
|---|
getKey, getKeyValue, getKeyValues, isLinkedKey, setKey, setLinkedKey |
| Methods inherited from class org.norther.tammi.spray.filter.AbstractSecureContainerFilter |
|---|
checkPermission, destroy, getFilterConfig, getRequestMap, getSessionMap, init |
| Methods inherited from class org.norther.tammi.core.security.DefaultSecureContainer |
|---|
addAllowedPermission, addDeniedPermission, allowedPermissions, allowedRoleSet, checkPermission, checkPermission, checkPermission, clearAllowedPermissions, clearDeniedPermissions, deniedPermissions, deniedRoleSet, getPermissibleRoles, getPermissibleRoles, getPermissibleRoles, isProtected, removeAllowedPermissions, removeDeniedPermissions, setAllowedPermissions, setDeniedPermissions |
| 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 |
| Methods inherited from interface org.norther.tammi.spray.filter.SecureFilter |
|---|
checkPermission |
| Methods inherited from interface org.norther.tammi.core.security.AccessController |
|---|
addAllowedPermission, addDeniedPermission, allowedPermissions, allowedRoleSet, checkPermission, checkPermission, checkPermission, clearAllowedPermissions, clearDeniedPermissions, deniedPermissions, deniedRoleSet, getPermissibleRoles, getPermissibleRoles, getPermissibleRoles, isProtected, removeAllowedPermissions, removeDeniedPermissions, setAllowedPermissions, setDeniedPermissions |
| Methods inherited from interface javax.servlet.Filter |
|---|
destroy, init |
| 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 |
| Methods inherited from interface org.norther.tammi.spray.filter.KeyFilter |
|---|
getKey, getKeyValue, getKeyValues, isLinkedKey, setKey, setLinkedKey |
| Methods inherited from interface javax.servlet.Filter |
|---|
destroy, init |
| Field Detail |
|---|
public static final String TEMPLATE_KEY
| Constructor Detail |
|---|
public DefaultPageFilter()
public DefaultPageFilter(String key)
key - the filter key.| 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 boolean isCachingDisabled()
CacheClient
isCachingDisabled in interface CacheClientpublic void setCachingDisabled(boolean flag)
CacheClient
setCachingDisabled in interface CacheClientflag - the caching disabled flag.public void expireCached(long timestamp)
CacheClient
expireCached in interface CacheClienttimestamp - the timestamp of the expiration.
public void expireFraction(long timestamp,
float fraction)
CacheClient
expireFraction in interface CacheClienttimestamp - the timestamp of the expiration.fraction - the fraction of entries to expire (0.0..1.0).public void clearCached()
CacheClient
clearCached in interface CacheClientpublic ConcurrentMap getCache(boolean create)
CacheClient
getCache in interface CacheClientcreate - true to create a missing cache.
public void removeCache()
CacheClient
removeCache in interface CacheClientpublic void refresh()
Refreshable
refresh in interface Refreshablepublic long getRefreshed()
Refreshable
getRefreshed in interface Refreshablepublic String getErrorTemplate()
TemplateExecutor
getErrorTemplate in interface TemplateExecutorpublic void setErrorTemplate(String template)
TemplateExecutor
setErrorTemplate in interface TemplateExecutortemplate - the name of the error template.public String getPageTemplate()
PageFilter
getPageTemplate in interface PageFilterpublic void setPageTemplate(String template)
PageFilter
setPageTemplate in interface PageFiltertemplate - the name of the page template.public String getDefaultBuilder()
PageFilter
getDefaultBuilder in interface PageFilterpublic void setDefaultBuilder(String name)
PageFilter
setDefaultBuilder in interface PageFiltername - the name of the default builder.
public String getPageTemplate(ServletRequest request,
ServletResponse response,
FilterChain chain)
PageFilter
getPageTemplate in interface PageFilterrequest - the request.response - the response.chain - the filter chain.
public void setPageTemplate(String template,
ServletRequest request,
ServletResponse response,
FilterChain chain)
PageFilter
setPageTemplate in interface PageFiltertemplate - the template.request - the request.response - the response.chain - the filter chain.
public void setPageTemplate(String template,
String encoding,
ServletRequest request,
ServletResponse response,
FilterChain chain)
PageFilter
setPageTemplate in interface PageFiltertemplate - the template.encoding - the encoding.request - the request.response - the response.chain - the filter chain.
public String getPageEncoding(ServletRequest request,
ServletResponse response)
PageFilter
getPageEncoding in interface PageFilterrequest - the request.response - the response.
public ObjectName getTaskLoaderName()
PageFilter
getTask