
Constructs
Overview
Ehcache-constructs builds on top of ehcache to create
implementations for common caching patterns.
All implementations use ehcache as the backing cache. They also share a
common purpose - to create very high performance Java applications.
Pattern Implementations
General Purpose Caching
- BlockingCache
- a cache which blocks subsequent threads until the
first read thread populates a cache entry
- SelfPopulatingCache
- a read-through cache. A cache that
populates elements as they are requested without requiring the caller
to know how the entries are populated. It also enables refreshes of
cache entries without blocking reads on the same entries.
- UpdatingSelfPopulatingCache - a read-through cache. A cache that
populates elements as they are requested without requiring the caller
to know how the entries are populated. The cache entry is automatically
updated on subsequent reads.
- SelfPopulatingCollectionsCache - a SelfPopulatingCache that adds
threading safety where it is known in advance that all entries will be
collections.
Web Caching
Servlet 2.3 caching filters that cache HTTP/S responses:
- CachingFilter - an abstract, extensible caching filter.
- SimplePageCachingFilter - a concrete implementation which caches
pages based on the request URI and Query String.
- SimplePageFragmentCachingFilter - a concrete implementation which
caches page fragments based on the request URI and Query String.
Asynchronous Command Executor
This is the trusty old command pattern with a twist: asynchronous
behaviour, fault tolerance and caching.
Quality Features
Ehcache-constructs has the following features:
- Fast - performance benchmarks are used throughout unit testing
- Simple - each pattern implementation is as simple as it can be.
- Small foot print. Both in terms of size and memory requirements.
- Minimal dependencies.
- Fully documented. See the online Documentation
and the online JavaDoc.
- Comprehensive unit test coverage. See
the online clover test report.
- Scalable on large multi-cpu servers. Each construct is
concurrency tested with unit tests.
- Available under the Apache 1.1
license. Ehcache's copyright and licensing has been reviewed and
approved by the Apache Software Foundation, making ehcache suitable for
use in Apache projects.
- Production tested. All versions of
ehcache are production tested for several weeks on a large and very
busy eCommerce site before release.
Now Separately Distributed
Ehcache-constructs is now separately packaged. Ehcache itself is now
very mature. Most of the changes now are creating implementations to
solve common caching problems. Splitting out constructs allows for a
different release cycle. Also there is the Unix maxim, do one thing and
do it well.
News Highlights
15 August 2005 Announcing ehcache-constructs-0.6.
A subproject of ehcache, ehcache-constructs builds on top of ehcache to
create implementations for common caching patterns. All implementations
use ehcache as the backing cache. They also share a common purpose - to
create very high performance Java applications. New in this version is
a fault-tolerant AsynchronousCommandExecutor, which will asynchronously
execute arbitrary commands, optionally retrying on a defined array of
Exception types a defined number of times at a defined interval.
23 November 2004
ehcache-constructs 0.5 released. This is the first release.
The constructs package was previously distributed with ehcache. Much of
it is very mature. .5 represents a halfway point between starting and a
1.0 release, which is about right.
See the release notes and full changelog here.
Downloads
Download here.
Contributions

The
ehcache project gratefully acknowledges the contribution of wotif.com,
who granted a license to the authors to in respect of code developed at
wotif.com for the purpose of making it available to the community under
an Apache open source license.

The ehcache project gratefully acknowledges the
contriubtion of Novell, Inc, who granted a license to the authors of
the AsynchronousCommandExecutor and associated code for the purposes of
making it available to the communtiy under an Apache open source
license.
Thanks also to:
- ThoughtWorks for free
legal assistance in formalising the
granting of code from wotif.com to the open source community. Copies
of the executed deeds are available should anyone need to audit
the grant.
- Cenqua for the free open
source license of the test coverage tool Clover.
- Atlassian for the free
open source licenses of JIRA,
an issue tracking tool and Confluence, a
wiki.
- Ironflare for
permission to embed the excellent Orion
application server in the testing infrastructure for use as a Servlet
2.3 container. Orion is not distributed in the binary. It is not a
dependency for using ehcache-constructs. Commercial use of Orion
requires a license.
Finally, thanks to those who have contributed to the project.
Those people are acknowledged in the traditional way with an @author
tag in the source code.
About the
ehcache-constructs name
Doug Lea in his book Concurrent
Programming in Java talks about concurrency support constructs. One
meaning of a construct is "an abstract or general idea inferred or
derived from specific instances". Just like patterns emerge from
noting the similarities of problems and gradually finding a solution to
classes of them, so to constructs are general solutions to commond
problems. With ehcache-constructs, concrete, extensible implementations
are offered to solve these common problems.
