Source Code Cross Referenced for Cache.java in  » Net » openfire » org » jivesoftware » util » cache » 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
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Net » openfire » org.jivesoftware.util.cache 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * $RCSfile$
003:         * $Revision: 8311 $
004:         * $Date: 2007-05-14 12:51:36 -0700 (Mon, 14 May 2007) $
005:         *
006:         * Copyright (C) 2004 Jive Software. All rights reserved.
007:         *
008:         * This software is published under the terms of the GNU Public License (GPL),
009:         * a copy of which is included in this distribution.
010:         */package org.jivesoftware.util.cache;
011:
012:        /**
013:         * General purpose cache. It stores objects associated with unique keys in
014:         * memory for fast access. All keys and values added to the cache must
015:         * implement the Serializable interface. Values may implement the Cacheable
016:         * interface, which allows the cache to determine object size much more quickly.
017:         * These restrictions allow a cache to never grow larger than a specified number
018:         * of bytes and to optionally be distributed over a cluster of servers.<p>
019:         *
020:         * If the cache does grow too large, objects will be removed such that those
021:         * that are accessed least frequently are removed first. Because expiration
022:         * happens automatically, the cache makes <b>no</b> gaurantee as to how long
023:         * an object will remain in cache after it is put in.<p>
024:         *
025:         * Optionally, a maximum lifetime for all objects can be specified. In that
026:         * case, objects will be deleted from cache after that amount of time, even
027:         * if they are frequently accessed. This feature is useful if objects put in
028:         * cache represent data that should be periodically refreshed; for example,
029:         * information from a database.<p>
030:         *
031:         * All cache operations are thread safe.<p>
032:         *
033:         * @see Cacheable
034:         */
035:        public interface Cache<K, V> extends java.util.Map<K, V> {
036:
037:            /**
038:             * Returns the name of the cache.
039:             *
040:             * @return the name of the cache.
041:             */
042:            String getName();
043:
044:            /**
045:             * Sets the name of the cache
046:             *
047:             * @param name the name of the cache
048:             */
049:            void setName(String name);
050:
051:            /**
052:             * Returns the maximum size of the cache in bytes. If the cache grows larger
053:             * than the max size, the least frequently used items will be removed. If
054:             * the max cache size is set to -1, there is no size limit.
055:             *
056:             * @return the maximum size of the cache in bytes.
057:             */
058:            long getMaxCacheSize();
059:
060:            /**
061:             * Sets the maximum size of the cache in bytes. If the cache grows larger
062:             * than the max size, the least frequently used items will be removed. If
063:             * the max cache size is set to -1, there is no size limit.
064:             *
065:             * @param maxSize the maximum size of the cache in bytes.
066:             */
067:            void setMaxCacheSize(int maxSize);
068:
069:            /**
070:             * Returns the maximum number of milliseconds that any object can live
071:             * in cache. Once the specified number of milliseconds passes, the object
072:             * will be automatically expried from cache. If the max lifetime is set
073:             * to -1, then objects never expire.
074:             *
075:             * @return the maximum number of milliseconds before objects are expired.
076:             */
077:            long getMaxLifetime();
078:
079:            /**
080:             * Sets the maximum number of milliseconds that any object can live
081:             * in cache. Once the specified number of milliseconds passes, the object
082:             * will be automatically expried from cache. If the max lifetime is set
083:             * to -1, then objects never expire.
084:             *
085:             * @param maxLifetime the maximum number of milliseconds before objects are expired.
086:             */
087:            void setMaxLifetime(long maxLifetime);
088:
089:            /**
090:             * Returns the size of the cache contents in bytes. This value is only a
091:             * rough approximation, so cache users should expect that actual VM
092:             * memory used by the cache could be significantly higher than the value
093:             * reported by this method.
094:             *
095:             * @return the size of the cache contents in bytes.
096:             */
097:            int getCacheSize();
098:
099:            /**
100:             * Returns the number of cache hits. A cache hit occurs every
101:             * time the get method is called and the cache contains the requested
102:             * object.<p>
103:             *
104:             * Keeping track of cache hits and misses lets one measure how efficient
105:             * the cache is; the higher the percentage of hits, the more efficient.
106:             *
107:             * @return the number of cache hits.
108:             */
109:            long getCacheHits();
110:
111:            /**
112:             * Returns the number of cache misses. A cache miss occurs every
113:             * time the get method is called and the cache does not contain the
114:             * requested object.<p>
115:             *
116:             * Keeping track of cache hits and misses lets one measure how efficient
117:             * the cache is; the higher the percentage of hits, the more efficient.
118:             *
119:             * @return the number of cache hits.
120:             */
121:            long getCacheMisses();
122:
123:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.