KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > tutorial > jndibinding > 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.jndibinding.bean;
8
9 import javax.ejb.Local JavaDoc;
10 import javax.ejb.Remote JavaDoc;
11 import javax.ejb.Stateless JavaDoc;
12 import org.jboss.annotation.ejb.LocalBinding;
13 import org.jboss.annotation.ejb.RemoteBinding;
14
15 @Stateless JavaDoc
16 @RemoteBinding(jndiBinding="Calculator")
17 @LocalBinding(jndiBinding="CalculatorLocal")
18 @Remote JavaDoc(CalculatorRemote.class)
19 @Local JavaDoc(CalculatorLocal.class)
20 public class CalculatorBean implements CalculatorRemote, CalculatorLocal
21 {
22    public int add(int x, int y)
23    {
24       return x + y;
25    }
26
27    public int subtract(int x, int y)
28    {
29       return x - y;
30    }
31 }
32
Popular Tags