Notice: Constant WP_MEMORY_LIMIT already defined in /home/javawith/public_html/codesjava.com/wp-config.php on line 107

Notice: Constant WP_MAX_MEMORY_LIMIT already defined in /home/javawith/public_html/codesjava.com/wp-config.php on line 108
Spring bean tutorial - CodesJava

CodesJava

Easy learning with example program codes

spring bean


Notice: Undefined variable: footnotelist in /home/javawith/public_html/codesjava.com/wp-content/plugins/latex2html/inc/core.php on line 475

A spring bean represents an object that is created, configured and managed by spring container. A spring bean is created by configuration metadata passed to the spring container which tells the container about bean creation, bean lifecycle and bean dependencies.

Spring bean properties:

Bean Properties Description
1. class It is mandatory and specify the bean class which is used to create the bean.
2. name It specifies the bean unique identifier.
3. scope It specifies the scope of the objects created from a particular bean definition.
4. constructor-arg It is used to inject the dependencies.
5. properties It is used to inject the dependencies.
6. autowiring mode It is used to inject the dependencies.
7. lazy-initialization mode It tells the IoC container to create a bean instance when it is first requested, rather than at startup.
8. initialization method It is a callback method to be called just after all necessary properties on the bean have been set by the container.
9. destruction method It is a callback to be called when the container containing the bean is destroyed.

 

Syntax using XML based configuration file:

<bean id="..." class="..." lazy-init="true">
       //bean configuration
</bean>

 

Please follow and like us:
error

Spring Tutorial








Copyright © 2019 CodesJava DMCA.com Protection Status