Spring Custom Thread Scope Example

The Spring Custom Thread Scope Example show you how to create and implement a custom scope for for creating your own requirements. The need to create a Custom Scope actually depends on the problem at hand. To understand we will create a SimpleThreadScope. It implements the Scope interface which allows us to add, remove and … Read moreSpring Custom Thread Scope Example

Spring Bean Scopes example – Singleton vs Prototype

The Spring bean scopes example introduces how to use and configure bean scopes in Spring application. Bean scope is used to decide which type of bean instance should be returned from Spring container. So when we create bean definitions, we cannot only do various dependencies and configurations, but also define the scope of the bean. … Read moreSpring Bean Scopes example – Singleton vs Prototype

Spring bean Lazy loading annotation example

The Spring bean Lazy loading annotation example show you how to use @Lazy annotation together with @Component and @Autowired annotation. Spring container is eagerly loading all autowired dependencies at startup by default. In case, we want to mark a bean is lazy loading, we have to annotated @Lazy annotation on the bean as well at … Read moreSpring bean Lazy loading annotation example

Spring bean Lazy loading xml configuration example

The Spring bean Lazy loading xml configuration example show you how can lazy initialize spring beans. Spring container eagerly creates and configures all singleton beans by default. If your bean configuration is wrong Spring container throws errors and exceptions at startup time. However, you can lazy initialize spring beans at runtime by marking the bean … Read moreSpring bean Lazy loading xml configuration example

Spring exclude beans from autowiring example

The Spring exclude beans from autowiring example show you do the xml configuration to exclude beans from autowiring. In the configuration file, we add a autowire-candidate attribute which is set to false. This means that the container will excludes that specific bean from autowiring. Let’s begin: Create Autowiring Beans We create Fruit bean and autowire … Read moreSpring exclude beans from autowiring example

Please share it if you found this useful
Hide Buttons