com.opensymphony.oscache.extra
Class ScopeEventListenerImpl

java.lang.Object
  extended bycom.opensymphony.oscache.extra.ScopeEventListenerImpl
All Implemented Interfaces:
CacheEventListener, EventListener, ScopeEventListener

public class ScopeEventListenerImpl
extends Object
implements ScopeEventListener

Implementation of a ScopeEventListener that keeps track of the scope flush events. 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

Field Summary
static int APPLICATION_SCOPE
          Application scope number
static int NB_SCOPES
          Number of known scopes
static int PAGE_SCOPE
          Page scope number
static int REQUEST_SCOPE
          Request scope number
static String[] SCOPE_NAMES
          Scope names
static int SESSION_SCOPE
          Session scope number
 
Constructor Summary
ScopeEventListenerImpl()
           
 
Method Summary
 int getApplicationScopeFlushCount()
          Gets the flush count for scope APPLICATION_SCOPE.
 int getPageScopeFlushCount()
          Gets the flush count for scope PAGE_SCOPE.
 int getRequestScopeFlushCount()
          Gets the flush count for scope REQUEST_SCOPE.
 int getSessionScopeFlushCount()
          Gets the flush count for scope SESSION_SCOPE.
 int getTotalScopeFlushCount()
          Returns the total flush count.
 void scopeFlushed(ScopeEvent event)
          Handles all the scope flush events.
 String toString()
          Returns all the flush counter in a string form.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SCOPE_NAMES

public static final String[] SCOPE_NAMES
Scope names


NB_SCOPES

public static final int NB_SCOPES
Number of known scopes


PAGE_SCOPE

public static final int PAGE_SCOPE
Page scope number

See Also:
Constant Field Values

REQUEST_SCOPE

public static final int REQUEST_SCOPE
Request scope number

See Also:
Constant Field Values

SESSION_SCOPE

public static final int SESSION_SCOPE
Session scope number

See Also:
Constant Field Values

APPLICATION_SCOPE

public static final int APPLICATION_SCOPE
Application scope number

See Also:
Constant Field Values
Constructor Detail

ScopeEventListenerImpl

public ScopeEventListenerImpl()
Method Detail

getApplicationScopeFlushCount

public int getApplicationScopeFlushCount()
Gets the flush count for scope APPLICATION_SCOPE.

Returns:
The total number of application flush

getPageScopeFlushCount

public int getPageScopeFlushCount()
Gets the flush count for scope PAGE_SCOPE.

Returns:
The total number of page flush

getRequestScopeFlushCount

public int getRequestScopeFlushCount()
Gets the flush count for scope REQUEST_SCOPE.

Returns:
The total number of request flush

getSessionScopeFlushCount

public int getSessionScopeFlushCount()
Gets the flush count for scope SESSION_SCOPE.

Returns:
The total number of session flush

getTotalScopeFlushCount

public int getTotalScopeFlushCount()
Returns the total flush count.

Returns:
The total number of scope flush

scopeFlushed

public void scopeFlushed(ScopeEvent event)
Handles all the scope flush events.

Specified by:
scopeFlushed in interface ScopeEventListener
Parameters:
event - The scope event

toString

public String toString()
Returns all the flush counter in a string form.


OSCache Project Page