org.riotfamily.website.cache
Class TaggingObjectWrapperPlugin

java.lang.Object
  extended by org.riotfamily.website.cache.TaggingObjectWrapperPlugin
All Implemented Interfaces:
ObjectWrapperPlugin, Ordered

public class TaggingObjectWrapperPlugin
extends Object
implements ObjectWrapperPlugin, Ordered

ObjectWrapperPlugin that tags cache items whenever a class with the TagCacheItems annotation is accessed by a FreeMarker template.

Author:
Felix Gnass [fgnass at neteye dot de]

Field Summary
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
TaggingObjectWrapperPlugin()
           
 
Method Summary
 int getOrder()
           
 void setOrder(int order)
          Sets the order.
 void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
           
 boolean supports(Object obj)
           
 freemarker.template.TemplateModel wrapSupportedObject(Object obj, PluginObjectWrapper wrapper)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaggingObjectWrapperPlugin

public TaggingObjectWrapperPlugin()
Method Detail

setSessionFactory

public void setSessionFactory(org.hibernate.SessionFactory sessionFactory)

getOrder

public int getOrder()
Specified by:
getOrder in interface Ordered

setOrder

public void setOrder(int order)
Sets the order. Default is Ordered.HIGHEST_PRECEDENCE.


supports

public boolean supports(Object obj)
Specified by:
supports in interface ObjectWrapperPlugin

wrapSupportedObject

public freemarker.template.TemplateModel wrapSupportedObject(Object obj,
                                                             PluginObjectWrapper wrapper)
                                                      throws freemarker.template.TemplateModelException
Specified by:
wrapSupportedObject in interface ObjectWrapperPlugin
Throws:
freemarker.template.TemplateModelException