org.riotfamily.riot.status
Class AbstractStatusMonitor

java.lang.Object
  extended by org.riotfamily.riot.status.AbstractStatusMonitor
All Implemented Interfaces:
StatusMonitor, BeanNameAware, MessageSourceAware
Direct Known Subclasses:
HqlStatusMonitor

public abstract class AbstractStatusMonitor
extends Object
implements StatusMonitor, MessageSourceAware, BeanNameAware

Convenience base class for StatusMonitor implementations.

Author:
Felix Gnass [fgnass at neteye dot de]

Constructor Summary
AbstractStatusMonitor()
           
 
Method Summary
protected abstract  Object[] getArgs()
          Subclasses must return an array of objects which will be passed to the MessageSource as arguments.
 Collection<StatusMessage> getMessages(Locale locale)
          Implementors may return a Collection of StatusMessage instances.
 boolean isHideZeroStatus()
           
protected  boolean isVisible(Object[] args)
           
 void setBeanName(String name)
           
 void setCache(String period)
           
 void setHideZeroStatus(boolean hideZeroStatus)
           
 void setLink(String link)
           
 void setMessageKey(String messageKey)
           
 void setMessageSource(MessageSource messageSource)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractStatusMonitor

public AbstractStatusMonitor()
Method Detail

setMessageSource

public void setMessageSource(MessageSource messageSource)
Specified by:
setMessageSource in interface MessageSourceAware

setMessageKey

public void setMessageKey(String messageKey)

isHideZeroStatus

public boolean isHideZeroStatus()

setHideZeroStatus

public void setHideZeroStatus(boolean hideZeroStatus)

setBeanName

public void setBeanName(String name)
Specified by:
setBeanName in interface BeanNameAware

setLink

public void setLink(String link)

setCache

public void setCache(String period)

getMessages

public Collection<StatusMessage> getMessages(Locale locale)
Description copied from interface: StatusMonitor
Implementors may return a Collection of StatusMessage instances. Make sure that you properly escape all parts of the message that could contain user-generated content to prevent XSS attacks.

Specified by:
getMessages in interface StatusMonitor

isVisible

protected boolean isVisible(Object[] args)

getArgs

protected abstract Object[] getArgs()
Subclasses must return an array of objects which will be passed to the MessageSource as arguments. All arguments that are neither primitive wrappers nor dates will be HTML-escaped automatically to prevent XSS attacks.

See Also:
FormatUtils.htmlEscapeArgs(Object[])