Java Doc for CacheSystem.java in  » J2EE » Expresso » com » jcorporate » expresso » core » 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 » J2EE » Expresso » com.jcorporate.expresso.core.cache 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.jcorporate.expresso.core.cache.CacheSystem

All known Subclasses:   com.jcorporate.expresso.core.cache.DefaultCacheManager,
CacheSystem
public interface CacheSystem (Code)
This is an interface for an underlying cache system. It allows clients of the itnerface to add items, retrieve items, and clear caches.

The CacheSystem is not data context aware. Classes that implement this interface are expected to be one instance per context. The Component System provides differentiation between caches.


author:
   Michael Rimov
since:
   Expresso 5.1




Method Summary
 voidaddItem(String cacheName, Cacheable newItem)
    
 voidaddItem(String cacheName, Cacheable newItem, long expiry)
    
 voidaddListener(String listener, String listenTo)
     Specify a relationship between caches.
 voidadjustForMemory()
     Instructs the cache system to adjust it's usage profile based upon current memory information that the expresso system is telling us.
 voidclear(String cacheName)
     Clear's the named cache.
 voidclear()
    
 voidclearNoNotify()
    
 voidclearNoNotify(String cacheName)
     Clear the named cache, but don't send the remote system notifications.
 CachecreateCache(String cacheName, boolean ordered)
     Creates a cache as specified by the parameters listed.
 CachecreateCache(String cacheName, boolean ordered, int maxSize)
     Creates a cache defined by whether the cache is to be ordered, it's name and it's maximum size.
 voiddisplayStatus()
     Displays the cache status.
 booleanexistsCache(String cacheName)
     Checks to see if the cache already exists.
 java.util.SetgetAllCacheNames()
    
 CachegetCache(String cacheName)
     Retrieve a given cache by name.
Parameters:
  cacheName - the name of the cache to retrieve.
 CacheablegetItem(String cacheName, String valueKey)
    
 intgetItemCount(String cacheName)
     Return a count of the number of items in a cache.
 java.util.ListgetItems(String cacheName)
     Return all of the items in a cache.
 voidput(String cacheName, Cacheable newItem)
     Adds a Cacheable item into the cache without clearing related caches.
 voidput(String cacheName, Cacheable newItem, long expiry)
     Adds a Cacheable item into the cache without clearing related caches.
 voidremoveItem(String cacheName, Cacheable itemToRemove)
    
 voidremoveItemNoNotify(String cacheName, Cacheable itemToRemove)
    
 voidsetItems(String cacheName, java.util.List itemList)
     Sets a cache to have the particular items specified in itemList.
 voidsetItems(String cacheName, java.util.List itemList, long expiration)
     Sets a cache to have the particular items specified in itemList.



Method Detail
addItem
void addItem(String cacheName, Cacheable newItem) throws CacheException(Code)
Adds a Cacheable item into the cache
Parameters:
  cacheName - The name of the cache.
Parameters:
  newItem - The new item to add to the cache
throws:
  CacheException - upon error inserting into the system



addItem
void addItem(String cacheName, Cacheable newItem, long expiry) throws CacheException(Code)
Adds an item to the cache named by parameter cacheName
Parameters:
  cacheName - The name of the cache to store the object in
Parameters:
  newItem - The new item to add to the cache
Parameters:
  expiry - The time in miliseconds that this cache item will expire
throws:
  CacheException - if there's an error inserting the item into thecache



addListener
void addListener(String listener, String listenTo)(Code)
Specify a relationship between caches. Whenever an add, clear or remove event is sent to the specified cache, the listener is cleared as well. Adding a listener implies the relationship between the caches for the current db context.
Parameters:
  listener - The classname of the listener
Parameters:
  listenTo - The name of the cache to listen to.



adjustForMemory
void adjustForMemory()(Code)
Instructs the cache system to adjust it's usage profile based upon current memory information that the expresso system is telling us.



clear
void clear(String cacheName) throws CacheException(Code)
Clear's the named cache.
Parameters:
  cacheName - The name of the cache to clear
throws:
  CacheException - if there's an error clearing the cache.



clear
void clear() throws CacheException(Code)
Removes all cache items for a particular data context
throws:
  CacheException - CacheException if there's an error clearing thecache



clearNoNotify
void clearNoNotify()(Code)
Clears all caches in this db context but doesn't notify any listeners



clearNoNotify
void clearNoNotify(String cacheName)(Code)
Clear the named cache, but don't send the remote system notifications. This method actually removes the cache from the list of available caches
Parameters:
  cacheName - The name of the cache



createCache
Cache createCache(String cacheName, boolean ordered) throws CacheException(Code)
Creates a cache as specified by the parameters listed. Creation date: (9/7/00 2:18:09 PM)
Parameters:
  cacheName - java.lang.String the name of the cache
Parameters:
  ordered - boolean true if you want an ordered cache such as forValidValues the newly instantiated Cache



createCache
Cache createCache(String cacheName, boolean ordered, int maxSize) throws CacheException(Code)
Creates a cache defined by whether the cache is to be ordered, it's name and it's maximum size. Creation date: (9/7/00 2:18:09 PM)
Parameters:
  cacheName - java.lang.String The name of the cache
Parameters:
  ordered - boolean True if you wish for an ordered cache.
Parameters:
  maxSize - The maximum size of the cache the newly instantiated cache



displayStatus
void displayStatus()(Code)
Displays the cache status. Currently this is only really used for debugging purposes. Creation date: (9/7/00 2:44:05 PM)



existsCache
boolean existsCache(String cacheName)(Code)
Checks to see if the cache already exists. One big note about this is that unless you already have a ReadLock, the cache may or may not exist once you go to put your data in the cache. Buyer beware.
Parameters:
  cacheName - The name of the cache true if the named cache already exists in this data context



getAllCacheNames
java.util.Set getAllCacheNames()(Code)
Return an iterator over a list of Strings that contain all the names of the caches stored in the system [For dbContext default] java.util.Iterator



getCache
Cache getCache(String cacheName)(Code)
Retrieve a given cache by name.
Parameters:
  cacheName - the name of the cache to retrieve. a Cache instance or null if the Cache does not exist.
See Also:   com.jcorporate.expresso.core.cache.Cache



getItem
Cacheable getItem(String cacheName, String valueKey)(Code)
Get a particular item in the cache
Parameters:
  cacheName - The name of the cache
Parameters:
  valueKey - The particular item within the cache to get a Cacheable object or null if it doesn't exist in the cache



getItemCount
int getItemCount(String cacheName)(Code)
Return a count of the number of items in a cache. Return 0 if there is no such item
Parameters:
  cacheName - The name of the cache an item count or zero if the cache doesn't exist or is empty;



getItems
java.util.List getItems(String cacheName)(Code)
Return all of the items in a cache. If the cache was created as an ordered cache, the items will be in the order they were added. If not, they will be in no particular order. If there is no such cache or no items, null will be returned.
Parameters:
  cacheName - The name of the cache to retrieve java.util.List of Cacheable items



put
void put(String cacheName, Cacheable newItem) throws CacheException(Code)
Adds a Cacheable item into the cache without clearing related caches. This is to differentiate between 'changed' items that are added to the cache via addItem that would require related caches to be cleared to maintain data integrity. An example of when this is used is when DBObject.retrieve() is first called, there is no "referential integrity" issues because the object is fresh and unmodified.
Parameters:
  cacheName - the name of the cache to add to
Parameters:
  newItem - the item to add
throws:
  CacheException - upon error putting the item into the cache



put
void put(String cacheName, Cacheable newItem, long expiry) throws CacheException(Code)
Adds a Cacheable item into the cache without clearing related caches. This is to differentiate between 'changed' items that are added to the cache via addItem that would require related caches to be cleared to maintain data integrity. An example of when this is used is when DBObject.retrieve() is first called, there is no "referential integrity" issues because the object is fresh and unmodified.
Parameters:
  cacheName - the name of the cache to add to
Parameters:
  newItem - the item to add
Parameters:
  expiry - The time in miliseconds that this cache item will expire
throws:
  CacheException - upon error putting the item into the cache



removeItem
void removeItem(String cacheName, Cacheable itemToRemove) throws CacheException(Code)
Removes an item from the cache
Parameters:
  cacheName - The name of the cache
Parameters:
  itemToRemove - the key of the item to remove



removeItemNoNotify
void removeItemNoNotify(String cacheName, Cacheable itemToRemove) throws CacheException(Code)
Removes an item out of the cache without notifying the cache listeners
Parameters:
  cacheName - The cache name
Parameters:
  itemToRemove - the key in the cache that has been modified
throws:
  CacheException - Upon error removing the item from the cache



setItems
void setItems(String cacheName, java.util.List itemList) throws CacheException(Code)
Sets a cache to have the particular items specified in itemList.
Parameters:
  cacheName - The name of the cache
Parameters:
  itemList - The items to set into the cache
throws:
  CacheException - if there's an error setting the items.



setItems
void setItems(String cacheName, java.util.List itemList, long expiration) throws CacheException(Code)
Sets a cache to have the particular items specified in itemList.
Parameters:
  cacheName - The name of the cache
Parameters:
  itemList - The items to set into the cache
Parameters:
  expiration - the expiration time in milliseconds for the items.
throws:
  CacheException - if there's an error setting the items.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.