KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > testGenerateJavaEE14 > TestMDBTopicBean


1 /*
2  * TestMDBTopicBean.java
3  *
4  * Created on {date}, {time}
5  *
6  * To change this template, choose Tools | Template Manager
7  * and open the template in the editor.
8  */

9
10 package testGenerateJavaEE14;
11
12 import javax.ejb.MessageDrivenBean JavaDoc;
13 import javax.ejb.MessageDrivenContext JavaDoc;
14 import javax.jms.Message JavaDoc;
15 import javax.jms.MessageListener JavaDoc;
16
17 /**
18  *
19  * @author {user}
20  */

21 public class TestMDBTopicBean implements MessageDrivenBean JavaDoc, MessageListener JavaDoc {
22     
23     private MessageDrivenContext JavaDoc context;
24     
25     // <editor-fold defaultstate="collapsed" desc="EJB infrastructure methods. Click on the + sign on the left to edit the code.">
26

27     /**
28      * @see javax.ejb.MessageDrivenBean#setMessageDrivenContext(javax.ejb.MessageDrivenContext)
29      */

30     public void setMessageDrivenContext(MessageDrivenContext JavaDoc aContext) {
31         context = aContext;
32     }
33     
34     /**
35      * See section 15.4.4 of the EJB 2.0 specification
36      * See section 15.7.3 of the EJB 2.1 specification
37      */

38     public void ejbCreate() {
39         // TODO Add code to acquire and use other enterprise resources (DataSource, JMS, enterprise bean, Web services)
40
}
41     
42     /**
43      * @see javax.ejb.MessageDrivenBean#ejbRemove()
44      */

45     public void ejbRemove() {
46         // TODO release any resource acquired in ejbCreate.
47
// The code here should handle the possibility of not getting invoked
48
// See section 15.7.3 of the EJB 2.1 specification
49
}
50     
51     // </editor-fold>
52

53     public void onMessage(Message JavaDoc aMessage) {
54         // TODO handle incoming message
55
// typical implementation will delegate to session bean or application service
56
}
57     
58 }
59
Popular Tags