org.springframework.data.gemfire.serialization
Class WiringInstantiator
java.lang.Object
com.gemstone.gemfire.Instantiator
org.springframework.data.gemfire.serialization.WiringInstantiator
- All Implemented Interfaces:
- BeanFactoryAware, DisposableBean, InitializingBean
public class WiringInstantiator
- extends Instantiator
- implements BeanFactoryAware, InitializingBean, DisposableBean
Instantiator that performs instance wiring using the Spring IoC container, allowing common properties
to be injected before the object is hydrated/deserialized. The newly created instances can be configured
either by relying on an existing bean definition (which acts as a template) or by providing an embedded
configuration through annotations.
Can reuse existing instantiators to optimize instance creation. If one is not provided, it will fallback
to reflection invocation.
By default, on initialization, the class will register itself as an Instantiator
through
Instantiator.register(Instantiator)
. This behaviour can be disabled through setAutoRegister(boolean)
.
- Author:
- Costin Leau
- See Also:
BeanConfigurerSupport
,
BeanWiringInfoResolver
,
Autowired
,
Resource
,
Inject
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WiringInstantiator
public WiringInstantiator(Instantiator instantiator)
WiringInstantiator
public WiringInstantiator(Class<? extends DataSerializable> c,
int classId)
afterPropertiesSet
public void afterPropertiesSet()
- Specified by:
afterPropertiesSet
in interface InitializingBean
destroy
public void destroy()
throws Exception
- Specified by:
destroy
in interface DisposableBean
- Throws:
Exception
setBeanFactory
public void setBeanFactory(BeanFactory beanFactory)
throws BeansException
- Specified by:
setBeanFactory
in interface BeanFactoryAware
- Throws:
BeansException
newInstance
public DataSerializable newInstance()
- Specified by:
newInstance
in class Instantiator
setConfigurer
public void setConfigurer(BeanConfigurerSupport configurer)
- Sets the manager responsible for configuring the newly created instances.
The given configurer needs to be configured and initialized before-hand.
- Parameters:
configurer
- the configurer 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-2011 SpringSource, a division of VMware. All Rights Reserved.