I was working on the http://jira.jboss.com/jira/browse/JBSEAM-1891
and created three caching alternatives which can now be plugged in.
As this is the first thing I write, I would appreciate a feedback, if
the provided solution is what Christian was actually looking for and if
I should continue this or made something completely useless.
I attached the files and testng tests. If this is considered useful, I
can provide a SVN patch as well. All files are new anyway.
JBoss TreeCache 1.4
API changes a lot from 1.4 to 2, so we must be careful once the
I did not use the PojoCache as we have only simple Strings and no
complex beans. In that case PojoCache provides only overhead. (info
taken from pojocache wiki).
I did not enforce any Transaction guaranties (like READ_COMMITED) as we
have in Hibernate for example.
Manually written, idea: a large site cannot be hold in a cache being
present in memory. This cache has a small in memory area holding very
frequent files (size can be configured) and fetches files from disk.
Though the operation system caches access to disk, this is still a lot
slower than memory access but probably faster than having complex
queries to the database (see Seam Wiki queries)
The Cache can already be used in a web application using a custom
example for components.xml
<component class="org.jboss.seam.statistics.StatisticsManager" />
I introduces a StatisticsManger component which might be used by any
components providing statistic information. This would provide one place
to access statistics of the application or to print a report. If you
like the idea, I would add a MBean wrapping this StatisticsManager else
I'll just remove it from the cache providers.
I did not find a way to access the name of the application (web context)
to use it as prefix for the JBoss TreeCache in case we use multiple
applications on the same system.
Is there a common way to load resources like configuration files? I saw
different approaches in the core code.