Class InstantiatorFactoryBean
java.lang.Object
org.springframework.data.gemfire.serialization.InstantiatorFactoryBean
- All Implemented Interfaces:
Aware
,BeanClassLoaderAware
,FactoryBean<Collection<Instantiator>>
,InitializingBean
public class InstantiatorFactoryBean
extends Object
implements BeanClassLoaderAware, FactoryBean<Collection<Instantiator>>, 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.- Author:
- Costin Leau
-
Field Summary
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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 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 interfaceInitializingBean
- Throws:
Exception
-
getObject
- Specified by:
getObject
in interfaceFactoryBean<Collection<Instantiator>>
- Throws:
Exception
-
getObjectType
- Specified by:
getObjectType
in interfaceFactoryBean<Collection<Instantiator>>
-
isSingleton
public boolean isSingleton()- Specified by:
isSingleton
in interfaceFactoryBean<Collection<Instantiator>>
-
setBeanClassLoader
- Specified by:
setBeanClassLoader
in interfaceBeanClassLoaderAware
-
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:
-
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:
-