there is a new cache type called AttributeBasedObjectCacheImpl (as
ObjectCachePerClassImpl was already used).
you can choose a per-class cache by using the attribute name="cacheClass" value =
"some class name" in your class descriptor
like this:
<class-descriptor
class="org.apache.ojb.broker.Article"
proxy="dynamic"
table="Artikel"
>
<attribute attribute-name="cacheClass"
attribute-value="org.apache.ojb.broker.cache.ObjectCacheUnlimitedImpl" />
btw Thomas, how do you want docs for there features?
-----Original Message-----
From: Armin Waibel [mailto:[EMAIL PROTECTED]
Sent: Monday, August 04, 2003 4:51 PM
To: OJB Users List
Subject: Re: Example usage of MetaObjectCachePerClassImpl
Hi Akhil,
> Hi,
>
> Can somebody (Armin ?) share an example of using
> MetaObjectCachePerClassImpl
>
> I did a search (not very exhaustive though) and found only one test
case:
> "org.apache.ojb.broker.ObjectCacheTests"
> which uses this cache but it does not demonstrate how to use...
>
> my queston is: where do we specify the which-class-uses-which-cache
> setting...
>
hmm, good question! Seems you need to cast to this implementation
(really bad) and use
public void setClassCache(Class objectClass, ObjectCache cache)
e.g.
cache = broker.serviceObjectCache();
((Meta....)cache).setClassCache(myClass, new
ObjectCacheDefaultImpl(null));
but there is no method to check if the cache already contains
'myClass' as key, thus it can be possible possible that I override
again and again.
> are we supposed to programmatically set it ?
>
> I did not find any code which would read a custom attribute from
> repository.
>
think this is a good idea to make this implementation
really useful. Are you willing to improve this implementation?
regards,
Armin
> Thanks in advance,
> Akhil Kumar
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]