org.faktorips.runtime
Class DefaultCacheFactory

java.lang.Object
  extended by org.faktorips.runtime.internal.AbstractCacheFactory
      extended by org.faktorips.runtime.DefaultCacheFactory
All Implemented Interfaces:
ICacheFactory

public class DefaultCacheFactory
extends AbstractCacheFactory

Default cache factory. Uses SoftReferenceCaches for each object type.

Author:
Jan Ortmann

Constructor Summary
DefaultCacheFactory(ClassLoader cl)
           
DefaultCacheFactory(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
 
Method Summary
<K,V> Memoizer<K,V>
createCache(IComputable<K,V> computable)
          Creates a new cache of the given type.
 int getConcurrencyLevel()
           
protected  int getInitialSize(Class<?> typeClass)
           
 void setConcurrencyLevel(int concurrencyLevel)
           
 void setDefaultInitialSize(int defaultInitialSize)
           
 void setInitialSize(Class<?> typeClass, int size)
           
 
Methods inherited from class org.faktorips.runtime.internal.AbstractCacheFactory
createEnumCache, createProductCmptCache, createProductCmptGenerationCache, createTableCache
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCacheFactory

public DefaultCacheFactory(ClassLoader cl)

DefaultCacheFactory

@Deprecated
public DefaultCacheFactory(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(Class<?> typeClass,
                           int size)

setDefaultInitialSize

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

getInitialSize

protected int getInitialSize(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()


Copyright © 2015. All rights reserved.