1 7 package jfox.test.ejb3.callback; 8 9 import javax.ejb.Local ; 10 import javax.ejb.Remote ; 11 import javax.ejb.Stateless ; 12 import javax.annotation.PostConstruct; 13 import javax.annotation.PreDestroy; 14 15 @Stateless (name = "callback.CalculatorBean") 16 @Remote 17 @Local 18 public class CalculatorBean extends AbstractCalculatorBean { 19 20 public int add(int x, int y) { 21 return x + y; 22 } 23 24 public int subtract(int x, int y) { 25 return x - y; 26 } 27 28 @PostConstruct 29 public void postConstruct(){ 30 System.out.println(this.getClass().getName() + ".postConstruct!"); 31 } 32 33 @PreDestroy 34 public void preDestroy(){ 35 System.out.println(this.getClass().getName() + ".preDestroy!"); 36 } 37 } 38 | Popular Tags |