| Home >> All >> com >> opensymphony >> oscache |
Package Samples:
com.opensymphony.oscache.web.filter: Provides classes and interfaces that make up the base of OSCache's web application support.
com.opensymphony.oscache.base.algorithm: Provides the base classes and interfaces that make up the core of OSCache.
com.opensymphony.oscache.base.persistence: Provides the base classes and interfaces that make up the core of OSCache.
com.opensymphony.oscache.web
com.opensymphony.oscache.util
com.opensymphony.oscache.plugins.diskpersistence
com.opensymphony.oscache.plugins.clustersupport
com.opensymphony.oscache.general
com.opensymphony.oscache.extra
com.opensymphony.oscache.base.events
com.opensymphony.oscache.base
com.opensymphony.oscache.web.tag
Classes:
AbstractConcurrentReadCache: A version of Hashtable that supports mostly-concurrent reading, but exclusive writing. Because reads are not limited to periods without writes, a concurrent reader policy is weaker than a classic reader/writer policy, but is generally faster and allows more concurrency. This class is a good choice especially for tables that are mainly created by one thread during the start-up phase of a program, and from then on, are mainly read (with perhaps occasional additions or removals) in many threads. If you also need concurrency among writes, consider instead using ConcurrentHashMap. Successful retrievals ...
GeneralCacheAdministrator: A GeneralCacheAdministrator creates, flushes and administers the cache. EXAMPLES : // --------------------------------------------------------------- // Typical use with fail over // --------------------------------------------------------------- String myKey = "myKey"; String myValue; int myRefreshPeriod = 1000; try { // Get from the cache myValue = (String) admin.getFromCache(myKey, myRefreshPeriod); } catch (NeedsRefreshException nre) { try { // Get the value (probably by calling an EJB) myValue = "This is the content retrieved."; // Store in the cache admin.putInCache(myKey, myValue); } catch ...
FlushTag: FlushTag flushes caches created with <cache>. This tag provides programmatic control over when caches are flushed, and can flush all caches at once. Usage Examples: <%@ taglib uri="oscache" prefix="cache" %> <cache:flush scope="application" /> <cache:flush scope="session" key="foobar" /> Note: If no scope is provided (or scope is null), it will flush all caches globally - use with care! Flushing is done by setting an appropriate application level time, which <cache> always looks at before retrieving the cache. If this 'flush time' is > that cache's last update, ...
JavaGroupsBroadcastingListener: A concrete implementation of the AbstractBroadcastingListener based on the JavaGroups library. This Class uses JavaGroups to broadcast cache flush messages across a cluster. One of the following properties should be configured in oscache.properties for this listener: cache.cluster.multicast.ip - The multicast IP that JavaGroups should use for broadcasting cache.cluster.properties - The JavaGroups channel properties to use. Allows for precise control over the behaviour of JavaGroups Please refer to the clustering documentation for further details on the configuration of this listener.
UseCachedTag: UseCachedTag is a tag that tells a <cache> tag to reuse the cached body. Usage Example: <%@ taglib uri="oscache" prefix="cache" %> <cache:cache key="mycache" scope="application"> if (reuse cached) <cache:usecached /> else some other logic </cache:cache> Note this is very useful with try / catch blocks so that you can still produce old cached data if an exception occurs, eg your database goes down.
LRUCache: LRU (Least Recently Used) algorithm for the cache. Since release 2.3 this class requires Java 1.4 to use the LinkedHashSet . Use prior OSCache release which require the Jakarta commons-collections SequencedHashMap class or the LinkedList class if neither of the above classes are available. No synchronization is required in this class since the AbstractConcurrentReadCache already takes care of any synchronization requirements.
WebEntryRefreshPolicy: Interface to implement an entry refresh policy. Specify the name of the implementing class using the refreshpolicyclass attribute of the cache tag. If any additional parameters are required, they should be supplied using the refreshpolicyparam attribute. For example: <cache:cache key="mykey" refreshpolicyclass="com.mycompany.cache.policy.MyRefreshPolicy" refreshpolicyparam="...additional data..."> My cached content </cache:cache>
CacheTag: CacheTag is a tag that allows for server-side caching of post-processed JSP content. It also gives great programatic control over refreshing, flushing and updating the cache. Usage Example: <%@ taglib uri="oscache" prefix="cache" %> <cache:cache key="mycache" scope="application" refresh="false" time="30"> jsp content here... refreshed every 30 seconds </cache:cache>
NeedsRefreshException: This exception is thrown when retrieving an item from cache and it is expired. Note that for fault tolerance purposes, it is possible to retrieve the current cached object from the exception. January, 2004 - The OSCache developers are aware of the fact that throwing an exception for a perfect valid situation (cache miss) is design smell. This will be removed in the near future, and other means of refreshing the cache will be provided.
StatisticListenerImpl: A simple implementation of a statistic reporter which uses the CacheMapAccessEventListener, CacheEntryEventListener and ScopeEventListener. It uses the events to count the cache hit and misses and of course the flushes. We are not using any synchronized so that this does not become a bottleneck. The consequence is that on retrieving values, the operations that are currently being done won't be counted.
ServletCacheAdministrator: A ServletCacheAdministrator creates, flushes and administers the cache. This is a "servlet Singleton". This means it's not a Singleton in the traditional sense, that is stored in a static instance. It's a Singleton _per web app context_. Once created it manages the cache path on disk through the oscache.properties file, and also keeps track of the flush times.
TestAbstractCacheAdministrator: Test class for the AbstractCacheAdministrator class. It tests some of the public methods of the admin. Some others cannot be tested since they are linked to the property file used for the tests, and since this file will change, the value of some parameters cannot be asserted $Id: TestAbstractCacheAdministrator.java,v 1.1 2005/06/17 05:06:47 dres Exp $
CacheEntryEventType: This is all the possible events that may occur on a cache entry or collection of cache entries. There is a corresponding interface CacheEntryEventListener for handling these events.
TestLRUCache: Test class for the LRUCache class. It only tests that the algorithm reacts as expected when entries are removed. All the other tests related to the LRU algorithm are in the TestNonQueueCache class, since those tests are shared with the TestUnlimitedCache class. $Id: TestLRUCache.java,v 1.1 2005/06/17 05:07:08 dres Exp $
TestUnlimitedCache: Test class for the Unlimited cache algorithm. Most of the tests are done in the TestNonQueueCache class, so only algorithm specific tests are done here. Since this is an unlimited cache, there's not much to test about the algorithm. $Id: TestUnlimitedCache.java,v 1.2 2006/06/15 16:27:17 ltorunski Exp $
SplitServletOutputStream: Extends the base ServletOutputStream class so that the stream can be captured as it gets written. This is achieved by overriding the write() methods and outputting the data to two streams - the original stream and a secondary stream that is designed to capture the written data.
CacheEntryEventListenerImpl: Implementation of a CacheEntryEventListener. It use the events to count the operations performed on the cache. We are not using any synchronized so that this does not become a bottleneck. The consequence is that on retrieving values, the operations that are currently being done won't be counted.
ListenForClusterTests: This should be used in conjunction with the cluster test cases. Run this program to set up listeners for the various clustering implementations so you can see that the test messages are being received correctly. A shutdown hook is installed so the listeners can be shut down cleanly.
CacheMapAccessEventListenerImpl: Implementation of a CacheMapAccessEventListener. It uses the events to count the cache hit and misses. We are not using any synchronized so that this does not become a bottleneck. The consequence is that on retrieving values, the operations that are currently being done won't be counted.
TestLoadCompleteWeb: Test class for the com.opensymphony.oscache.web package. It invokes all the test suites of all the other classes of the package. The test methods will be invoked with many users and iterations to simulate load on request $Id: TestLoadCompleteWeb.java,v 1.1 2005/06/17 05:06:37 dres Exp $
TestGeneralCacheAdministrator: Test all the public methods of the GeneralCacheAdministrator class. Since this class extends the TestAbstractCacheAdministrator class, the AbstractCacheAdministrator is tested when invoking this class. $Id: TestGeneralCacheAdministrator.java,v 1.2 2006/04/09 12:50:34 ltorunski Exp $
AbstractCacheAdministrator: An AbstractCacheAdministrator defines an abstract cache administrator, implementing all the basic operations related to the configuration of a cache, including assigning any configured event handlers to cache objects. Extend this class to implement a custom cache administrator.
HashDiskPersistenceListener: Persists cache data to disk. Provides a hash of the standard key name as the file name. A configurable hash algorithm is used to create a digest of the cache key for the disk filename. This is to allow for more sane filenames for objects which dont generate friendly cache keys.
CacheEntryEventListener: This is the interface to listen to cache entry events. There is a method for each event type. These methods are called via a dispatcher. If you want to be notified when an event occurs on an entry, group or across a pattern, register a listener and implement this interface.
TestCompleteAlgorithm: Test class for the com.opensymphony.oscache.base.algorithm package. It invokes all the test suites of all the other classes of the package, except abstract ones because they are tested via final ones. $Id: TestCompleteAlgorithm.java,v 1.1 2005/06/17 05:07:08 dres Exp $
| Home | Contact Us | Privacy Policy | Terms of Service |