`LocalRemoteCalculator.java`
`01 package trail.slsb; 02 03 import org.jboss.annotation.ejb.LocalBinding; 04 import org.jboss.annotation.ejb.RemoteBinding; 05 06 import javax.ejb.*; 07 08 @Stateless 09 @Local ({Calculator.class}) 10 @LocalBinding (jndiBinding="EJB3Trail/LocalCalculator") 11 @Remote ({RemoteCalculator.class}) 12 @RemoteBinding (jndiBinding="EJB3Trail/RemoteCalculator") 13 public class LocalRemoteCalculator implements Calculator, RemoteCalculator { 14 15 public double calculate (int start, int end, double growthrate, double saving) { 16 double tmp = Math.pow(1. + growthrate / 12., 12. * (end - start) + 1); 17 return saving * 12. * (tmp - 1) / growthrate; 18 } 19 20 public String getServerInfo () { 21 return "This is the JBoss EJB 3.0 Trail Blazer"; 22 } 23 24 }`