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

All known Subclasses:   org.w3c.www.protocol.http.cache.push.PushCacheFilter,
CacheFilter
public class CacheFilter implements PropRequestFilter,PropertyMonitoring(Code)


Field Summary
final public static  StringCACHE_CONNECTED_P
    
final public static  StringCACHE_SIZE_P
     The name of the properties indicating the size of the cache (in bytes). This property will give the value of the disk-based cache size.
final public static  StringDEBUG_P
     Name of the property indicating if the cache is in debug mode.
final public static  StringSERIALIZER_P
    
final public static  StringSHARED_P
     Name of the property indicating if this cache is shared.
final public static  StringSTATE_NOCACHE
     The state used to disable that filter per request.
final public static  StringSTATE_ORIGREQ
    
final public static  StringSTATE_REVALIDATION
     Name of the request state that marks a request as being a revalidation.
final public static  StringSTATE_WARNINGS
     Name of the request state used to collect warnings.
final public static  StringSWEEPER_P
    
final public static  StringVALIDATOR_P
    
protected static  HttpWarningWARN_DISCONNECTED
     The HTTP warning used to notify of a disconnected cache.
protected static  HttpWarningWARN_HEURISTIC
     The HTTP warning used to indicate a heuristic expiration time.
protected static  HttpWarningWARN_STALE
    
protected  booleanconnected
    
protected  booleandebug
    
protected  Filedirectory
    
protected  Hashtableprecache
    
protected  ObservablePropertiesprops
     The properties we initialized ourself from.
protected  CacheSerializerserializer
    
protected  booleanshared
    
protected  longsize
    
protected  CacheStorestore
    
protected  CacheSweepersweeper
    
protected  Hashtableuritable
    
protected  CacheValidatorvalidator
    


Method Summary
protected  voidaddWarning(Request request, HttpWarning warning)
     Add a warning, to be emitted at reply time.
public  booleancanCache(Request req, Reply rep)
    
public  booleancanStore(Request req, Reply rep)
     Checks if, according to the headers of a reply we can store the resource.
public  booleancanUseCache(Request req)
     check if we can use the cache or not for this request It marks the request as being not cachable if false.
protected synchronized  voidcleanUpload(CachedResource cr)
    
public  booleanexceptionFilter(Request request, HttpException ex)
     This filter handle exceptions.
Parameters:
  request - The request that triggered the exception.
Parameters:
  ex - The triggered exception.
public  CacheSerializergetSerializer()
    
public  CacheStoregetStore()
    
public  CacheSweepergetSweeper()
    
public  CacheValidatorgetValidator()
    
public  ReplyingoingFilter(Request request)
     The request pre-processing hook. Before each request is launched, all filters will be called back through this method.
public  voidinitialize(HttpManager manager)
    
public  booleanisConnected()
    
public  booleanisShared()
    
public  ReplyoutgoingFilter(Request request, Reply reply)
     The request post-processing hook.
public  booleanpropertyChanged(String name)
     Property monitoring for the CacheFilter. The CacheFilter allows you to dynamically (typically through the property setter) change the class of the sweeper, the validator, the size...
Parameters:
  name - The name of the property that has changed.
public  voidpushDocument(Request request, Reply reply)
     Push a document in the cache. The caller has to forge a a request and a reply before being able to make something enter the cache.
protected  RequestsetRequestRevalidation(CachedResource res, Request req)
    
final protected  voidsetWarnings(Request request, Reply reply)
     Copy all warnings colllected into the given reply.
public  voidsync()
    
final protected  voidtrace(Request request, String msg)
    

Field Detail
CACHE_CONNECTED_P
final public static String CACHE_CONNECTED_P(Code)
Name of the property enabling the connected/disconnected mode



CACHE_SIZE_P
final public static String CACHE_SIZE_P(Code)
The name of the properties indicating the size of the cache (in bytes). This property will give the value of the disk-based cache size. This value only takes into account the size of the entities saved, not the size of the associated headers, and not the physical size on the disc.

This property defaults to 5000000 bytes.




DEBUG_P
final public static String DEBUG_P(Code)
Name of the property indicating if the cache is in debug mode.

This property defaults to false.




SERIALIZER_P
final public static String SERIALIZER_P(Code)



SHARED_P
final public static String SHARED_P(Code)
Name of the property indicating if this cache is shared.

This property defaults to true.




STATE_NOCACHE
final public static String STATE_NOCACHE(Code)
The state used to disable that filter per request. Also set by the cache if the request cannot be fullfilled by caches, as detected by this filter.



STATE_ORIGREQ
final public static String STATE_ORIGREQ(Code)
Name of the request state used tokeep track of original request



STATE_REVALIDATION
final public static String STATE_REVALIDATION(Code)
Name of the request state that marks a request as being a revalidation.



STATE_WARNINGS
final public static String STATE_WARNINGS(Code)
Name of the request state used to collect warnings.



SWEEPER_P
final public static String SWEEPER_P(Code)



VALIDATOR_P
final public static String VALIDATOR_P(Code)



WARN_DISCONNECTED
protected static HttpWarning WARN_DISCONNECTED(Code)
The HTTP warning used to notify of a disconnected cache.



WARN_HEURISTIC
protected static HttpWarning WARN_HEURISTIC(Code)
The HTTP warning used to indicate a heuristic expiration time.



WARN_STALE
protected static HttpWarning WARN_STALE(Code)
The HTTP warning used to mark invalid entries



connected
protected boolean connected(Code)



debug
protected boolean debug(Code)



directory
protected File directory(Code)



precache
protected Hashtable precache(Code)



props
protected ObservableProperties props(Code)
The properties we initialized ourself from.



serializer
protected CacheSerializer serializer(Code)



shared
protected boolean shared(Code)



size
protected long size(Code)



store
protected CacheStore store(Code)



sweeper
protected CacheSweeper sweeper(Code)



uritable
protected Hashtable uritable(Code)



validator
protected CacheValidator validator(Code)





Method Detail
addWarning
protected void addWarning(Request request, HttpWarning warning)(Code)
Add a warning, to be emitted at reply time. The cache filter keeps track, through a specific piece of request state of the warnings to be emitted at reply time (if any).

During request processing, cached resources can add any kind of warnings, which will be collected and forwarded back to the reply.
Parameters:
  request - The request being process, and whose reply requiressome warnings.
Parameters:
  warning - The warning to be emitted if ever we use the cachefilter to answer the above request.




canCache
public boolean canCache(Request req, Reply rep)(Code)
Checks if, according to the headers of the reply, an entity may be cached or not, it decorates also the reply
Parameters:
  a - request, the client side request
Parameters:
  a - reply, the client side reply a boolean, true if the resource can be cached



canStore
public boolean canStore(Request req, Reply rep)(Code)
Checks if, according to the headers of a reply we can store the resource. Note that a resource may be cachable, but not storable (memory cache) although is MUST do its best to get rid of it asap, in our case we just don't store it!
Parameters:
  a - request, the client side request
Parameters:
  a - reply, the client side reply a boolean, true if the resource can be stored by the cache



canUseCache
public boolean canUseCache(Request req)(Code)
check if we can use the cache or not for this request It marks the request as being not cachable if false.
Parameters:
  a - request, the incoming client-side request a boolean, true if we can use the cache



cleanUpload
protected synchronized void cleanUpload(CachedResource cr)(Code)
do what is needed when an upload is done! ie: remove from the precache and put in the store
Parameters:
  the - CachedResource to be moved.



exceptionFilter
public boolean exceptionFilter(Request request, HttpException ex)(Code)
This filter handle exceptions.
Parameters:
  request - The request that triggered the exception.
Parameters:
  ex - The triggered exception. Always false.



getSerializer
public CacheSerializer getSerializer()(Code)
return the serializer used by the cache an instance of Serializer



getStore
public CacheStore getStore()(Code)
the store used a CacheStore



getSweeper
public CacheSweeper getSweeper()(Code)
return the cache sweeper used by the cache an instance of CacheSweeper



getValidator
public CacheValidator getValidator()(Code)
return the cache validator used by the cache an instance of CacheValidator



ingoingFilter
public Reply ingoingFilter(Request request) throws HttpException(Code)
The request pre-processing hook. Before each request is launched, all filters will be called back through this method. They will generally set up additional request header fields to enhance the request.
Parameters:
  request - The request that is about to be launched. An instance of Reply if the filter could handle the request,or null if processing should continue normally.
exception:
  HttpException - If the filter is supposed to fulfill therequest, but some error happened during that processing.



initialize
public void initialize(HttpManager manager) throws PropRequestFilterException(Code)



isConnected
public boolean isConnected()(Code)
is the cache connected? a boolean, true if the cache is connected



isShared
public boolean isShared()(Code)
is the cache shared? a boolean, true if the cache is shared



outgoingFilter
public Reply outgoingFilter(Request request, Reply reply) throws HttpException(Code)
The request post-processing hook. After each request has been replied to by the target server (be it a proxy or the actual origin server), each filter's outgoingFilter method is called.

It gets the original request, and the actual reply as a parameter, and should return whatever reply it wants the caller to get.
Parameters:
  request - The original (handled) request.
Parameters:
  reply - The reply, as emited by the target server, or constructedby some other filter.
exception:
  HttpException - If the reply emitted by the server is nota valid HTTP reply.




propertyChanged
public boolean propertyChanged(String name)(Code)
Property monitoring for the CacheFilter. The CacheFilter allows you to dynamically (typically through the property setter) change the class of the sweeper, the validator, the size...
Parameters:
  name - The name of the property that has changed. A boolean, true if the change was made, false otherwise.



pushDocument
public void pushDocument(Request request, Reply reply)(Code)
Push a document in the cache. The caller has to forge a a request and a reply before being able to make something enter the cache. The request should provide at least:
URL
The URL (key for cache lookups)
Method
The method that was "applied" to URL to get forged reply.

It is recommended that the reply provides at least the following informations:

Status Code
A valid HTTP/1.1 status code (probably 200)
InputStream
Containing the entity to be cached,
EntityTag
A valid entity tag for the document,
CacheControl
Appropriate HTTP/1.1 cache controls for that document,
Mime headers
At least a valid content type, and probably a content length (to check consistency with the reply body).



setRequestRevalidation
protected Request setRequestRevalidation(CachedResource res, Request req)(Code)
Modify a request to ask for a revalidation
Parameters:
  the - resource to be revalidated request, the original request to be modified



setWarnings
final protected void setWarnings(Request request, Reply reply)(Code)
Copy all warnings colllected into the given reply. This method collects all HTTP warnings saved during request processing and create (if needed) the approporiate warning header in the given reply.
Parameters:
  request - The request that has been processed by the cache filter.
Parameters:
  reply - The reply that has been constructed from the cache.
See Also:   CacheFilter.addWarning



sync
public void sync()(Code)



trace
final protected void trace(Request request, String msg)(Code)
Display some output, related to the request (used for debugging)



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.