Class DefaultCacheFactory

  • All Implemented Interfaces:
    ICacheFactory

    public class DefaultCacheFactory
    extends AbstractCacheFactory
    Default cache factory. Uses SoftReferenceCaches for each object type.
    Author:
    Jan Ortmann
    • Constructor Detail

      • DefaultCacheFactory

        public DefaultCacheFactory​(java.lang.ClassLoader cl)
      • DefaultCacheFactory

        @Deprecated
        public DefaultCacheFactory​(java.lang.ClassLoader cl,
                                   int initialCapacityForProductCmpts,
                                   int initialCapacityForProductCmptGenerations,
                                   int initialCapacityForTablesByClassname,
                                   int initialCapacityForTablesByQname,
                                   int initialCapacityForEnumContentByClassName)
        Deprecated.
        Use the default constructor and set the cache size by calling setInitialSize(Class, int) instead
        Constructor to set the initial capacity of the caches
        Parameters:
        initialCapacityForTablesByQname - not used anymore!
        initialCapacityForEnumContentByClassName - not used anymore!
    • Method Detail

      • setInitialSize

        public void setInitialSize​(java.lang.Class<?> typeClass,
                                   int size)
      • setDefaultInitialSize

        public void setDefaultInitialSize​(int defaultInitialSize)
        Parameters:
        defaultInitialSize - The defaultInitialSize to set.
      • getInitialSize

        protected int getInitialSize​(java.lang.Class<?> typeClass)
      • createCache

        public <K,​V> Memoizer<K,​V> createCache​(IComputable<K,​V> computable)
        Description copied from interface: ICacheFactory
        Creates a new cache of the given type.
      • setConcurrencyLevel

        public void setConcurrencyLevel​(int concurrencyLevel)
      • getConcurrencyLevel

        public int getConcurrencyLevel()