KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > league > ejb > mdb > TopicMessageBean


1 package league.ejb.mdb;
2
3 import javax.ejb.*;
4
5 /**
6  * This is the bean class for the TopicMessageBean enterprise bean.
7  * Created Jun 4, 2005 1:59:10 AM
8  * @author jungi
9  */

10 public class TopicMessageBean implements javax.ejb.MessageDrivenBean JavaDoc, javax.jms.MessageListener JavaDoc {
11     private javax.ejb.MessageDrivenContext JavaDoc context;
12     
13     // <editor-fold defaultstate="collapsed" desc="EJB infrastructure methods. Click on the + sign on the left to edit the code.">
14

15     /**
16      * @see javax.ejb.MessageDrivenBean#setMessageDrivenContext(javax.ejb.MessageDrivenContext)
17      */

18     public void setMessageDrivenContext(javax.ejb.MessageDrivenContext JavaDoc aContext) {
19         context = aContext;
20     }
21     
22     /**
23      * See section 15.4.4 of the EJB 2.0 specification
24      * See section 15.7.3 of the EJB 2.1 specification
25      */

26     public void ejbCreate() {
27         // TODO Add code to acquire and use other enterprise resources (DataSource, JMS, enterprise bean, Web services)
28
}
29     
30     /**
31      * @see javax.ejb.MessageDrivenBean#ejbRemove()
32      */

33     public void ejbRemove() {
34         // TODO release any resource acquired in ejbCreate.
35
// The code here should handle the possibility of not getting invoked
36
// See section 15.7.3 of the EJB 2.1 specification
37
}
38     
39     // </editor-fold>
40

41     public void onMessage(javax.jms.Message JavaDoc aMessage) {
42         // TODO handle incoming message
43
// typical implementation will delegate to session bean or application service
44
}
45     
46 }
47
Popular Tags