KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > ejb3 > test > simplecluster > StatefulBean


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.ejb3.test.simplecluster;
8
9 import javax.ejb.Remote JavaDoc;
10 import javax.ejb.Stateful JavaDoc;
11 import org.jboss.annotation.ejb.Clustered;
12 import org.jboss.system.server.ServerConfig;
13
14 /**
15  * Comment
16  *
17  * @author <a HREF="mailto:bill@jboss.org">Bill Burke</a>
18  * @version $Revision: 1.3.2.2 $
19  */

20 @Stateful JavaDoc
21 @Clustered
22 @Remote JavaDoc(StatefulRemote.class)
23 public class StatefulBean implements java.io.Serializable JavaDoc, StatefulRemote
24 {
25    private int state = 0;
26
27    public int increment()
28    {
29       System.out.println("INCREMENT - counter: " + (state++));
30       return state;
31    }
32    
33    public String JavaDoc getHostAddress()
34    {
35       return System.getProperty(ServerConfig.SERVER_BIND_ADDRESS);
36    }
37 }
38
Popular Tags