`MdpojoCalculator.java`
`01 package trail.mdpojo; 02 03 import org.jboss.annotation.ejb.Consumer; 04 05 import javax.ejb.*; 06 import java.sql.Timestamp; 07 08 @Consumer(activationConfig = 09 { 10 @ActivationConfigProperty(propertyName="destinationType", 11 propertyValue="javax.jms.Queue"), 12 @ActivationConfigProperty(propertyName="destination", 13 propertyValue="queue/mdpojo") 14 }) 15 public class MdpojoCalculator implements Calculator { 16 17 public void doCalculation (long sent, int start, int end, double growthrate, double saving) { 18 19 double result = calculate (start, end, growthrate, saving); 20 RecordManager.addRecord (new Timestamp(sent), result); 21 22 System.out.println ("The MD POJO is invoked"); 23 } 24 25 private double calculate (int start, int end, double growthrate, double saving) { 26 double tmp = Math.pow(1. + growthrate / 12., 12. * (end - start) + 1); 27 return saving * 12. * (tmp - 1) / growthrate; 28 } 29 30 }`