MCQs Test!! VB Basic Test !! Essentials of VB !! Creating User Services !! function !! Anatomy !! GK March-2019 !! DATA TYPES IN JAVA !! Classes ,Constructor ,Methods,Inheritance !! Ecology-I !! Biology 2019 !! Gk april 2019 !! Biology (living world) !! Plant anatomy !! CELL STRUCTURES AND FUNCTION !! General biology !! Human physiology !! Data structure !! Ecology-II !! GK TEST !! Reproduction in plants !! Human reproduction !! The ABC of C !! Operating system set1 !! Operating system set2 !! Gk and current affairs !! Animal kingdom !! Number system !! Animal kingdom-II !! Gk TEST-III !! Number series !! Microorganisms !! Interview question in c !! Time and Work !! Percentage !! General history !! Average !! Cells !! Locomotion and Movement !! paging !! Bacteriology !! Page replacement policy !! Secondary memory and Disk scheduling !! Introduction of Nervous System and neurons !! Plant harmones !! Transport and Mineral Nutrition in Plants !! Neurotransmitters !! Modern Indian History !! Photosynthesis in Plants !! Modern Indian History-II !! Plant respiration !! Environment & Biodiversity !! Environment & Biodiversity - II !! Algae, Bryophytes, Pteridophytes !! Area !! Cricket !! Days of the Year (India and the World) !! Plant Pathology - I !! Indian Transport System !! Plant Pathology - II !! Aptitude !! Biology !! Botany !! C language !! Computer Science !! Core Java !! Gate !! GK !! Mysql !! Operating system !! Physics !! VB-Visual Basic !! Zoology

Spring Framework

Spring Projects

Spring Project 1

Method Injection in Spring Framework
Previous Home Next

Introduction: Spring 1.1 introducing method injection for a new IOC-Oriented feature with allows greater flexibility for interactions between collaborators.

Type of Method Injection

The spring framework method injection provide this facility in to two way:

  1. Lookup Method Injection
  2. Method replacement


Lookup Method Injection: The lookup method injection provide the facility to implement in our application one bean is depends on another bean with a different life cycle. It means that singleton bean depends on non-singleton bean. In this situation setter and constructor injection create instance of singleton bean not a non-singleton bean. In some case application require singleton bean obtain new instance of the non-singleton every time it requires the bean.

If we achieve this implementation in our application the implement BeanFactoryAware interface in our singleton bean. Then using BeanFactory instance, the singleton bean can lookup a new instance of a non-singleton dependency every time it needs it.

The Lookup Method Injection allows the singleton bean to declare that it requires a non-singleton dependency and receive a new instance of the non-singleton bean each time it needs to interact with it, without needing to implement any spring-specific interfaces.

Method Replacement: This Method injection provide a facility to replace the implementation of any method on a bean arbitrary, without changing our source code.

Note: If we are use lookup method injection and method replacement in our application, the add the CGLIB jar file in our application.

Previous Home Next