org.springframework.data.gemfire.serialization
Class InstantiatorFactoryBean

java.lang.Object
  extended by org.springframework.data.gemfire.serialization.InstantiatorFactoryBean
All Implemented Interfaces:
BeanClassLoaderAware, FactoryBean<Collection<Instantiator>>, InitializingBean

public class InstantiatorFactoryBean
extends Object
implements BeanClassLoaderAware, FactoryBean<Collection<Instantiator>>, 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.

Author:
Costin Leau

Constructor Summary
InstantiatorFactoryBean()
           
 
Method Summary
 void afterPropertiesSet()
           
 Collection<Instantiator> getObject()
           
 Class<?> getObjectType()
           
 boolean isSingleton()
           
 void setAutoRegister(boolean autoRegister)
          Sets the auto-registration of this Instantiator 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 the Instantiators.
 void setGenerator(InstantiatorGenerator generator)
          Sets the generator to use for creating Instantiators.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InstantiatorFactoryBean

public InstantiatorFactoryBean()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

getObject

public Collection<Instantiator> getObject()
                                   throws Exception
Specified by:
getObject in interface FactoryBean<Collection<Instantiator>>
Throws:
Exception

getObjectType

public Class<?> getObjectType()
Specified by:
getObjectType in interface FactoryBean<Collection<Instantiator>>

isSingleton

public boolean isSingleton()
Specified by:
isSingleton in interface FactoryBean<Collection<Instantiator>>

setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Specified by:
setBeanClassLoader in interface BeanClassLoaderAware

setCustomTypes

public void setCustomTypes(Map<Class<? extends 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)


Copyright © 2010 SpringSource, a division of VMware. All Rights Reserved.