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
InstantiatorGenerator
s, inside the Spring container.
By default, the returns Instantiator
s (created through AsmInstantiatorGenerator
if a custom
generator is not specified) are registered at startup with GemFire.-
Field Summary
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Collection<org.apache.geode.Instantiator>
Class<?>
boolean
void
setAutoRegister
(boolean autoRegister) Sets the auto-registration of thisInstantiator
during the container startup.void
setBeanClassLoader
(ClassLoader classLoader) void
setCustomTypes
(Map<Class<? extends org.apache.geode.DataSerializable>, Integer> types) Sets the custom types and associated user ids for generating theInstantiator
s.void
setDistribute
(boolean distribute) Sets the distribution of the region of thisInstantiator
during the container startup.void
setGenerator
(InstantiatorGenerator generator) Sets the generator to use for creatingInstantiator
s.
-
Constructor Details
-
InstantiatorFactoryBean
public InstantiatorFactoryBean()
-
-
Method Details
-
afterPropertiesSet
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
-
getObject
- Specified by:
getObject
in interfaceorg.springframework.beans.factory.FactoryBean<Collection<org.apache.geode.Instantiator>>
- Throws:
Exception
-
getObjectType
- Specified by:
getObjectType
in interfaceorg.springframework.beans.factory.FactoryBean<Collection<org.apache.geode.Instantiator>>
-
isSingleton
public boolean isSingleton()- Specified by:
isSingleton
in interfaceorg.springframework.beans.factory.FactoryBean<Collection<org.apache.geode.Instantiator>>
-
setBeanClassLoader
- Specified by:
setBeanClassLoader
in interfaceorg.springframework.beans.factory.BeanClassLoaderAware
-
setCustomTypes
Sets the custom types and associated user ids for generating theInstantiator
s.- Parameters:
types
- map containing as keys the custom types and values the associated user ids.
-
setGenerator
Sets the generator to use for creatingInstantiator
s.- Parameters:
generator
- the generator to set
-
setAutoRegister
public void setAutoRegister(boolean autoRegister) Sets the auto-registration of thisInstantiator
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 thisInstantiator
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)
-