KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ejb > AccountStateBean


1 package ejb;
2
3 import javax.ejb.*;
4
5 /**
6  * This is the bean class for the AccountStateBean enterprise bean.
7  * Created May 25, 2005 11:29:11 AM
8  * @author blaha
9  */

10 public class AccountStateBean implements javax.ejb.SessionBean JavaDoc, ejb.AccountStateRemoteBusiness, ejb.AccountStateLocalBusiness {
11     private javax.ejb.SessionContext JavaDoc context;
12     private static final float amount = 250.0f;
13     
14     // <editor-fold defaultstate="collapsed" desc="EJB infrastructure methods. Click the + sign on the left to edit the code.">
15
// TODO Add code to acquire and use other enterprise resources (DataSource, JMS, enterprise bean, Web services)
16
// TODO Add business methods or web service operations
17
/**
18      * @see javax.ejb.SessionBean#setSessionContext(javax.ejb.SessionContext)
19      */

20     public void setSessionContext(javax.ejb.SessionContext JavaDoc aContext) {
21         context = aContext;
22     }
23     
24     /**
25      * @see javax.ejb.SessionBean#ejbActivate()
26      */

27     public void ejbActivate() {
28         
29     }
30     
31     /**
32      * @see javax.ejb.SessionBean#ejbPassivate()
33      */

34     public void ejbPassivate() {
35         
36     }
37     
38     /**
39      * @see javax.ejb.SessionBean#ejbRemove()
40      */

41     public void ejbRemove() {
42         
43     }
44     // </editor-fold>
45

46     /**
47      * See section 7.10.3 of the EJB 2.0 specification
48      * See section 7.11.3 of the EJB 2.1 specification
49      */

50     public void ejbCreate() {
51         // TODO implement ejbCreate if necessary, acquire resources
52
// This method has access to the JNDI context so resource aquisition
53
// spanning all methods can be performed here such as home interfaces
54
// and data sources.
55
}
56     
57     
58     
59     // Add business logic below. (Right-click in editor and choose
60
// "EJB Methods > Add Business Method" or "Web Service > Add Operation")
61

62     public String JavaDoc getStatus(java.lang.String JavaDoc user) {
63         //TODO implement getStatus
64
return "In the account " + user + " is " + amount + " $";
65     }
66     
67     
68     
69 }
70
Popular Tags