Uploaded image for project: 'Spring Modules'
  1. Spring Modules
  2. MOD-394

In Cache Module, many classes or methods are final, so it's not easy to extend it.

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 0.8
    • Fix Version/s: None
    • Component/s: CACHE
    • Labels:
      None
    • Environment:
      Cache Module (EhCache).

      Description

      I wanted to handle EhCache not exactly like spring-module cache does, I wanted to extend it just for changing the behaviour of some methods.

      To explain better, what I wanted to do in fact is :

      • to use an "eternal cache" (ehcache config)
      • which is flushed after a gived timelife (specific config)
      • ONLY if the execution method (which is cached : [caching model]) works correctly (otherwise, we keep the old cache, [if it exists]).
        [This can be very useful to improve the disponibility of an application if the method that we cache is a call to a WebService, an external DB, an LDAP, etc.]

      Anyway, in fact I "just" wanted to modify the behaviour of the NameMatchCachingInterceptor.invoke method ...
      but because of finally methods and classes, I had to copy/paste classes code entire:

      • org.springmodules.cache.interceptor.caching.NameMatchCachingInterceptor (and its super classes)
      • org.springmodules.cache.provider.ehcache.EhCacheFacade
      • org.springmodules.cache.interceptor.proxy.CacheProxyFactoryBean
      • org.springmodules.cache.interceptor.caching.CachingModelSourceAdvisor
      • NullObject

      It works, but I prefered juste to extend there and just overwrite what needed.
      ==>> So my request is to remove the "final" of the most of classes and methods if possible in the cache module.

      By the way, all the code and example config files that I "writed" (or copied/pasted ) are here :
      http://sourcesup.cru.fr/cgi/viewvc.cgi/ori-oai-vocabulary-spring/trunk/src/org/orioai/vocabulary/domain/utils/cache/?root=ori-vocabulary&pathrev=136
      http://sourcesup.cru.fr/cgi/viewvc.cgi/ori-oai-vocabulary-spring/trunk/conf/properties/cache/?root=ori-vocabulary&pathrev=136

      If you find that it would be useful for others, maybe you can take the idea (or some code if you want) and integrate it in cache spring module (it would be very nice ! ).

      Anyway, Thanks for this project, it's very useful.
      Best regards,

      Vincent.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              irbouho Omar Irbouh
              Reporter:
              vbonamy Vincent Bonamy
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - 1h
                  1h
                  Remaining:
                  Remaining Estimate - 1h
                  1h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified