Class InstantiatorFactoryBean

java.lang.Object
org.springframework.data.gemfire.serialization.InstantiatorFactoryBean
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.FactoryBean<Collection<org.apache.geode.Instantiator>>, org.springframework.beans.factory.InitializingBean

public class InstantiatorFactoryBean extends Object implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.FactoryBean<Collection<org.apache.geode.Instantiator>>, org.springframework.beans.factory.InitializingBean
FactoryBean that eases registration of custom Instantiator through InstantiatorGenerators, inside the Spring container. By default, the returns Instantiators (created through AsmInstantiatorGenerator if a custom generator is not specified) are registered at startup with GemFire.
  • Constructor Details

    • InstantiatorFactoryBean

      public InstantiatorFactoryBean()
  • Method Details

    • afterPropertiesSet

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

      public Collection<org.apache.geode.Instantiator> getObject() throws Exception
      Specified by:
      getObject in interface org.springframework.beans.factory.FactoryBean<Collection<org.apache.geode.Instantiator>>
      Throws:
      Exception
    • getObjectType

      public Class<?> getObjectType()
      Specified by:
      getObjectType in interface org.springframework.beans.factory.FactoryBean<Collection<org.apache.geode.Instantiator>>
    • isSingleton

      public boolean isSingleton()
      Specified by:
      isSingleton in interface org.springframework.beans.factory.FactoryBean<Collection<org.apache.geode.Instantiator>>
    • setBeanClassLoader

      public void setBeanClassLoader(ClassLoader classLoader)
      Specified by:
      setBeanClassLoader in interface org.springframework.beans.factory.BeanClassLoaderAware
    • setCustomTypes

      public void setCustomTypes(Map<Class<? extends org.apache.geode.DataSerializable>,Integer> types)
      Sets the custom types and associated user ids for generating the Instantiators.
      Parameters:
      types - map containing as keys the custom types and values the associated user ids.
    • setGenerator

      public void setGenerator(InstantiatorGenerator generator)
      Sets the generator to use for creating Instantiators.
      Parameters:
      generator - the generator to set
    • setAutoRegister

      public void setAutoRegister(boolean autoRegister)
      Sets the auto-registration of this Instantiator during the container startup. Default is true, meaning the registration will occur once this factory is initialized.
      Parameters:
      autoRegister - the autoRegister to set
      See Also:
      • Instantiator.register(Instantiator)
    • setDistribute

      public void setDistribute(boolean distribute)
      Sets the distribution of the region of this Instantiator during the container startup. Default is false, meaning the registration will not be distributed to other clients.
      Parameters:
      distribute - whether the registration is distributable or not
      See Also:
      • Instantiator.register(Instantiator, boolean)