Java Doc for CachedItem.java in  » Database-DBMS » db-derby-10.2 » org » apache » derby » impl » services » 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 » Database DBMS » db derby 10.2 » org.apache.derby.impl.services.cache 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.derby.impl.services.cache.CachedItem

CachedItem
final public class CachedItem (Code)
A generic class to represent the cache related infomation of a cached object (Cacheable).

 The relationship between isValid and settingIdentity can be explain by the
 following life cycle of a cached item.
 Stage		   1	2	3
 ----------------------
 isValid	        F	T	T	
 settingIdentity	X	T	F
 In Stage 1, the CachedItem is created but it is invalid and has an entry
 that is just a holder object with no identity.
 In Stage 2, the identity has been set and the item is being created or
 being faulted into the cache.
 In Stage 3, the item found in the CachedItem entry
 

Remove is set if this item is being removed out of existance, not just being evicted from the cache. When the last referece to it release it from the cache, it will be removed.
RecentlyUsed is set whenever this item is accessed (via a keep() call). It is reset by the clockHand as it sweeps around the cache looking for victims to evict.

MT - must be MT-safe and work with cache manager. Every method that access (set or get) instance variables is synchronized on the cached item object. The following method waits so it should not be called by the cache manager inside a sync block: clean(), waitFor(), create(), remove(). (RESOLVE: need to move these from the cache manager to here)
See Also:   org.apache.derby.impl.services.cache
See Also:   Cacheable




Constructor Summary
public  CachedItem()
     Create a CachedItem in the not valid state.

Method Summary
public  voidclean(boolean forRemove)
    
public  CacheablegetEntry()
     Get the cached object.
final public  booleanisKept()
    
final public synchronized  booleanisValid()
     Does the cached object have a valid identity.
public  voidkeepAfterSearch()
     Keep the cached object after a search.
public  voidkeepForClean()
    
public  voidkeepForCreate()
    
public synchronized  voidnotifyRemover()
    
public synchronized  booleanrecentlyUsed()
    
public  voidremove(boolean removeNow)
    
public synchronized  voidsetRemoveState()
     Set the state of the to-be removed flag.
public synchronized  voidsetUsed(boolean flag)
     The clock hand has swept past this entry.
public synchronized  voidsetValidState(boolean flag)
     Set the valid state of the cached object.
public synchronized  voidsettingIdentityComplete()
    
public  CacheabletakeOnIdentity(CacheManager cm, CacheableFactory holderFactory, Object key, boolean forCreate, Object createParameter)
     Make entry (the Cacheable) take on a new identity.
public synchronized  booleanunkeep()
     Unkeep the cached object.

MT - not synchronized, only modified single threaded by the cache manager if the object is still kept after this call.

public  voidunkeepForCreate()
    
public synchronized  Cacheableuse()
     Allow use of the cacheable entry.


Constructor Detail
CachedItem
public CachedItem()(Code)
Create a CachedItem in the not valid state.




Method Detail
clean
public void clean(boolean forRemove) throws StandardException(Code)
Clean the cached object

MT -
The wait will not release the lock on the cache manager, so the cache manager should not waitfor clean inside a sync block or the whole cache will freeze
Parameters:
  forRemove - if true, get rid of the backend persistent store object
exception:
  StandardException - error thrown while writing cacheableobject to disk




getEntry
public Cacheable getEntry()(Code)
Get the cached object.



isKept
final public boolean isKept()(Code)
Is the cached object kept?

MT - not synchronized, only accessed single threaded by the cache manager




isValid
final public synchronized boolean isValid()(Code)
Does the cached object have a valid identity.



keepAfterSearch
public void keepAfterSearch()(Code)
Keep the cached object after a search.



keepForClean
public void keepForClean()(Code)



keepForCreate
public void keepForCreate()(Code)



notifyRemover
public synchronized void notifyRemover()(Code)



recentlyUsed
public synchronized boolean recentlyUsed()(Code)
Has the cached object been referenced (kept) since the last sweep of the clock hand?



remove
public void remove(boolean removeNow) throws StandardException(Code)



setRemoveState
public synchronized void setRemoveState()(Code)
Set the state of the to-be removed flag.



setUsed
public synchronized void setUsed(boolean flag)(Code)
The clock hand has swept past this entry.



setValidState
public synchronized void setValidState(boolean flag)(Code)
Set the valid state of the cached object.



settingIdentityComplete
public synchronized void settingIdentityComplete()(Code)



takeOnIdentity
public Cacheable takeOnIdentity(CacheManager cm, CacheableFactory holderFactory, Object key, boolean forCreate, Object createParameter) throws StandardException(Code)
Make entry (the Cacheable) take on a new identity.



unkeep
public synchronized boolean unkeep()(Code)
Unkeep the cached object.

MT - not synchronized, only modified single threaded by the cache manager if the object is still kept after this call.




unkeepForCreate
public void unkeepForCreate()(Code)



use
public synchronized Cacheable use() throws StandardException(Code)
Allow use of the cacheable entry.



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.