Results 1 to 3 of 3

Thread: ReloadableResourceBundleMessageSource and cacheSeconds ?

  1. #1
    Join Date
    Sep 2005
    Posts
    26

    Default ReloadableResourceBundleMessageSource and cacheSeconds ?

    hello,

    I read the javadoc of the "ReloadableResourceBundleMessageSource" and did not understand the following:

    This MessageSource implementation is usually slightly faster than ResourceBundleMessageSource, which builds on java.util.ResourceBundle - in the default mode, i.e. when caching forever.

    With "cacheSeconds" set to 1, message lookup takes about twice as long - with the benefit that changes in individual properties files are detected with a maximum delay of 1 second.

    Higher "cacheSeconds" values usually don't make a significant difference.
    I don't get the last sentence! E.g. when I set cacheSeconds to 1 hours it means that message lookup takes as long as with cacheSeconds set to 1 second?

    Hope s.o. can clarify it to me!

    Thanks in advance, Leif

  2. #2

    Default

    I have the same question, anyone out there who can clarify this?

  3. #3
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,625

    Default

    The sentence seems quite clear to me...

    If you set ANY caching the lookup of the message takes twice the time it would compared to when you DON'T set any cahce seconds.

    Which is quite logical imho. When you don't set caching the class loads the file once and always returns the same value. When you set caching it first check if it needs to reload the file, if yes reload the file if the file has changed. Both checkes take some time.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Similar Threads

  1. Replies: 5
    Last Post: Nov 5th, 2004, 09:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •