Java Doc for CacheGeneration.java in  » Web-Server » Jigsaw » org » w3c » www » protocol » http » 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 » Web Server » Jigsaw » org.w3c.www.protocol.http.cache 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.w3c.www.protocol.http.cache.CacheGeneration

CacheGeneration
public class CacheGeneration implements LRUAble(Code)


Field Summary
protected  FilegenerationFile
    
protected  LRUAblenext
     LRU management - next entry.
protected  LRUAbleprev
     LRU management - previous entry.

Constructor Summary
public  CacheGeneration(CacheStore store, long maxsize)
    

Method Summary
public synchronized  booleanaddResource(CachedResource cr, long size, long oldsize)
     Adds this resource, if possible cr, the candidate.
public  voidclean()
     Clean this generation.
public  longcollectSpace(long size, boolean check)
     will garbage collect up to "size" bytes in this generation.
public synchronized  booleancontainsResource(String url)
    
protected synchronized  voidcopyInto(CacheGeneration gen)
    
protected  voiddeleteGenerationFile()
    
public  longdeleteStored(CachedResource cr)
    
protected  longemptyGeneration()
    
public  longgetByteLimit()
    
public  intgetCRCount()
     Get the current number of resource loaded.
public  longgetCachedByteCount()
    
public  EnumerationgetCachedResources()
    
public  EnumerationgetDeletedResources()
    
public synchronized  EnumerationgetFiles()
    
public  floatgetFillRatio()
    
public  FilegetGenerationFile()
    
public  intgetId()
    
public  LRUAblegetNext()
     LRU management - Get next node.
public  LRUAblegetPrev()
     LRU management - Get previous node.
public  longgetStoredByteCount()
    
public  booleanisLoaded()
    
public  booleanisSaved()
    
protected  voidloadCachedResource(CachedResource cr)
     Load a CachedResource in this generation.
public synchronized  CachedResourcelookupResource(String url)
     Get the CachedResource relative to the given URL.
public synchronized  longremoveResource(CachedResource cr)
     Remove the resource from the generation (but don't delete it).
Parameters:
  cr - the CachedResource to remove.
public synchronized  longremoveResource(String url)
     Remove the resource from the generation (but don't delete it).
Parameters:
  cr - the CachedResource to remove.
public synchronized  voidsetByteLimit(long newlimit)
     Set the new bytecount limit, not that it may perform a cleanup if necessary.
protected  voidsetDescription(LookupTable tables)
    
public  voidsetGenerationFile(File generationFile)
    
public synchronized  voidsetId(int id)
    
protected  voidsetLoaded(boolean loaded)
    
public synchronized  voidsetNext(LRUAble next)
     LRU management - Set next node.
public synchronized  voidsetPrev(LRUAble prev)
     LRU management - Set previous node.
protected  voidsetSaved(boolean saved)
     Set the generation as saved or not.
public  voidunload()
     Unload the generation, transform CachedResources to descriptions.

Field Detail
generationFile
protected File generationFile(Code)



next
protected LRUAble next(Code)
LRU management - next entry.



prev
protected LRUAble prev(Code)
LRU management - previous entry.




Constructor Detail
CacheGeneration
public CacheGeneration(CacheStore store, long maxsize)(Code)




Method Detail
addResource
public synchronized boolean addResource(CachedResource cr, long size, long oldsize)(Code)
Adds this resource, if possible cr, the candidate. size, the size of the candidate. a boolean, true if this resource has been cached



clean
public void clean()(Code)
Clean this generation.



collectSpace
public long collectSpace(long size, boolean check)(Code)
will garbage collect up to "size" bytes in this generation. WARNING: this is not synchronized, use with caution! long the number of bytes to be collected check, a boolean, used to validate or not the resource beforedeleting them (ie: delete only invalid resources) a long, the number of bytes savedfrom disk afterward using delete.



containsResource
public synchronized boolean containsResource(String url)(Code)
Check if a resource has been cached in this generation
Parameters:
  url - the resource url a boolean



copyInto
protected synchronized void copyInto(CacheGeneration gen)(Code)
copy the content of the generation here



deleteGenerationFile
protected void deleteGenerationFile()(Code)
delete the serialized resource file from the disk



deleteStored
public long deleteStored(CachedResource cr)(Code)
Deletes a resource from the "to be deleted" vector it updates also the number of bye stored in this generation the number of bytes saved.



emptyGeneration
protected long emptyGeneration()(Code)
empty this generation a long, the number of bytes saved



getByteLimit
public long getByteLimit()(Code)
Get the bytecount limit for this generation a long, the maximum number of bytes



getCRCount
public int getCRCount()(Code)
Get the current number of resource loaded. an long



getCachedByteCount
public long getCachedByteCount()(Code)
Give the acual occupation level of this generation a long, the number of bytes of this generation



getCachedResources
public Enumeration getCachedResources()(Code)
Get the CachedResource of this generation (except the "to be deleted" resources) an Enumeration of CachedResource



getDeletedResources
public Enumeration getDeletedResources()(Code)
get the deleted but still stored resource



getFiles
public synchronized Enumeration getFiles()(Code)
Get all the files handled by this generation an enumeration of File



getFillRatio
public float getFillRatio()(Code)
Give the fill ratio for the cached resources a float between 0 and 1



getGenerationFile
public File getGenerationFile()(Code)
get the generation file a File



getId
public int getId()(Code)
Get the ID of this generation an int, the generation number



getNext
public LRUAble getNext()(Code)
LRU management - Get next node. A CacheGeneration instance.



getPrev
public LRUAble getPrev()(Code)
LRU management - Get previous node. A CacheGeneration instance.



getStoredByteCount
public long getStoredByteCount()(Code)
Give the acual storeage occupation level of this generation a long, the number of bytes of this generation



isLoaded
public boolean isLoaded()(Code)
Is the generation loaded? a boolean



isSaved
public boolean isSaved()(Code)
Is the generation saved? a boolean



loadCachedResource
protected void loadCachedResource(CachedResource cr)(Code)
Load a CachedResource in this generation. (to be used only at generation loading). This method load only valid cachedresource. Check if the associated file exists and has the right size.
Parameters:
  CachedResource - the CachedResource to load.



lookupResource
public synchronized CachedResource lookupResource(String url)(Code)
Get the CachedResource relative to the given URL.
Parameters:
  url - the URL of the CachedResource to find a CachedResource or null.



removeResource
public synchronized long removeResource(CachedResource cr) throws NoSuchResourceException(Code)
Remove the resource from the generation (but don't delete it).
Parameters:
  cr - the CachedResource to remove. the number of byte saved
exception:
  NoSuchResourceException - if this resource was not in this generation



removeResource
public synchronized long removeResource(String url) throws NoSuchResourceException(Code)
Remove the resource from the generation (but don't delete it).
Parameters:
  cr - the CachedResource to remove. the number of byte saved
exception:
  NoSuchResourceException - if this resource was not in this generation



setByteLimit
public synchronized void setByteLimit(long newlimit)(Code)
Set the new bytecount limit, not that it may perform a cleanup if necessary. long, the new maximum number of bytes



setDescription
protected void setDescription(LookupTable tables)(Code)
Set this Generation as a description (update the saved and loaded status)
Parameters:
  tables - the LookupTables containing attribute descriptions



setGenerationFile
public void setGenerationFile(File generationFile)(Code)
set the file where the generation is stored
Parameters:
  generationFile - the file



setId
public synchronized void setId(int id)(Code)
Set the ID of this generation Useful to reuse generation
Parameters:
  an - integer, the new generation number



setLoaded
protected void setLoaded(boolean loaded)(Code)
Set the generation as loaded or unloaded
Parameters:
  loaded - the new loaded flag



setNext
public synchronized void setNext(LRUAble next)(Code)
LRU management - Set next node.



setPrev
public synchronized void setPrev(LRUAble prev)(Code)
LRU management - Set previous node.



setSaved
protected void setSaved(boolean saved)(Code)
Set the generation as saved or not.
Parameters:
  saved - a boolean



unload
public void unload()(Code)
Unload the generation, transform CachedResources to descriptions.



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.