Java Doc for DefaultCacheManager.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) 


java.lang.Object
   com.jcorporate.expresso.kernel.ComponentBase
      com.jcorporate.expresso.core.cache.DefaultCacheManager

DefaultCacheManager
public class DefaultCacheManager extends com.jcorporate.expresso.kernel.ComponentBase implements ComponentLifecycle,CacheSystem(Code)
[Currently a placeholder. Will be expanded out soon]
author:
   Michael Rimov



Constructor Summary
public  DefaultCacheManager()
    

Method Summary
public  voidaddItem(String cacheName, Cacheable newItem)
    
public  voidaddItem(String cacheName, Cacheable newItem, long expiry)
    
public  voidaddListener(String listener, String listenTo)
     Specify a relationship between caches.
public  voidadjustForMemory()
     Instructs the cache system to adjust it's usage profile based upon current memory information that the expresso system is telling us.
public  voidcheckMemory()
    

Checks to make sure that there is enough memory available to use for more caches.

public  voidclear(String cacheName)
     Clear's the named cache.
public  voidclear()
    
public  booleanclearLowestCache()
    
public  voidclearNoNotify()
    
public  voidclearNoNotify(String cacheName)
     Clear the named cache, but don't send the remote system notifications.
public  voidconfigure(Configuration newConfig)
    
public  CachecreateCache(String cacheName, boolean ordered, int maxSize)
     Creates a cache as specified by the parameters listed.
public  CachecreateCache(String cacheName, boolean ordered)
     Creates a cache defined by whether the cache is to be ordered, it's name and it's maximum size.
public  voiddestroy()
    
public  voiddisplayStatus()
     Displays the cache status.
public  booleanexistsCache(String cacheName)
     Checks to see if the cache already exists.
public  java.util.SetgetAllCacheNames()
    
public  CachegetCache(String cacheName)
     Retrieve a given cache by name.
Parameters:
  cacheName - the name of the cache to retrieve.
public  CacheablegetItem(String cacheName, String valueKey)
    
public  intgetItemCount(String cacheName)
     Return a count of the number of items in a cache.
public  java.util.ListgetItems(String cacheName)
     Return all of the items in a cache.
public  voidinitialize()
    
public  voidput(String cacheName, Cacheable newItem)
     Adds a Cacheable item into the cache without clearing related caches.
public  voidput(String cacheName, Cacheable newItem, long expiry)
     Adds a Cacheable item into the cache without clearing related caches.
public  voidreconfigure(Configuration newConfig)
    
public  voidremoveItem(String cacheName, Cacheable itemToRemove)
    
public  voidremoveItemNoNotify(String cacheName, Cacheable itemToRemove)
    
public  voidsetItems(String cacheName, java.util.List itemList)
     Sets a cache to have the particular items specified in itemList.
public  voidsetItems(String cacheName, java.util.List itemList, long expiration)
     Sets a cache to have the particular items specified in itemList.


Constructor Detail
DefaultCacheManager
public DefaultCacheManager()(Code)




Method Detail
addItem
public 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
public 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
public 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
public 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.



checkMemory
public void checkMemory()(Code)

Checks to make sure that there is enough memory available to use for more caches. If it there isn't enough free memory, then it attempts to clear out the least used cache.

Creation date: (9/7/00 2:44:05 PM)




clear
public 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
public void clear() throws CacheException(Code)
Removes all cache items for a particular data context
throws:
  CacheException - CacheException if there's an error clearing thecache



clearLowestCache
public boolean clearLowestCache()(Code)
Removed the least used Cache true if something was able to be removed; false otherwise



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



clearNoNotify
public 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



configure
public void configure(Configuration newConfig) throws ConfigurationException(Code)



createCache
public Cache createCache(String cacheName, boolean ordered, int maxSize) 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
Parameters:
  maxSize - the maximum size of the cache (zero if boundless) the newly instantiated Cache



createCache
public Cache createCache(String cacheName, boolean ordered) 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. the newly instantiated cache



destroy
public void destroy()(Code)



displayStatus
public 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
public 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
public 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
public 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
public 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
public 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
public 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



initialize
public void initialize()(Code)



put
public 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.
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
public 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.
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



reconfigure
public void reconfigure(Configuration newConfig) throws ConfigurationException(Code)



removeItem
public 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
public 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
public 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
public 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.



Methods inherited from com.jcorporate.expresso.kernel.ComponentBase
public synchronized ComponentMetadata getMetaData()(Code)(Java Doc)
public synchronized URL getMetadataLocation()(Code)(Java Doc)
public synchronized Containable getParent()(Code)(Java Doc)
public synchronized void setMetaData(ComponentMetadata metadata)(Code)(Java Doc)
public synchronized void setParent(Containable parent)(Code)(Java Doc)

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 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.