KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > freeforums > user > ForumUserBean


1 /*
2  * ForumUserBean.java
3  *
4  * Form User Bean implementation
5  *
6  * @author: Devraj Mukherjee
7  *
8  * Created: 23rd June 2001
9  *
10  */

11
12  package freeforums.user;
13
14  import java.rmi.RemoteException JavaDoc;
15  import javax.ejb.*;
16
17  public class ForumUserBean implements EntityBean {
18
19      transient private EntityContext context;
20
21      public ForumUserPK key;
22      public boolean administrator;
23
24      public ForumUserPK ejbCreate(ForumUserPK key, boolean administrator) {
25
26          this.key = key;
27          this.administrator = administrator;
28          return null;
29
30      }
31
32      public ForumUserPK ejbCreate(ForumUserPK key) {
33
34          this.key = key;
35          this.administrator = false;
36          return null;
37
38      }
39
40      public void ejbPostCreate(ForumUserPK key, boolean administrator) { }
41      public void ejbPostCreate(ForumUserPK key) { }
42
43      public void setEntityContext(EntityContext context) { this.context = context; }
44
45      public void unsetEntityContext() { context = null; }
46
47      public void ejbActivate() { }
48      public void ejbPassivate() { }
49      public void ejbLoad() { }
50      public void ejbStore() { }
51      public void ejbRemove() { }
52
53      /* The following are the implementation of the method from the
54         ForumUser Remote interface
55       */

56
57      public String JavaDoc getUserName() throws RemoteException JavaDoc { return key.userName; }
58      public void setUserName(String JavaDoc userName) throws RemoteException JavaDoc { key.userName = userName; }
59
60      public Integer JavaDoc getForumID() throws RemoteException JavaDoc { return key.forumID; }
61      public void setForumID(Integer JavaDoc forumID) throws RemoteException JavaDoc { key.forumID = forumID; }
62
63      public boolean isAdministrator() throws RemoteException JavaDoc { return administrator; }
64      public void setAdministrator(boolean administrator) throws RemoteException JavaDoc { this.administrator = administrator; }
65
66 }
Popular Tags