We have developed a Custom Action, which only prints some logging. Now we are 
looking at the caching and this interrupts our caching. I was looking through 
the cocoon documentation and found something about caching, but I want to make 
sure I understand it.

If I have the following code, will this interrupt with the caching?

public class LogAction extends AbstractAction implements ThreadSafe, 
CacheableProcessingComponent {

    /**
     * @see 
org.apache.cocoon.acting.Action#act(org.apache.cocoon.environment.Redirector,
     *      org.apache.cocoon.environment.SourceResolver, java.util.Map,
     *      java.lang.String, org.apache.avalon.framework.parameters.Parameters)
     */
    public Map act(final Redirector redirector, final SourceResolver resolver, 
final Map objectModel, final String source, final Parameters parameters) throws 
Exception {
        String msg = parameters.getParameter("msg", null);
        String level = parameters.getParameter("level", "DEBUG");
        LogLevel logLevel = LogLevel.valueOf(level.toUpperCase());
        logLevel.log(getLogger(), msg);

        // don't execute what's inside this action, it's just here to log 
something
        return null;
    }

    @Override
    public Serializable getKey() {
        return "LogAction";
    }

    @Override
    public SourceValidity getValidity() {
        return NOPValidity.SHARED_INSTANCE;
    }
}

With regards,

Nick Stolwijk
~Java Developer~

Iprofs BV.
Claus Sluterweg 125
2012 WS Haarlem
www.iprofs.nl

********************************************
Hippocms-dev: Hippo CMS development public mailinglist

Reply via email to