Java Doc for AbstractCacheAdministrator.java in  » Cache » OSCache » com » opensymphony » oscache » base » 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.base 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.opensymphony.oscache.base.AbstractCacheAdministrator

All known Subclasses:   com.opensymphony.oscache.general.GeneralCacheAdministrator,  com.opensymphony.oscache.web.ServletCacheAdministrator,
AbstractCacheAdministrator
abstract public class AbstractCacheAdministrator implements java.io.Serializable(Code)
An AbstractCacheAdministrator defines an abstract cache administrator, implementing all the basic operations related to the configuration of a cache, including assigning any configured event handlers to cache objects.

Extend this class to implement a custom cache administrator.
version:
   $Revision: 425 $
author:
   a href="mailto:mike@atlassian.com">Mike Cannon-Brookes
author:
   Francois Beauregard
author:
   Alain Bergevin
author:
   Fabian Crabus
author:
   Chris Miller



Field Summary
final public static  StringCACHE_ALGORITHM_KEY
     A String cache configuration property that specifies the classname of an alternate caching algorithm.
final public static  StringCACHE_BLOCKING_KEY
     The configuration key that specifies whether we should block waiting for new content to be generated, or just serve the old content instead.
final public static  StringCACHE_CAPACITY_KEY
     An integer cache configuration property that specifies the maximum number of objects to hold in the cache.
final public static  StringCACHE_DISK_UNLIMITED_KEY
     A boolean cache configuration property that indicates whether the persistent cache should be unlimited in size, or should be restricted to the same size as the in-memory cache.
final public static  StringCACHE_ENTRY_EVENT_LISTENERS_KEY
     A String cache configuration property that holds a comma-delimited list of classnames.
final public static  StringCACHE_MEMORY_KEY
     A boolean cache configuration property that indicates whether the cache should cache objects in memory.
final public static  StringCACHE_PERSISTENCE_OVERFLOW_KEY
     A String cache configuration property that specifies if the cache persistence will only be used in overflow mode, that is, when the memory cache capacity has been reached.
final public static  StringPERSISTENCE_CLASS_KEY
     A String cache configuration property that specifies the classname that will be used to provide cache persistence.
protected  StringalgorithmClass
     The algorithm class being used, as specified by the AbstractCacheAdministrator.CACHE_ALGORITHM_KEY configuration property.
protected  intcacheCapacity
     The cache capacity (number of entries), as specified by the AbstractCacheAdministrator.CACHE_CAPACITY_KEY configuration property.
protected  Configconfig
    
protected  EventListenerListlistenerList
     Holds a list of all the registered event listeners.

Constructor Summary
protected  AbstractCacheAdministrator()
     Create the AbstractCacheAdministrator.
protected  AbstractCacheAdministrator(Properties p)
     Create the AbstractCacheAdministrator.

Method Summary
protected  CacheconfigureStandardListeners(Cache cache)
     Applies all of the recognised listener classes to the supplied cache object.
protected  voidfinalizeListeners(Cache cache)
     Finalizes all the listeners that are associated with the given cache object.
protected  CacheEventListener[]getCacheEventListeners()
     Retrieves an array containing instances all of the CacheEventListener classes that are specified in the OSCache configuration file.
public  StringgetProperty(String key)
     Retrieves the value of one of the configuration properties.
public  booleanisBlocking()
     Indicates whether the cache will block waiting for new content to be built, or serve stale content instead of waiting.
public  booleanisMemoryCaching()
     Whether entries are cached in memory or not.
public  booleanisOverflowPersistence()
    
public  booleanisUnlimitedDiskCache()
     Indicates whether the unlimited disk cache is enabled or not.
public  voidsetAlgorithmClass(String newAlgorithmClass)
     Sets the algorithm to use for the cache.
protected  voidsetCacheCapacity(int newCacheCapacity)
     Sets the cache capacity (number of items).
public  voidsetOverflowPersistence(boolean overflowPersistence)
    
protected  CachesetPersistenceListener(Cache cache)
     If there is a PersistenceListener in the configuration it will be instantiated and applied to the given cache object.

Field Detail
CACHE_ALGORITHM_KEY
final public static String CACHE_ALGORITHM_KEY(Code)
A String cache configuration property that specifies the classname of an alternate caching algorithm. This class must extend com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache By default caches will use com.opensymphony.oscache.base.algorithm.LRUCache as the default algorithm if the cache capacity is set to a postive value, or com.opensymphony.oscache.base.algorithm.UnlimitedCache if the capacity is negative (ie, disabled).



CACHE_BLOCKING_KEY
final public static String CACHE_BLOCKING_KEY(Code)
The configuration key that specifies whether we should block waiting for new content to be generated, or just serve the old content instead. The default behaviour is to serve the old content since that provides the best performance (at the cost of serving slightly stale data).



CACHE_CAPACITY_KEY
final public static String CACHE_CAPACITY_KEY(Code)
An integer cache configuration property that specifies the maximum number of objects to hold in the cache. Setting this to a negative value will disable the capacity functionality - there will be no limit to the number of objects that are held in cache.



CACHE_DISK_UNLIMITED_KEY
final public static String CACHE_DISK_UNLIMITED_KEY(Code)
A boolean cache configuration property that indicates whether the persistent cache should be unlimited in size, or should be restricted to the same size as the in-memory cache. Set this property to true to allow the persistent cache to grow without bound.



CACHE_ENTRY_EVENT_LISTENERS_KEY
final public static String CACHE_ENTRY_EVENT_LISTENERS_KEY(Code)
A String cache configuration property that holds a comma-delimited list of classnames. These classes specify the event handlers that are to be applied to the cache.



CACHE_MEMORY_KEY
final public static String CACHE_MEMORY_KEY(Code)
A boolean cache configuration property that indicates whether the cache should cache objects in memory. Set this property to false to disable in-memory caching.



CACHE_PERSISTENCE_OVERFLOW_KEY
final public static String CACHE_PERSISTENCE_OVERFLOW_KEY(Code)
A String cache configuration property that specifies if the cache persistence will only be used in overflow mode, that is, when the memory cache capacity has been reached.



PERSISTENCE_CLASS_KEY
final public static String PERSISTENCE_CLASS_KEY(Code)
A String cache configuration property that specifies the classname that will be used to provide cache persistence. This class must extend PersistenceListener .



algorithmClass
protected String algorithmClass(Code)
The algorithm class being used, as specified by the AbstractCacheAdministrator.CACHE_ALGORITHM_KEY configuration property.



cacheCapacity
protected int cacheCapacity(Code)
The cache capacity (number of entries), as specified by the AbstractCacheAdministrator.CACHE_CAPACITY_KEY configuration property.



config
protected Config config(Code)



listenerList
protected EventListenerList listenerList(Code)
Holds a list of all the registered event listeners. Event listeners are specified using the AbstractCacheAdministrator.CACHE_ENTRY_EVENT_LISTENERS_KEY configuration key.




Constructor Detail
AbstractCacheAdministrator
protected AbstractCacheAdministrator()(Code)
Create the AbstractCacheAdministrator. This will initialize all values and load the properties from oscache.properties.



AbstractCacheAdministrator
protected AbstractCacheAdministrator(Properties p)(Code)
Create the AbstractCacheAdministrator.
Parameters:
  p - the configuration properties for this cache.




Method Detail
configureStandardListeners
protected Cache configureStandardListeners(Cache cache)(Code)
Applies all of the recognised listener classes to the supplied cache object. Recognised classes are CacheEntryEventListener and CacheMapAccessEventListener .


Parameters:
  cache - The cache to apply the configuration to. cache The configured cache object.




finalizeListeners
protected void finalizeListeners(Cache cache)(Code)
Finalizes all the listeners that are associated with the given cache object. Any FinalizationExceptions that are thrown by the listeners will be caught and logged.



getCacheEventListeners
protected CacheEventListener[] getCacheEventListeners()(Code)
Retrieves an array containing instances all of the CacheEventListener classes that are specified in the OSCache configuration file.



getProperty
public String getProperty(String key)(Code)
Retrieves the value of one of the configuration properties.
Parameters:
  key - The key assigned to the property Property value, or null if the property could not be found.



isBlocking
public boolean isBlocking()(Code)
Indicates whether the cache will block waiting for new content to be built, or serve stale content instead of waiting. Regardless of this setting, the cache will always block if new content is being created, ie, there's no stale content in the cache that can be served.



isMemoryCaching
public boolean isMemoryCaching()(Code)
Whether entries are cached in memory or not. Default is true. Set by the cache.memory property. Status whether or not memory caching is used.



isOverflowPersistence
public boolean isOverflowPersistence()(Code)
Check if we use overflowPersistence Returns the overflowPersistence.



isUnlimitedDiskCache
public boolean isUnlimitedDiskCache()(Code)
Indicates whether the unlimited disk cache is enabled or not.



setAlgorithmClass
public void setAlgorithmClass(String newAlgorithmClass)(Code)
Sets the algorithm to use for the cache.
See Also:   com.opensymphony.oscache.base.algorithm.LRUCache
See Also:   com.opensymphony.oscache.base.algorithm.FIFOCache
See Also:   com.opensymphony.oscache.base.algorithm.UnlimitedCache
Parameters:
  newAlgorithmClass - The class to use (eg."com.opensymphony.oscache.base.algorithm.LRUCache")



setCacheCapacity
protected void setCacheCapacity(int newCacheCapacity)(Code)
Sets the cache capacity (number of items). Administrator implementations should override this method to ensure that their Cache objects are updated correctly (by calling AbstractConcurrentReadCache.setMaxEntries(int) }}.
Parameters:
  newCacheCapacity - The new capacity



setOverflowPersistence
public void setOverflowPersistence(boolean overflowPersistence)(Code)
Sets the overflowPersistence flag
Parameters:
  overflowPersistence - The overflowPersistence to set.



setPersistenceListener
protected Cache setPersistenceListener(Cache cache)(Code)
If there is a PersistenceListener in the configuration it will be instantiated and applied to the given cache object. If the PersistenceListener cannot be found or instantiated, an error will be logged but the cache will not have a persistence listener applied to it and no exception will be thrown.

A cache can only have one PersistenceListener.
Parameters:
  cache - the cache to apply the PersistenceListener to. the same cache object that was passed in.




Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2010 - 2030 Java Source and Support. All rights reserved.
All other trademarks are property of their respective owners.