Java Doc for CmsFlexCacheEntry.java in  » Content-Management-System » opencms » org » opencms » flex » 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 » Content Management System » opencms » org.opencms.flex 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.opencms.flex.CmsFlexCacheEntry

CmsFlexCacheEntry
public class CmsFlexCacheEntry extends Object implements I_CmsLruCacheObject,I_CmsMemoryMonitorable(Code)
Contains the contents of a cached resource.

It is basically a list of pre-generated output, include() calls to other resources (with request parameters) and http headers that this resource requires to be set.

A CmsFlexCacheEntry might also describe a redirect-call, but in this case nothing else will be cached.

The pre-generated output is saved in byte[] arrays. The include() calls are saved as Strings of the included resource name, the parameters for the calls are saved in a HashMap. The headers are saved in a HashMap. In case of a redirect, the redirect target is cached in a String.

The CmsFlexCacheEntry can also have an expire date value, which indicates the time that his entry will become invalid and should thus be cleared from the cache.


author:
   Alexander Kandzior
author:
   Thomas Weckert
version:
   $Revision: 1.34 $
since:
   6.0.0
See Also:   org.opencms.cache.I_CmsLruCacheObject



Field Summary
final public static  intINITIAL_CAPACITY_LISTS
     Initial size for lists.

Constructor Summary
public  CmsFlexCacheEntry()
     Constructor for class CmsFlexCacheEntry.

The way to use this class is to first use this empty constructor and later add data with the various add methods.


Method Summary
public  voidadd(byte[] bytes)
    
public  voidadd(String resource, Map parameters)
    
public  voidaddHeaders(Map headers)
    
public  voidaddToLruCache()
    
public  voidcomplete()
    
public  Listelements()
    
public  longgetDateExpires()
    
public  longgetDateLastModified()
    
public  intgetLruCacheCosts()
    
public  intgetMemorySize()
    
public  I_CmsLruCacheObjectgetNextLruObject()
    
public  I_CmsLruCacheObjectgetPreviousLruObject()
    
public  ObjectgetValue()
    
public  voidremoveFromLruCache()
    
public  voidservice(CmsFlexRequest req, CmsFlexResponse res)
     Processing method for this cached entry.

If this method is called, it delivers the contents of the cached entry to the given request / response.

public  voidsetDateExpires(long dateExpires)
    
public  voidsetDateExpiresToNextTimeout(long timeout)
     Sets an expiration date for this cache entry to the next timeout, which indicates the time this entry becomes invalid.

The timeout parameter represents the minute - interval in which the cache entry is to be cleared.

public  voidsetDateLastModified(long dateLastModified)
    
public  voidsetDateLastModifiedToPreviousTimeout(long timeout)
     Sets the "last modified" date for this Flex cache entry by using the last passed timeout value.

If a cache entry uses the timeout feature, it becomes invalid every time the timeout interval passes.

public  voidsetNextLruObject(I_CmsLruCacheObject theNextEntry)
    
public  voidsetPreviousLruObject(I_CmsLruCacheObject thePreviousEntry)
    
public  voidsetRedirect(String target)
     Set a redirect target for this cache entry.

Important: When a redirect target is set, all saved data is thrown away, and new data will not be saved in the cache entry.

public  voidsetVariationData(String theVariationKey, Map theVariationMap)
    
public  StringtoString()
    

Field Detail
INITIAL_CAPACITY_LISTS
final public static int INITIAL_CAPACITY_LISTS(Code)
Initial size for lists.




Constructor Detail
CmsFlexCacheEntry
public CmsFlexCacheEntry()(Code)
Constructor for class CmsFlexCacheEntry.

The way to use this class is to first use this empty constructor and later add data with the various add methods.





Method Detail
add
public void add(byte[] bytes)(Code)
Adds an array of bytes to this cache entry, this will usually be the result of some kind of output - stream.


Parameters:
  bytes - the output to save in the cache




add
public void add(String resource, Map parameters)(Code)
Add an include - call target resource to this cache entry.


Parameters:
  resource - a name of a resource in the OpenCms VFS
Parameters:
  parameters - a map of parameters specific to this include call




addHeaders
public void addHeaders(Map headers)(Code)
Add a map of headers to this cache entry, which are usually collected in the class CmsFlexResponse first.


Parameters:
  headers - the map of headers to add to the entry




addToLruCache
public void addToLruCache()(Code)

See Also:   org.opencms.cache.I_CmsLruCacheObject.addToLruCache



complete
public void complete()(Code)
Completes this cache entry.

A completed cache entry is made "unmodifiable", so that no further data can be added and existing data can not be changed.

This is to prevent the (unlikely) case that some user-written class tries to make changes to a cache entry.




elements
public List elements()(Code)
Returns the list of data entries of this cache entry.

Data entries are byte arrays representing some kind of output or Strings representing include calls to other resources.

the list of data elements of this cache entry




getDateExpires
public long getDateExpires()(Code)
Returns the expiration date of this cache entry, this is set to the time when the entry becomes invalid.

the expiration date value for this resource




getDateLastModified
public long getDateLastModified()(Code)
Returns the "last modified" date for this Flex cache entry.

the "last modified" date for this Flex cache entry




getLruCacheCosts
public int getLruCacheCosts()(Code)

See Also:   org.opencms.cache.I_CmsLruCacheObject.getLruCacheCosts



getMemorySize
public int getMemorySize()(Code)

See Also:   org.opencms.monitor.I_CmsMemoryMonitorable.getMemorySize



getNextLruObject
public I_CmsLruCacheObject getNextLruObject()(Code)

See Also:   org.opencms.cache.I_CmsLruCacheObject.getNextLruObject



getPreviousLruObject
public I_CmsLruCacheObject getPreviousLruObject()(Code)

See Also:   org.opencms.cache.I_CmsLruCacheObject.getPreviousLruObject



getValue
public Object getValue()(Code)

See Also:   org.opencms.cache.I_CmsLruCacheObject.getValue



removeFromLruCache
public void removeFromLruCache()(Code)

See Also:   org.opencms.cache.I_CmsLruCacheObject.removeFromLruCache



service
public void service(CmsFlexRequest req, CmsFlexResponse res) throws CmsFlexCacheException, ServletException, IOException(Code)
Processing method for this cached entry.

If this method is called, it delivers the contents of the cached entry to the given request / response. This includes calls to all included resources.


Parameters:
  req - the request from the client
Parameters:
  res - the server response
throws:
  CmsFlexCacheException - is thrown when problems writing to the response output-stream occur
throws:
  ServletException - might be thrown from call to RequestDispatcher.include()
throws:
  IOException - might be thrown from call to RequestDispatcher.include() or from Response.sendRedirect()




setDateExpires
public void setDateExpires(long dateExpires)(Code)
Sets the expiration date of this Flex cache entry exactly to the given time.


Parameters:
  dateExpires - the time to expire this cache entry




setDateExpiresToNextTimeout
public void setDateExpiresToNextTimeout(long timeout)(Code)
Sets an expiration date for this cache entry to the next timeout, which indicates the time this entry becomes invalid.

The timeout parameter represents the minute - interval in which the cache entry is to be cleared. The interval always starts at 0.00h. A value of 60 would indicate that this entry will reach it's expiration date at the beginning of the next full hour, a timeout of 20 would indicate that the entry is invalidated at x.00, x.20 and x.40 of every hour etc.


Parameters:
  timeout - the timeout value to be set




setDateLastModified
public void setDateLastModified(long dateLastModified)(Code)
Sets the "last modified" date for this Flex cache entry with the given value.


Parameters:
  dateLastModified - the value to set for the "last modified" date




setDateLastModifiedToPreviousTimeout
public void setDateLastModifiedToPreviousTimeout(long timeout)(Code)
Sets the "last modified" date for this Flex cache entry by using the last passed timeout value.

If a cache entry uses the timeout feature, it becomes invalid every time the timeout interval passes. Thus the "last modified" date is the time the last timeout passed.


Parameters:
  timeout - the timeout value to use to calculate the date last modified




setNextLruObject
public void setNextLruObject(I_CmsLruCacheObject theNextEntry)(Code)

See Also:   org.opencms.cache.I_CmsLruCacheObject.setNextLruObject(org.opencms.cache.I_CmsLruCacheObject)



setPreviousLruObject
public void setPreviousLruObject(I_CmsLruCacheObject thePreviousEntry)(Code)

See Also:   org.opencms.cache.I_CmsLruCacheObject.setPreviousLruObject(org.opencms.cache.I_CmsLruCacheObject)



setRedirect
public void setRedirect(String target)(Code)
Set a redirect target for this cache entry.

Important: When a redirect target is set, all saved data is thrown away, and new data will not be saved in the cache entry. This is so since with a redirect nothing will be displayed in the browser anyway, so there is no point in saving the data.


Parameters:
  target - The redirect target (must be a valid URL).




setVariationData
public void setVariationData(String theVariationKey, Map theVariationMap)(Code)
Stores a backward reference to the map and key where this cache entry is stored.

This is required for the FlexCache.


Parameters:
  theVariationKey - the variation key
Parameters:
  theVariationMap - the variation map




toString
public String toString()(Code)

See Also:   java.lang.Object.toString a basic String representation of this CmsFlexCache 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.