Spring IOC container.
- BeanFactory container
- Application Context container.
Difference between BeanFactory and Application context container and there internals.
Spring Bean Definition:
Lazy-init: Indicates whether or not this bean is to be lazily initialized. If false, it will be instantiated on startup by
<!-- A bean definition with lazy init set on -->
<bean id="..." class="..." lazy-init="true">
<!-- collaborators and configuration for this bean go here --> </bean>
<!-- A bean definition with initialization method -->
<bean id="..." class="..." init-method="...">
<!-- collaborators and configuration for this bean go here --> </bean>
<!-- A bean definition with destruction method -->
<bean id="..." class="..." destroy-method="...">
<!-- collaborators and configuration for this bean go here --> </bean>
Spring Bean Definition:
Lazy-init: Indicates whether or not this bean is to be lazily initialized. If false, it will be instantiated on startup by
bean factories that perform eager initialization of singletons. The default is "false". Note: This attribute will not be inherited by child bean definitions. Hence, it needs to be specified per concrete bean definition.
init-method: The name of the custom initialization method to invoke after setting bean properties. The method must have no arguments, but may throw any exception.
<bean id="..." class="..." lazy-init="true">
<!-- collaborators and configuration for this bean go here --> </bean>
<!-- A bean definition with initialization method -->
<bean id="..." class="..." init-method="...">
<!-- collaborators and configuration for this bean go here --> </bean>
<!-- A bean definition with destruction method -->
<bean id="..." class="..." destroy-method="...">
<!-- collaborators and configuration for this bean go here --> </bean>
No comments:
Post a Comment