KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > jbossnet > state > server > StateBean


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

7  
8 package org.jboss.test.jbossnet.state.server;
9
10 import org.jboss.test.util.ejb.SessionSupport;
11
12 /**
13  * Stateful web service to test default message scoping for stateful beans.
14  * @author jung
15  * @version $Revision: 1.1.1.1 $
16  * @ejb.bean name="State"
17  * display-name="State Count Bean"
18  * type="Stateful"
19  * view-type="remote"
20  * jndi-name="state/State"
21  * @ejb.interface remote-class="org.jboss.test.jbossnet.state.State" extends="javax.ejb.EJBObject"
22  * @ejb.home remote-class="org.jboss.test.jbossnet.state.StateHome" extends="javax.ejb.EJBHome"
23  * @ejb.transaction type="Required"
24  * @jboss-net.web-service urn="State"
25  */

26
27 public class StateBean
28    extends SessionSupport implements javax.ejb.SessionBean JavaDoc
29 {
30    protected int count=0;
31
32    /** restore count upon pooling */
33    public void ejbCreate() {
34     count=0;
35    }
36
37    /**
38     * @jboss-net.web-method
39     * @ejb.interface-method view-type="remote"
40     */

41    
42    public int count()
43    {
44       return count++;
45    }
46 }
47
Popular Tags