> From what do you conclude that it interrupts your caching? That even for
> pipelines which should be cached, still the log is being created? This
> is perfectly sensible and correct, even in cached pipelines.
Exactly, so we thought the caching was not being done, we didn't thought that
actions were processed otherwise.
> It is unrelated to caching, so no. But without it, it does not interrupt
> caching either :-)
;)
> Just to be sure, this LogLevel class does check for something like,
> this.getLogger().isDebugEnabled()
> this.getLogger().isWarnEnabled()
Yes:
private static enum LogLevel {
DEBUG {
public void log(final Logger log, final String message) {
if (log != null && message != null && log.isDebugEnabled()) {
log.debug(message);
}
}
},
INFO {
public void log(final Logger log, final String message) {
if (log != null && message != null && log.isInfoEnabled()) {
log.info(message);
}
}
},
WARN {
public void log(final Logger log, final String message) {
if (log != null && message != null && log.isWarnEnabled()) {
log.warn(message);
}
}
},
ERROR {
public void log(final Logger log, final String message) {
if (log != null && message != null && log.isErrorEnabled()) {
log.error(message);
}
}
},
FATAL {
public void log(final Logger log, final String message) {
if (log != null && message != null &&
log.isFatalErrorEnabled()) {
log.fatalError(message);
}
}
};
public abstract void log(Logger log, String message);
}
We switched for our own code to Java 5, so this works well.
Thanks,
Nick Stolwijk
~Java Developer~
Iprofs BV.
Claus Sluterweg 125
2012 WS Haarlem
www.iprofs.nl
-----Original Message-----
From: [EMAIL PROTECTED] on behalf of Ard Schrijvers
Sent: Fri 5/23/2008 15:37
To: Hippo CMS development public mailinglist
Subject: RE: [HippoCMS-dev] Actions and Caching
It happens that in short notice I will be giving advanced level cocoon
caching course. You might want to consider joining if your boss allows
you to :-) It will cover all kinds of caching starting basic from
caching in browsers, from browser to proxy, from browser/proxy to
application, between applications (Cocoon-Slide), Cocoon pipeline
(event/expires)caching, internal component caching, SourceValidities
like TimeStamp, Expires, NopValidity, EventValidities + JMS, Cocoon
status page + understanding what's in, what caches are available, etc
etc, and a set of tools to help you understand where your caching fails.
>
> We have developed a Custom Action, which only prints some
> logging. Now we are looking at the caching and this
> interrupts our caching.
>From what do you conclude that it interrupts your caching? That even for
pipelines which should be cached, still the log is being created? This
is perfectly sensible and correct, even in cached pipelines.
> 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?
It is unrelated to caching, so no. But without it, it does not interrupt
caching either :-)
>
> public class LogAction extends AbstractAction implements
> ThreadSafe, CacheableProcessingComponent {
*Actions* never implement CacheableProcessingComponent!! You can
implement it, but getKey() or getValidity will never be called.
CacheableProcessingComponent only serves for caching of
SitemapModelComponents (like generator, transformers and serializers).
Actions are unique sitemap components merely used to perform processing.
This means, even in cached pipelines, they are called.
What would be to cache about an action anyway? See [1] and [2] for
documentation about Actions and CacheableProcessingComponent contracts
> LogLevel logLevel = LogLevel.valueOf(level.toUpperCase());
> logLevel.log(getLogger(), msg);
Just to be sure, this LogLevel class does check for something like,
this.getLogger().isDebugEnabled()
this.getLogger().isWarnEnabled()
Etc? Not checking this is quite costly.
[1] http://cocoon.zones.apache.org/daisy/cdocs/g1/g1/g2/g1/g2/676.html
[2] http://cocoon.zones.apache.org/daisy/cdocs/g1/g1/g2/g1/g1/675.html
********************************************
Hippocms-dev: Hippo CMS development public mailinglist
********************************************
Hippocms-dev: Hippo CMS development public mailinglist