KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > tutorial > ear > bean > CalculatorBean


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7 package org.jboss.tutorial.ear.bean;
8
9 import javax.ejb.Stateless JavaDoc;
10 import javax.ejb.Remote JavaDoc;
11 import javax.ejb.Local JavaDoc;
12
13 @Stateless JavaDoc(name="calculator")
14 @Remote JavaDoc(CalculatorRemote.class)
15 @Local JavaDoc(CalculatorLocal.class)
16 public class CalculatorBean implements CalculatorRemote, CalculatorLocal
17 {
18    public int add(int x, int y)
19    {
20       return x + y;
21    }
22
23    public int subtract(int x, int y)
24    {
25       return x - y;
26    }
27 }
28
Popular Tags