Expresso Caching

Expresso offers built-in caching ability, designed to be completely configurable for different deployment situations. Caching is handled via a CacheManager object, designed to maximize performance without causing out-of-memory problems by trying to hold too much in cache at once.

Version:

Expresso 5.0

Author:

Michael Nash

Expresso Components Listing


Caching Configuration Values Controller Objects
Database Objects DB Connection Pooling Email Connectivity
Event Notification and Error Handling Health Check Job Control
Logging Registration & Login Security
Taglibs Unit Testing Workflow
XML


Introduction

The Expresso framework includes a caching system build into the framework. This caching layer can cache just about anything from dbobjects and configuration parameters to custom build caches. This caching layer provides fast lookups for frequent used data and provides an alternative for make frequent database calls. The actual class that controls the caching is called the CacheManger and call be found in the expresso tree underunder expresso/core/cache/CacheManager.

The CacheManger works by providing a general-purpose class that handles both ordered caches and unordered caches. The ordered caches are made possible by storing the data as a vector of objects. The unordered caches are supported by placing the data into hashtables. Also, the CacheManger only works if the amount of free memory is above 10%. The free memory is the memory in the Java Virtual Machine, and can vary from moment to moment.

CacheManager is fully independant of even the DBObject components, so you can use it to your heart's content independently of using Expresso. For example, there's an example in:
com.jcorporate.expresso.core.dbobj.SecuredDBObject of the security system creating it's own cache to significantly speed table lookups for security checking.

This release includes work to the Cache system to make it more scaleable and robust. .

Topics

Introduction
Automatic Caching
Database Object Caching
Custom Caching
Clustered or Distributed Environments
Conclusion


Automatic Caching

Objects commonly accessed, such as configuration values and setup values and security data are automatically cached, but the cache is automatically updated when the corresponding item is changed in the database, so you never have to worry about "stale" data in the cache..

Database Object Caching

Database objects (usually representing data in a table in a database) can also be cached, and you can control the number of cache entries for each object, using more caching for items more frequently used by your application.

The cache manager also performs automatic memory management by keeping a monitor of the amount of memory available and used, and automatically clearing the least-frequently used caches when memory drops below a configurable threshold.

Custom Caching

Your application can use the CacheManager to cache any custom information required, allowing you to selectively improve performance without sacrificing the accuracy of data.

Clustered or Distributed Environments

Caching can even be used in a distributed environment, as the cache manager can be set up to allow synchronization with caches from other servers or contexts, guaranteeing the most current data to your users while still offering the performance benefits of the cache.

Conclusion

For technical information about how to use caching, please refer to the Expresso Developers Guide (EDG) or the Javadocs about the ConfigManager.

.

Top of Page


Home | Products | Services | Partners | Customers | About Us | Login | Forums | Contact Us

Copyright © 2001-2002 Jcorporate Ltd. All rights reserved. Copyright Privacy

Last Modified: 07-Oct-02 9:21:58 PM