Sun Java System Portal Server Mobile Access 7.1 Developer's Guide

Understanding the ContextCache Class

The ContextCache class, as its name implies, is a simple cache mechanism for storing multiple Context instances. This class exists for essentially one reason: to give a unique name to the cache into which a particular type of context will be stored.

The ContextCache class resides in the com.sun.portal.wireless.taglibs.base package.

Typically, for every major Context subclass (for example, MailContext, CalContext, and ABContext), there exists a corresponding ContextCache subclass (for example, MailContextCache, CalContextCache, and ABContextCache).

To obtain an instance of this class, invoke the following method, passing in the name of the context to be retrieved:

public static synchronized ContextCache getInstance(String className)

To add/remove contexts to or from the cache, invoke put or get: