KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > freeforums > message > MessageBean


1 /*
2  * MessageBean.java
3  *
4  * Defines the message bean implementation
5  *
6  * @author: Devraj Mukherjee
7  *
8  * Created: 23rd June 2001
9  *
10  */

11
12  package freeforums.message;
13
14  import java.rmi.RemoteException JavaDoc;
15  import java.util.Date JavaDoc;
16  import javax.ejb.*;
17
18  public class MessageBean implements EntityBean {
19
20      transient private EntityContext context;
21
22      public Integer JavaDoc messageID;
23      public String JavaDoc subject;
24      public String JavaDoc description;
25      public Integer JavaDoc replyToID;
26      public Integer JavaDoc forumID;
27      public String JavaDoc attachmentFile;
28      public String JavaDoc userName;
29      public Date JavaDoc messageDate;
30
31      public Integer JavaDoc ejbCreate(Integer JavaDoc messageID, String JavaDoc subject, String JavaDoc description, Integer JavaDoc forumID, String JavaDoc userName) {
32
33          this.messageID = messageID;
34          this.subject = subject;
35          this.description = description;
36          this.forumID = forumID;
37          this.userName = userName;
38          return null;
39
40      }
41
42      public void ejbPostCreate(Integer JavaDoc messageID, String JavaDoc subject, String JavaDoc description, Integer JavaDoc forumID, String JavaDoc userName) { }
43
44      public void setEntityContext(EntityContext context) { this.context = context; }
45
46      public void unsetEntityContext() { context = null; }
47
48      public void ejbActivate() { }
49      public void ejbPassivate() { }
50      public void ejbLoad() { }
51      public void ejbStore() { }
52      public void ejbRemove() { }
53
54      /* The following are the implementation of the method from the
55         Message Remote interface
56       */

57
58      public Integer JavaDoc getMessageID() throws RemoteException JavaDoc { return messageID; }
59      public void setMessageID(Integer JavaDoc messageID) throws RemoteException JavaDoc { this.messageID = messageID; }
60
61      public String JavaDoc getSubject() throws RemoteException JavaDoc { return subject; }
62      public void setSubject(String JavaDoc subject) throws RemoteException JavaDoc { this.subject = subject; }
63
64      public String JavaDoc getDescription() throws RemoteException JavaDoc { return description; }
65      public void setDescription(String JavaDoc descrption) throws RemoteException JavaDoc { this.description = description; }
66
67      public Integer JavaDoc getReplyToID() throws RemoteException JavaDoc { return replyToID; }
68      public void setReplyToID(Integer JavaDoc replyToID) throws RemoteException JavaDoc { this.replyToID = replyToID; }
69
70      public Integer JavaDoc getForumID() throws RemoteException JavaDoc { return forumID; }
71      public void setForumID(Integer JavaDoc forumID) throws RemoteException JavaDoc { this.forumID = forumID; }
72
73      public String JavaDoc getAttachmentFile() throws RemoteException JavaDoc { return attachmentFile; }
74      public void setAttachmentFile(String JavaDoc attachmentFile) throws RemoteException JavaDoc { this.attachmentFile = attachmentFile; }
75
76      public String JavaDoc getUserName() throws RemoteException JavaDoc { return userName; }
77      public void setUserName(String JavaDoc userName) throws RemoteException JavaDoc { this.userName = userName; }
78
79      public Date JavaDoc getMessageDate() throws RemoteException JavaDoc { return messageDate; }
80      public void setMessageDate(Date JavaDoc messageDate) throws RemoteException JavaDoc { this.messageDate = messageDate; }
81
82  }
83
Popular Tags