Commits

chri...@81dbac14-341a-0410-aa85-cbcd92e6f43e  committed b43fee9

CACHE-95 - Output scope names instead of internal scope IDs

  • Participants
  • Parent commits f5c5424

Comments (0)

Files changed (1)

File src/core/java/com/opensymphony/oscache/extra/ScopeEventListenerImpl.java

  * @author <a href="mailto:abergevin@pyxis-tech.com">Alain Bergevin</a>
  */
 public class ScopeEventListenerImpl implements ScopeEventListener {
+
+    /**
+     * Scope names
+     */
+    public static final String[] SCOPE_NAMES = {null, "page", "request", "session", "application"};
+
     /**
      * Number of known scopes
      */
-    public static final int NB_SCOPES = 4;
+    public static final int NB_SCOPES = SCOPE_NAMES.length - 1;
 
     /**
      * Page scope number
         StringBuffer returnString = new StringBuffer("Flush count for ");
 
         for (int count = 1; count <= NB_SCOPES; count++) {
-            returnString.append("scope " + count + " = " + scopeFlushCount[count] + ", ");
+            returnString.append("scope " + SCOPE_NAMES[count] + " = " + scopeFlushCount[count] + ", ");
         }
 
         // Remove the last 2 chars, which are ", "