Class AbstractStore

java.lang.Object
ortus.boxlang.runtime.cache.store.AbstractStore
All Implemented Interfaces:
IObjectStore
Direct Known Subclasses:
BlackHoleStore, ConcurrentSoftReferenceStore, ConcurrentStore, FileSystemStore

public abstract class AbstractStore extends Object implements IObjectStore
The base implementation of a cache store in BoxLang.
  • Field Details

    • provider

      protected ICacheProvider provider
      The cache provider associated with this store
    • config

      protected IStruct config
      The configuration for the store
  • Constructor Details

    • AbstractStore

      public AbstractStore()
  • Method Details

    • getName

      public String getName()
      Get the name of the store
      Specified by:
      getName in interface IObjectStore
      Returns:
      The name of the store
    • getConfig

      public IStruct getConfig()
      Get the configuration for the store
      Specified by:
      getConfig in interface IObjectStore
    • getProvider

      public ICacheProvider getProvider()
      Get the associated cache provider
      Specified by:
      getProvider in interface IObjectStore
    • getPolicy

      public ICachePolicy getPolicy()
      Get a policy for usage by the store. The policies are stored in the ortus.boxlang.runtime.cache.policies package. - LRU: Least Recently Used - MRU: Most Recently Used - LFU: Least Frequently Used - MFU: Most Frequently Used - FIFO: First In First Out - LIFO: Last In First Out - Random: Randomly evict objects You can also register your own policy by implementing the ICachePolicy interface.
    • buildPolicyByName

      protected ICachePolicy buildPolicyByName(String policyName)
      Get a policy by name from BoxLang's policies package.
      Parameters:
      policyName - The name of the policy
      Returns:
      The policy
      Throws:
      BoxRuntimeException - If the policy cannot be loaded
      BoxRuntimeException - If the policy does not implement ICachePolicy
      BoxRuntimeException - If the policy cannot be instantiated