class B extends A
class C extends A

A.properties { foo=bar }

Component b=new B();
Component c=new C();
b.getString("foo");
c.getString("foo");

someone edits A.properties in the database
ui calls clearkey("foo",b) <== does not clear the cache used by (c),
need to call clearkey("foo", set of all descendants of A that loaded
the key)

this is just a class hieararchy example, what about component
hierarchy examples where multiple descendant components can inherit
keys from their parent component?

-igor

On Thu, Jul 23, 2009 at 3:01 PM, Mathias
Nilsson<wicket.program...@gmail.com> wrote:
>
> Ok maybe there is a lot of work for this issue. It isn't a problem when using
> wicket ComponentStringResourceLoader is just a problem if we need to access
> the database all the time for a string and clear the entier cache if the
> database is updated.
>
> when looking at  the source for Localizer#getCachedKey it returns the whole
> path, with style and locale. If I implemented a clearCachedKey like this. (
> just on top of my head )
>
> /**
>  * Clear a key from the cache.
> *
> */
> public void clearCachedKey( final String key, final Component component ){
>  if( cache == null ) return;
>  String cachedKey = getCacheKey( key, component );
>  if( cachedKey != null ){
>    cache.remove( cachedKey );
>  }
> }
>
> wouldn't that be sufficient. The entire locale, style is taken care of by
> the getCachedKey. If the component is null only the key is returned.
> --
> View this message in context: 
> http://www.nabble.com/Localizing-thru-database-lookup-tp24627686p24635300.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to