Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.opensymphony.oscache.extra
Class CacheMapAccessEventListenerImpl

    java.lang.Object
      com.opensymphony.oscache.extra.CacheMapAccessEventListenerImpl

All Implemented Interfaces:
  CacheEventListener, CacheMapAccessEventListener, java.util.EventListener

public class CacheMapAccessEventListenerImpl
extends java.lang.Object
implements CacheMapAccessEventListener

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.

Version:
  $Revision: 1.1 $
Author:
  Alain Bergevin, Chris Miller

Constructor Summary
`CacheMapAccessEventListenerImpl()` Constructor, empty for us

Method Summary
`void` | `accessed(CacheMapAccessEvent event)` This method handles an event each time the cache is accessed
`int` | `getHitCount()` Returns the cache's current hit count
`int` | `getMissCount()` Returns the cache's current miss count
`int` | `getStaleHitCount()` Returns the cache's current stale hit count
`void` | `reset()` Resets all of the totals to zero
`java.lang.String` | `toString()` Return the counters in a string form

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### CacheMapAccessEventListenerImpl

    public CacheMapAccessEventListenerImpl()

  Constructor, empty for us

Method Detail

### getHitCount

    public int getHitCount()

  Returns the cache's current hit count

  Returns:
    The hit count

### getMissCount

    public int getMissCount()

  Returns the cache's current miss count

  Returns:
    The miss count

### getStaleHitCount

    public int getStaleHitCount()

  Returns the cache's current stale hit count

### accessed

    public void accessed(CacheMapAccessEvent event)

  This method handles an event each time the cache is accessed

  Specified by:
    `accessed` in interface `CacheMapAccessEventListener`
  Parameters:
    `event` - The event triggered when the cache was accessed

### reset

    public void reset()

  Resets all of the totals to zero

### toString

    public java.lang.String toString()

  Return the counters in a string form

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| See www.opensymphony.com for more information.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD