ERXFetchResultCache Class Reference

Collaboration diagram for ERXFetchResultCache:

Collaboration graph
[legend]

List of all members.

Public Member Functions

NSArray<?extends
EOEnterpriseObject > 
objectsForFetchSpecification (EODatabaseContext dbc, EOEditingContext ec, EOFetchSpecification fs)
void setObjectsForFetchSpecification (EODatabaseContext dbc, EOEditingContext ec, NSArray<?> eos, EOFetchSpecification fs)

Protected Member Functions

long cacheTime (NSArray eos, EOFetchSpecification fs)
NSArray< StringexcludedEntities ()

Private Attributes

ERXExpiringCache< String,
NSArray< EOGlobalID > > 
cache

Static Private Attributes

static EODatabase currentDatabase
static final Logger log = Logger.getLogger(ERXFetchResultCache.class)


Detailed Description

Transparent cache for fetch results, uses ERXFetchSpecifictation.identifier() as a key.
Author:
ak

Member Function Documentation

long cacheTime ( NSArray  eos,
EOFetchSpecification  fs 
) [protected]

Returns the time the result should stay in the cache. Less or equal than zero means don't cache.

Parameters:
fs 

NSArray<String> excludedEntities (  )  [protected]

Returns a list of entities that should not be cached.

NSArray<? extends EOEnterpriseObject> objectsForFetchSpecification ( EODatabaseContext  dbc,
EOEditingContext  ec,
EOFetchSpecification  fs 
)

Returns an array of EOs that where cached for the given fetch specification or null.

Parameters:
ec 
fs 

void setObjectsForFetchSpecification ( EODatabaseContext  dbc,
EOEditingContext  ec,
NSArray<?>  eos,
EOFetchSpecification  fs 
)

Registers eos for a given fetch spec.

Parameters:
ec 
dbc 
eos 
fs 


Member Data Documentation

ERXExpiringCache<String, NSArray<EOGlobalID> > cache [private]

Initial value:

 new ERXExpiringCache<String, NSArray<EOGlobalID>>() {
                @Override
                protected synchronized void removeEntryForKey(Entry<NSArray<EOGlobalID>> entry, String key) {
                        for (EOGlobalID gid : entry.object()) {
                                currentDatabase.decrementSnapshotCountForGlobalID(gid);
                        }
                        super.removeEntryForKey(entry, key);
                }
                
                @Override
                protected synchronized void setEntryForKey(Entry<NSArray<EOGlobalID>> entry, String key) {
                        super.setEntryForKey(entry, key);
                        for (EOGlobalID gid : entry.object()) {
                                currentDatabase.incrementSnapshotCountForGlobalID(gid);
                        }
                }
        }

EODatabase currentDatabase [static, private]

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


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

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