public class WiringInstantiator extends Instantiator implements BeanFactoryAware, InitializingBean, DisposableBean
Instantiator
through
Instantiator.register(Instantiator)
. This behaviour can be disabled through setAutoRegister(boolean)
.
Additionally, the instantiator registration is not distributed by default, to allow the application context
to be reused. This can be changed through setDistribute(boolean)
.BeanConfigurerSupport
,
BeanWiringInfoResolver
,
Autowired
,
Resource
Constructor and Description |
---|
WiringInstantiator(Class<? extends DataSerializable> c,
int classId) |
WiringInstantiator(Instantiator instantiator) |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
void |
destroy() |
DataSerializable |
newInstance() |
void |
setAutoRegister(boolean autoRegister)
Sets the auto-registration of this
Instantiator during the container startup. |
void |
setBeanFactory(BeanFactory beanFactory) |
void |
setConfigurer(BeanConfigurerSupport configurer)
Sets the manager responsible for configuring the newly created instances.
|
void |
setDistribute(boolean distribute)
Sets the distribution of the region of this
Instantiator during the container startup. |
getContext, getEventId, getId, getInstantiatedClass, register, register, setContext, setEventId
public WiringInstantiator(Instantiator instantiator)
public WiringInstantiator(Class<? extends DataSerializable> c, int classId)
public void afterPropertiesSet()
afterPropertiesSet
in interface InitializingBean
public void destroy() throws Exception
destroy
in interface DisposableBean
Exception
public void setBeanFactory(BeanFactory beanFactory) throws BeansException
setBeanFactory
in interface BeanFactoryAware
BeansException
public DataSerializable newInstance()
newInstance
in class Instantiator
public void setConfigurer(BeanConfigurerSupport configurer)
configurer
- the configurer to setpublic void setAutoRegister(boolean autoRegister)
Instantiator
during the container startup.
Default is true, meaning the registration will occur once this factory is initialized.autoRegister
- the autoRegister to setInstantiator.register(Instantiator)
public void setDistribute(boolean distribute)
Instantiator
during the container startup.
Default is false, meaning the registration will not be distributed to other clients.distribute
- whether the registration is distributable or notInstantiator.register(Instantiator, boolean)