Class DefaultTransientSettingDao

All Implemented Interfaces:
Serializable, ConcurrentMap<String,ConcurrentMap<String,Object>>, Map<String,ConcurrentMap<String,Object>>, TransientSettingDao

public class DefaultTransientSettingDao extends ConcurrentHashMap<String,ConcurrentMap<String,Object>> implements TransientSettingDao
Default implementation of TransientSettingDao.
Since:
2.5
Version:
1.0
Author:
matt
See Also:
  • Field Details

    • DEFAULT_SETTINGS_INITIAL_CAPACITY

      public static final int DEFAULT_SETTINGS_INITIAL_CAPACITY
      The settingsInitialCapacity property default value.
      See Also:
    • DEFAULT_SETTINGS_LOAD_FACTOR

      public static final float DEFAULT_SETTINGS_LOAD_FACTOR
      The settingsLoadFactor property default value.
      See Also:
    • DEFAULT_SETTINGS_CONCURRENCY_LEVEL

      public static final int DEFAULT_SETTINGS_CONCURRENCY_LEVEL
      The settingsConcurrencyLevel property default value.
      See Also:
  • Constructor Details

    • DefaultTransientSettingDao

      public DefaultTransientSettingDao()
      Default constructor.
    • DefaultTransientSettingDao

      public DefaultTransientSettingDao(int initialCapacity)
      Constructor.
      Parameters:
      initialCapacity - the initial capacity hint
    • DefaultTransientSettingDao

      public DefaultTransientSettingDao(Map<? extends String,? extends ConcurrentMap<String,Object>> m)
      Constructor.
      Parameters:
      m - another map to copy values from
    • DefaultTransientSettingDao

      public DefaultTransientSettingDao(int initialCapacity, float loadFactor)
      Constructor.
      Parameters:
      initialCapacity - the initial capacity hint
      loadFactor - a load factor hint
    • DefaultTransientSettingDao

      public DefaultTransientSettingDao(int initialCapacity, float loadFactor, int concurrencyLevel)
      Constructor.
      Parameters:
      initialCapacity - the initial capacity hint
      loadFactor - a load factor hint
      concurrencyLevel - a concurrency level hint
  • Method Details

    • settings

      public <V> ConcurrentMap<String,V> settings(String key)
      Description copied from interface: TransientSettingDao
      Get the settings map for a given key.

      This method will always return the same map instance for a given key.

      Specified by:
      settings in interface TransientSettingDao
      Type Parameters:
      V - the value type to cast to; note this is only a generic casting operation for convenience and the actual map is expected to actually be declared as ConcurrentMap&ltString, Object&gt;
      Parameters:
      key - the settings key to get
      Returns:
      the settings for the given key, never null
    • getSettingsInitialCapacity

      public int getSettingsInitialCapacity()
      Get the initial capacity used for settings maps.
      Returns:
      the initial capacity; defaults to DEFAULT_SETTINGS_INITIAL_CAPACITY
    • setSettingsInitialCapacity

      public void setSettingsInitialCapacity(int settingsInitialCapacity)
      Set the initial capacity used for settings maps.
      Parameters:
      settingsInitialCapacity - the capacity to set
    • getSettingsLoadFactor

      public float getSettingsLoadFactor()
      Get the load factory used for settings maps.
      Returns:
      the load factor; defaults to DEFAULT_SETTINGS_LOAD_FACTOR
    • setSettingsLoadFactor

      public void setSettingsLoadFactor(float settingsLoadFactor)
      Set the load factory used for settings maps.
      Parameters:
      settingsLoadFactor - the load factor to set
    • getSettingsConcurrencyLevel

      public int getSettingsConcurrencyLevel()
      Get the concurrency level used for settings maps.
      Returns:
      the concurrency level; defaults to DEFAULT_SETTINGS_CONCURRENCY_LEVEL
    • setSettingsConcurrencyLevel

      public void setSettingsConcurrencyLevel(int settingsConcurrencyLevel)
      Set the concurrency level used for settings maps.
      Parameters:
      settingsConcurrencyLevel - the concurrency level to set