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

CacheEntry
public class CacheEntry implements Serializable(Code)
A CacheEntry instance represents one entry in the cache. It holds the object that is being cached, along with a host of information about that entry such as the cache key, the time it was cached, whether the entry has been flushed or not and the groups it belongs to.
version:
   $Revision: 388 $
author:
   Mike Cannon-Brookes
author:
   Todd Gochenour
author:
   Francois Beauregard


Field Summary
final public static  intINDEFINITE_EXPIRY
     Specifying this as the refresh period for the CacheEntry.needsRefresh(int) method will ensure an entry does not become stale until it is either explicitly flushed or a custom refresh policy causes the entry to expire.

Constructor Summary
public  CacheEntry(String key)
     Construct a new CacheEntry using the key provided.
public  CacheEntry(String key, EntryRefreshPolicy policy)
     Construct a CacheEntry.
Parameters:
  key - The unique key for this CacheEntry.
Parameters:
  policy - Object that implements refresh policy logic.
public  CacheEntry(String key, EntryRefreshPolicy policy, String[] groups)
     Construct a CacheEntry.
Parameters:
  key - The unique key for this CacheEntry.
Parameters:
  policy - The object that implements the refresh policy logic.

Method Summary
public  voidflush()
     Flush the entry from cache.
public  ObjectgetContent()
     Get the cached content from this CacheEntry.
public  longgetCreated()
     Get the date this CacheEntry was created.
public  SetgetGroups()
     Gets the cache groups that this cache entry belongs to.
public  StringgetKey()
    
public  longgetLastUpdate()
     Get the date this CacheEntry was last updated.
public  intgetSize()
     Get the size of the cache entry in bytes (roughly).

Currently this method only handles Strings and ResponseContent objects.

public  booleanisNew()
     Indicates whether this CacheEntry is a freshly created one and has not yet been assigned content or placed in a cache.
public  booleanneedsRefresh(int refreshPeriod)
     Check if this CacheEntry needs to be refreshed.
Parameters:
  refreshPeriod - The period of refresh (in seconds).
public synchronized  voidsetContent(Object value)
     Sets the actual content that is being cached.
public synchronized  voidsetGroups(String[] groups)
     Sets the cache groups for this entry.
public synchronized  voidsetGroups(Collection groups)
    
public  voidsetLastUpdate(long update)
     Set the date this CacheEntry was last updated.

Field Detail
INDEFINITE_EXPIRY
final public static int INDEFINITE_EXPIRY(Code)
Specifying this as the refresh period for the CacheEntry.needsRefresh(int) method will ensure an entry does not become stale until it is either explicitly flushed or a custom refresh policy causes the entry to expire.




Constructor Detail
CacheEntry
public CacheEntry(String key)(Code)
Construct a new CacheEntry using the key provided.
Parameters:
  key - The key of this CacheEntry



CacheEntry
public CacheEntry(String key, EntryRefreshPolicy policy)(Code)
Construct a CacheEntry.
Parameters:
  key - The unique key for this CacheEntry.
Parameters:
  policy - Object that implements refresh policy logic. This parameteris optional.



CacheEntry
public CacheEntry(String key, EntryRefreshPolicy policy, String[] groups)(Code)
Construct a CacheEntry.
Parameters:
  key - The unique key for this CacheEntry.
Parameters:
  policy - The object that implements the refresh policy logic. Thisparameter is optional.
Parameters:
  groups - The groups that this CacheEntry belongs to. Thisparameter is optional.




Method Detail
flush
public void flush()(Code)
Flush the entry from cache. note that flushing the cache doesn't actually remove the cache contents it just tells the CacheEntry that it needs a refresh next time it is asked this is so that the content is still there for a .



getContent
public Object getContent()(Code)
Get the cached content from this CacheEntry. The content of this CacheEntry.



getCreated
public long getCreated()(Code)
Get the date this CacheEntry was created. The date this CacheEntry was created.



getGroups
public Set getGroups()(Code)
Gets the cache groups that this cache entry belongs to. These returned groups should be treated as immuatable. A set containing the names of all the groups thatthis cache entry belongs to.



getKey
public String getKey()(Code)
Get the key of this CacheEntry The key of this CacheEntry



getLastUpdate
public long getLastUpdate()(Code)
Get the date this CacheEntry was last updated. The date this CacheEntry was last updated.



getSize
public int getSize()(Code)
Get the size of the cache entry in bytes (roughly).

Currently this method only handles Strings and ResponseContent objects. The approximate size of the entry in bytes, or -1 if thesize could not be estimated.




isNew
public boolean isNew()(Code)
Indicates whether this CacheEntry is a freshly created one and has not yet been assigned content or placed in a cache. true if this entry is newly created



needsRefresh
public boolean needsRefresh(int refreshPeriod)(Code)
Check if this CacheEntry needs to be refreshed.
Parameters:
  refreshPeriod - The period of refresh (in seconds). Passing inCacheEntry.INDEFINITE_EXPIRY will result in the content never becomingstale unless it is explicitly flushed, or expired by a customEntryRefreshPolicy. Passing in 0 will always result in arefresh being required. Whether or not this CacheEntry needs refreshing.



setContent
public synchronized void setContent(Object value)(Code)
Sets the actual content that is being cached. Wherever possible this object should be Serializable, however it is not an absolute requirement when using a memory-only cache. Being Serializable allows PersistenceListeners to serialize the cache entries to disk or database.
Parameters:
  value - The content to store in this CacheEntry.



setGroups
public synchronized void setGroups(String[] groups)(Code)
Sets the cache groups for this entry.
Parameters:
  groups - A string array containing all the group names



setGroups
public synchronized void setGroups(Collection groups)(Code)
Sets the cache groups for this entry
Parameters:
  groups - A collection containing all the group names



setLastUpdate
public void setLastUpdate(long update)(Code)
Set the date this CacheEntry was last updated.
Parameters:
  update - The time (in milliseconds) this CacheEntry was last updated.



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.