Class GuavaCacheFactoryBean<K,​V>

  • All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<com.google.common.cache.Cache<K,​V>>, org.springframework.beans.factory.InitializingBean

    public class GuavaCacheFactoryBean<K,​V>
    extends org.springframework.beans.factory.config.AbstractFactoryBean<com.google.common.cache.Cache<K,​V>>
    implements org.springframework.beans.factory.BeanNameAware
    Spring FactoryBean used to create Guava caches as beans.
    Since:
    4.0.0
    Author:
    joseross
    • Constructor Detail

      • GuavaCacheFactoryBean

        public GuavaCacheFactoryBean()
    • Method Detail

      • setBeanName

        public void setBeanName​(String name)
        Specified by:
        setBeanName in interface org.springframework.beans.factory.BeanNameAware
      • setRecordStats

        public void setRecordStats​(boolean recordStats)
      • setMaxSize

        public void setMaxSize​(long maxSize)
      • setTimeToLive

        public void setTimeToLive​(long timeToLive)
      • setTimeToIdle

        public void setTimeToIdle​(long timeToIdle)
      • getObjectType

        public Class<?> getObjectType()
        Specified by:
        getObjectType in interface org.springframework.beans.factory.FactoryBean<K>
        Specified by:
        getObjectType in class org.springframework.beans.factory.config.AbstractFactoryBean<com.google.common.cache.Cache<K,​V>>
      • createInstance

        protected com.google.common.cache.Cache<K,​V> createInstance()
        Specified by:
        createInstance in class org.springframework.beans.factory.config.AbstractFactoryBean<com.google.common.cache.Cache<K,​V>>
      • destroyInstance

        protected void destroyInstance​(com.google.common.cache.Cache<K,​V> instance)
        Overrides:
        destroyInstance in class org.springframework.beans.factory.config.AbstractFactoryBean<com.google.common.cache.Cache<K,​V>>