KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > ejb3 > test > clusteredsession > ClusteredStatelessSessionBean


1 /*
2  * JBoss, Home of Professional Open Source
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7
8 package org.jboss.ejb3.test.clusteredsession;
9
10 import org.jboss.annotation.ejb.Clustered;
11 import org.jboss.ha.framework.interfaces.RoundRobin;
12
13 import javax.ejb.Stateless JavaDoc;
14 import javax.ejb.Remote JavaDoc;
15 import java.rmi.dgc.VMID JavaDoc;
16
17 /**
18  * Simple statless bean
19  *
20  * @author Ben Wang
21  */

22 @Stateless JavaDoc(name="clusteredStateless")
23 @Clustered(loadBalancePolicy = RoundRobin.class)
24 @Remote JavaDoc(ClusteredStatelessRemote.class)
25 public class ClusteredStatelessSessionBean implements ClusteredStatelessRemote
26 {
27    public transient VMID JavaDoc myId = null;
28    public NodeAnswer getNodeState() {
29       if(myId == null)
30       {
31          myId = new VMID JavaDoc();
32       }
33       return new NodeAnswer(this.myId, "test");
34    }
35 }
36
Popular Tags