Source Code Cross Referenced for CacheEntryEventListenerImpl.java in  » Cache » OSCache » com » opensymphony » oscache » extra » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
C# / CSharp Tutorial
ASP.Net
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Cache » OSCache » com.opensymphony.oscache.extra 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (c) 2002-2003 by OpenSymphony
003:         * All rights reserved.
004:         */
005:        package com.opensymphony.oscache.extra;
006:
007:        import com.opensymphony.oscache.base.events.*;
008:
009:        /**
010:         * Implementation of a CacheEntryEventListener. It use the events to count
011:         * the operations performed on the cache.
012:         * <p>
013:         * We are not using any synchronized so that this does not become a bottleneck.
014:         * The consequence is that on retrieving values, the operations that are
015:         * currently being done won't be counted.
016:         *
017:         * @version        $Revision: 254 $
018:         * @author <a href="mailto:abergevin@pyxis-tech.com">Alain Bergevin</a>
019:         * @author <a href="&#109;a&#105;&#108;&#116;&#111;:chris&#64;swebtec.&#99;&#111;&#109;">Chris Miller</a>
020:         */
021:        public class CacheEntryEventListenerImpl implements 
022:                CacheEntryEventListener {
023:            /**
024:             * Counter for the cache flushes
025:             */
026:            private int cacheFlushedCount = 0;
027:
028:            /**
029:             * Counter for the added entries
030:             */
031:            private int entryAddedCount = 0;
032:
033:            /**
034:             * Counter for the flushed entries
035:             */
036:            private int entryFlushedCount = 0;
037:
038:            /**
039:             * Counter for the removed entries
040:             */
041:            private int entryRemovedCount = 0;
042:
043:            /**
044:             * Counter for the updated entries
045:             */
046:            private int entryUpdatedCount = 0;
047:
048:            /**
049:             * Counter for the flushed groups
050:             */
051:            private int groupFlushedCount = 0;
052:
053:            /**
054:             * Counter for the pattern flushes
055:             */
056:            private int patternFlushedCount = 0;
057:
058:            /**
059:             * Constructor, empty for us
060:             */
061:            public CacheEntryEventListenerImpl() {
062:            }
063:
064:            /**
065:             * Gets the add counter
066:             *
067:             * @return The added counter
068:             */
069:            public int getEntryAddedCount() {
070:                return entryAddedCount;
071:            }
072:
073:            /**
074:             * Gets the flushed counter
075:             *
076:             * @return The flushed counter
077:             */
078:            public int getEntryFlushedCount() {
079:                return entryFlushedCount;
080:            }
081:
082:            /**
083:             * Gets the removed counter
084:             *
085:             * @return The removed counter
086:             */
087:            public int getEntryRemovedCount() {
088:                return entryRemovedCount;
089:            }
090:
091:            /**
092:             * Gets the updated counter
093:             *
094:             * @return The updated counter
095:             */
096:            public int getEntryUpdatedCount() {
097:                return entryUpdatedCount;
098:            }
099:
100:            /**
101:             * Gets the group flush counter
102:             *
103:             * @return The number of group flush calls that have occurred
104:             */
105:            public int getGroupFlushedCount() {
106:                return groupFlushedCount;
107:            }
108:
109:            /**
110:             * Gets the pattern flush counter
111:             *
112:             * @return The number of pattern flush calls that have occurred
113:             */
114:            public int getPatternFlushedCount() {
115:                return patternFlushedCount;
116:            }
117:
118:            /**
119:             * Gets the cache flush counter
120:             *
121:             * @return The number of times the entire cache has been flushed
122:             */
123:            public int getCacheFlushedCount() {
124:                return cacheFlushedCount;
125:            }
126:
127:            /**
128:             * Handles the event fired when an entry is added in the cache.
129:             *
130:             * @param event The event triggered when a cache entry has been added
131:             */
132:            public void cacheEntryAdded(CacheEntryEvent event) {
133:                entryAddedCount++;
134:            }
135:
136:            /**
137:             * Handles the event fired when an entry is flushed from the cache.
138:             *
139:             * @param event The event triggered when a cache entry has been flushed
140:             */
141:            public void cacheEntryFlushed(CacheEntryEvent event) {
142:                entryFlushedCount++;
143:            }
144:
145:            /**
146:             * Handles the event fired when an entry is removed from the cache.
147:             *
148:             * @param event The event triggered when a cache entry has been removed
149:             */
150:            public void cacheEntryRemoved(CacheEntryEvent event) {
151:                entryRemovedCount++;
152:            }
153:
154:            /**
155:             * Handles the event fired when an entry is updated in the cache.
156:             *
157:             * @param event The event triggered when a cache entry has been updated
158:             */
159:            public void cacheEntryUpdated(CacheEntryEvent event) {
160:                entryUpdatedCount++;
161:            }
162:
163:            /**
164:             * Handles the event fired when a group is flushed from the cache.
165:             *
166:             * @param event The event triggered when a cache group has been flushed
167:             */
168:            public void cacheGroupFlushed(CacheGroupEvent event) {
169:                groupFlushedCount++;
170:            }
171:
172:            /**
173:             * Handles the event fired when a pattern is flushed from the cache.
174:             *
175:             * @param event The event triggered when a cache pattern has been flushed
176:             */
177:            public void cachePatternFlushed(CachePatternEvent event) {
178:                patternFlushedCount++;
179:            }
180:
181:            /**
182:             * Handles the event fired when a cache flush occurs.
183:             *
184:             * @param event The event triggered when an entire cache is flushed
185:             */
186:            public void cacheFlushed(CachewideEvent event) {
187:                cacheFlushedCount++;
188:            }
189:
190:            /**
191:             * Returns the internal values in a string form
192:             */
193:            public String toString() {
194:                return ("Added " + entryAddedCount + ", Updated "
195:                        + entryUpdatedCount + ", Flushed " + entryFlushedCount
196:                        + ", Removed " + entryRemovedCount
197:                        + ", Groups Flushed " + groupFlushedCount
198:                        + ", Patterns Flushed " + patternFlushedCount
199:                        + ", Cache Flushed " + cacheFlushedCount);
200:            }
201:        }
www.java2java.com | Contact Us
Copyright 2010 - 2030 Java Source and Support. All rights reserved.
All other trademarks are property of their respective owners.