KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > tutorial > clustering > bean > 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.tutorial.clustering.bean;
8
9 import javax.ejb.Stateful JavaDoc;
10 import javax.ejb.Remote JavaDoc;
11 import org.jboss.annotation.ejb.Clustered;
12
13 /**
14  * Comment
15  *
16  * @author <a HREF="mailto:bill@jboss.org">Bill Burke</a>
17  * @version $Revision: 1.4.2.3 $
18  */

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