KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jfox > test > ejb3 > callback > CalculatorBean


1 /*
2  * JFox - The most lightweight Java EE Application Server!
3  * more details please visit http://www.huihoo.org/jfox or http://www.jfox.org.cn.
4  *
5  * JFox is licenced and re-distributable under GNU LGPL.
6  */

7 package jfox.test.ejb3.callback;
8
9 import javax.ejb.Local JavaDoc;
10 import javax.ejb.Remote JavaDoc;
11 import javax.ejb.Stateless JavaDoc;
12 import javax.annotation.PostConstruct;
13 import javax.annotation.PreDestroy;
14
15 @Stateless JavaDoc(name = "callback.CalculatorBean")
16 @Remote JavaDoc
17 @Local JavaDoc
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