[Opensource] SimpleDateFormat
Ben Switzer
ben at site85.com
Sun Mar 16 08:37:45 PST 2003
Ahh wicked.
Thanks for the tip.
On another note. I would be interested in assisting with the code walk
through. Not sure if I can bring enough experience to the table, but
after my current project, which ends next week, I'll have time to lend
an extra set of eye balls to the cause.
Let me know.
Best,
Ben
ben at site85.com
-----Original Message-----
From: opensource-admin at jcorporate.com
[mailto:opensource-admin at jcorporate.com] On Behalf Of Michael Rimov
Sent: Sunday, March 16, 2003 7:06 AM
To: opensource at jcorporate.com
Subject: RE: [Opensource] SimpleDateFormat
At 11:44 AM 3/13/2003 -0500, you wrote:
>So Michael, how would I in a wrapper make use of the cache you've
>already setup in JDBCUtil?
I wouldn't worry about direct use I think JDBCUtil is too much in flux
to
externally rely on it.
To rolly your own Create a static org.apache.commons.collections.LRUMap
keyed by Locale that store SimpleDateFormat Objects. when you need to
format against a particular locale [ControllerRequest.getLocale()],
look
it up in the LRUMap, and if it exists use it, if it doesn't exist,
create a
new one for the locale and store it in the LRUMap. Make sure you
synchronize against the Map for each access.
Depending on your capabilities, you probably don't need to have the map
larger that 5.
HTH!
-Mike
[For those that are scratching their heads regarding the greek I just
spoke, LRUMap is a java.util.Map implementation that keeps X items in
store
and whenever more are stored, the map ejects items based upon the least
recently used algorithm. So in essence, it's a built in simple cache
implementation useful for certain tasks]
_______________________________________________
Opensource mailing list
Opensource at jcorporate.com
http://mail.jcorporate.com/mailman/listinfo/opensource
Archives: http://mail.jcorporate.com/pipermail/opensource/
More information about the Opensource
mailing list