org.apache.ojb.broker.cache
Class CacheFilterPackageImpl

java.lang.Object
  extended byorg.apache.ojb.broker.cache.CacheFilterPackageImpl
All Implemented Interfaces:
CacheFilter

public class CacheFilterPackageImpl
extends java.lang.Object
implements CacheFilter

A CacheFilter implementation for filtering objects before cached when the given objects package name match a given package, defined as custom attribute within the descriptor-repository element or jdbc-connection-descriptor in the repository file.
Example:
Add this custom attribute to a jdbc-connection-descriptor to avoid caching of package trees for the described connection.

 <attribute
    attribute-name="exclude-packages"
    attribute-value="org.my.test,org.my.admin"/>
 
To enable a global exclude of caching, add the custom attribute entry under the descriptor-repository element.

Version:
$Id: CacheFilterPackageImpl.java,v 1.5 2003/06/12 17:24:13 arminw Exp $
Author:
Armin Waibel

Field Summary
static java.lang.String EXCLUDE_PACKAGES
           
 
Constructor Summary
CacheFilterPackageImpl(PersistenceBroker broker, ObjectCache cache)
           
 
Method Summary
 boolean beforeCache(Identity oid, java.lang.Object obj)
          Called before an object was put in cache - If false was returned the object was not put in cache.
 boolean beforeLookup(Identity oid)
          Called before an object was looked up in cache - If false was returned the object was not looked up in cache.
 boolean beforeRemove(Identity oid)
          Called before an object was removed from cache - If false was returned the object was not removed from in cache.
 ObjectCache getObjectCache()
          Returns the underlying ObjectCache implemenation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXCLUDE_PACKAGES

public static final java.lang.String EXCLUDE_PACKAGES
See Also:
Constant Field Values
Constructor Detail

CacheFilterPackageImpl

public CacheFilterPackageImpl(PersistenceBroker broker,
                              ObjectCache cache)
Method Detail

beforeCache

public boolean beforeCache(Identity oid,
                           java.lang.Object obj)
Description copied from interface: CacheFilter
Called before an object was put in cache - If false was returned the object was not put in cache.

Specified by:
beforeCache in interface CacheFilter

beforeLookup

public boolean beforeLookup(Identity oid)
Description copied from interface: CacheFilter
Called before an object was looked up in cache - If false was returned the object was not looked up in cache.

Specified by:
beforeLookup in interface CacheFilter

beforeRemove

public boolean beforeRemove(Identity oid)
Description copied from interface: CacheFilter
Called before an object was removed from cache - If false was returned the object was not removed from in cache.

Specified by:
beforeRemove in interface CacheFilter

getObjectCache

public ObjectCache getObjectCache()
Description copied from interface: CacheFilter
Returns the underlying ObjectCache implemenation.

Specified by:
getObjectCache in interface CacheFilter


Authors: Thomas Mahler and others. (C) 2000 - 2003 Apache Software Foundation
All rights reserved. Published under the Apache License.
http://db.apache.org/ojb
Version: 1.0.rc5, 2003-12-14