KickJava   Java API By Example, From Geeks To Geeks.

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


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 application-level scoping.
14  * @author jung
15  * @version $Revision: 1.1.1.1 $
16  * @ejb.bean name="FullState"
17  * display-name="Appication-level Stateful Count Bean"
18  * type="Stateful"
19  * view-type="remote"
20  * jndi-name="state/FullState"
21  * @ejb.interface remote-class="org.jboss.test.jbossnet.state.FullState" extends="javax.ejb.EJBObject"
22  * @ejb.home remote-class="org.jboss.test.jbossnet.state.FullStateHome" extends="javax.ejb.EJBHome"
23  * @ejb.transaction type="Required"
24  * @jboss-net.web-service urn="FullState" scope="Application"
25  */

26
27 public class FullStateBean
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