Class SpringRemoteCacheManagerFactoryBean

  • All Implemented Interfaces:
    org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<SpringRemoteCacheManager>, org.springframework.beans.factory.InitializingBean

    public class SpringRemoteCacheManagerFactoryBean
    extends AbstractRemoteCacheManagerFactory
    implements org.springframework.beans.factory.FactoryBean<SpringRemoteCacheManager>, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean

    A FactoryBean for creating an SpringRemoteCacheManager instance.

    Configuration

    A SpringRemoteCacheManager is configured through a Properties object. For an exhaustive list of valid properties to be used see RemoteCacheManager's javadocs. This FactoryBean provides means to either inject a user-defined Properties instance or to set the location of a properties file to load those properties from. Note that it is illegal to use both mechanisms simultaneously.

    Alternatively or in combination with setting the location of a Properties file to load the configuration from, this FactoryBean provides (typed) setters for all configuration settings. Settings thus defined take precedence over those defined in the injected Properties instance. This flexibility enables users to use e.g. a company-wide Properties file containing default settings while simultaneously overriding select settings whenever special requirements warrant this.
    Note that it is illegal to use setters in conjunction with injecting a Properties instance.

    In addition to creating a SpringRemoteCacheManager this FactoryBean does also control that SpringRemoteCacheManager's lifecycle by shutting it down when the enclosing Spring application context is closed. It is therefore advisable to always use this FactoryBean when creating an SpringRemoteCacheManager.

    Author:
    Olaf Bergner
    See Also:
    RemoteCacheManager, destroy()
    • Constructor Detail

      • SpringRemoteCacheManagerFactoryBean

        public SpringRemoteCacheManagerFactoryBean()
    • Method Detail

      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws Exception
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Throws:
        Exception
        See Also:
        InitializingBean.afterPropertiesSet()
      • isSingleton

        public boolean isSingleton()
        Always return true.
        Specified by:
        isSingleton in interface org.springframework.beans.factory.FactoryBean<SpringRemoteCacheManager>
        See Also:
        FactoryBean.isSingleton()
      • destroy

        public void destroy()
                     throws Exception
        stop the RemoteCacheManager created by this factory.
        Specified by:
        destroy in interface org.springframework.beans.factory.DisposableBean
        Throws:
        Exception
        See Also:
        DisposableBean.destroy()