ERXCachingWrapper Class Reference

Inherits er::extensions::components::ERXStatelessComponent.

Collaboration diagram for ERXCachingWrapper:

Collaboration graph
[legend]

List of all members.

Classes

class  Entry

Public Member Functions

void appendToResponse (WOResponse response, WOContext context)
void awake ()
 ERXCachingWrapper (WOContext context)
NSKeyValueCoding formValues ()
NSKeyValueCoding headers ()
WOActionResults invokeAction (WORequest request, WOContext context)
void takeValuesFromRequest (WORequest request, WOContext context)

Protected Member Functions

long cacheDuration ()
String entryName ()
NSArray keys ()
NSDictionary values ()

Protected Attributes

Long cacheDuration
Entry entry
String entryName
NSArray keys
NSDictionary values

Static Protected Attributes

static Map cache

Static Private Attributes

static final Logger log = Logger.getLogger(ERXCachingWrapper.class)


Detailed Description

Wrapper that caches its content based on a set of bindings. Use this component to wrap parts of your HTML whose generation is costly.
Valid keys would be for example: Basically, you would put there any key whose value would cause the content to change. Session IDs are replaced automatically. Don't use this wrapper if the content contains component actions. Drop only stateless components in this wrapper.

keys the keys to use for caching duration the duration the entry stays in the cache entryName the name to cache on

Author:
ak on 20.01.05 ERExtensions

Constructor & Destructor Documentation

ERXCachingWrapper ( WOContext  context  ) 

Public constructor

Parameters:
context the context


Member Function Documentation

void appendToResponse ( WOResponse  response,
WOContext  context 
)

Calls resetCachedBindingsInStatefulComponent prior to super.appendToResponse.

Parameters:
response to which we are appending
context context of the response

Reimplemented from ERXNonSynchronizingComponent.

void awake (  ) 

long cacheDuration (  )  [protected]

String entryName (  )  [protected]

NSKeyValueCoding formValues (  ) 

Returns the form values as a KVC object.

NSKeyValueCoding headers (  ) 

Returns the request headers as a KVC object.

WOActionResults invokeAction ( WORequest  request,
WOContext  context 
)

Calls resetCachedBindingsInStatefulComponent prior to super.invokeAction.

Parameters:
request for which the action is invoked
context of the request
Returns:
the result of invoking the action

Reimplemented from ERXNonSynchronizingComponent.

NSArray keys (  )  [protected]

void takeValuesFromRequest ( WORequest  request,
WOContext  context 
)

Calls resetCachedBindingsInStatefulComponent prior to super.takeValuesFromRequest.

Parameters:
request from which the values will be taken
context of the request

Reimplemented from ERXNonSynchronizingComponent.

NSDictionary values (  )  [protected]


Member Data Documentation

Map cache [static, protected]

Initial value:

 Collections.synchronizedMap(new HashMap() {
        public Object get(Object key) {
                Entry result = (Entry) super.get(key);
                if(result != null) {
                        if(!result.isActive()) {
                                remove(key);
                                result = null;
                        }
                }
                return result;
        }
    })
The cached entries

Long cacheDuration [protected]

Entry entry [protected]

String entryName [protected]

NSArray keys [protected]

final Logger log = Logger.getLogger(ERXCachingWrapper.class) [static, private]

logging support

NSDictionary values [protected]


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:43:03 2012 for Project Wonder by  doxygen 1.5.8