Changeset 4824


Ignore:
Timestamp:
Mar 20, 2009, 3:40:03 PM (14 years ago)
Author:
Nicklas Nordborg
Message:

References #1261: Global cache for static data

A prototype implementation of the cache. It should work ok, as long as multiple users doesn't write to the same cache entry at the same time. There is no configuration options or code fore cleaning the cache.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/net/sf/basedb/core/Application.java

    r4517 r4824  
    3131import net.sf.basedb.util.FileUtil;
    3232import net.sf.basedb.util.RegexpFileFilter;
     33import net.sf.basedb.util.StaticCache;
    3334import net.sf.basedb.util.timer.Scheduler;
    3435
     
    119120  */
    120121  private static java.io.File userFilesDirectory;
     122 
     123  /**
     124    Cache for static data.
     125  */
     126  private static StaticCache staticCache;
    121127
    122128  /**
     
    442448     
    443449      // Initialise other utility classes
     450      staticCache = new StaticCache(new java.io.File(userFilesDirectory, "static.cache"));
    444451      QueryExecutor.init();
    445452      HibernateUtil.init1();
     
    719726
    720727  /**
     728    Get the static cache mananger.
     729    @since 2.11
     730  */
     731  public static StaticCache getStaticCache()
     732  {
     733    return staticCache;
     734  }
     735 
     736  /**
    721737    Get the path to the XML file containing predefined
    722738    queries for SQL and HQL.
Note: See TracChangeset for help on using the changeset viewer.