This topic has not yet been written. The content below is from the topic description.
This XML creates an instance of the chosen salary strategy implementation by including an additional element. This time, the AgeBasedSalaryStrategy is chosen. Next the code injects a reference to this bean into the instance of HRManager created using the HRService bean. Injection is possible because the HRManager class contains a setSalaryStrategy(SalaryStrategy strategy) method. Behind the scenes, JBoss Microcontainer calls this method on the newly created HRManager instance and passes a reference to the AgeBasedSalaryStrategy instance. The XML deployment descriptor causes the same sequence of events to occur as if you had written the following code: HRManager hrService = new HRManager(); AgeBasedSalaryStrategy ageBasedSalary = new AgeBasedSalaryStrategy(); hrService.setSalaryStrategy(ageBasedSalary);