KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > ejb3 > dd > MessageDrivenBean


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7 package org.jboss.ejb3.dd;
8
9 import javax.ejb.TransactionManagementType JavaDoc;
10
11 import org.jboss.ejb3.tx.TxUtil;
12 import org.jboss.logging.Logger;
13
14 /**
15  * Represents a message-driven element of the ejb-jar.xml deployment descriptor for
16  * the 1.4 schema
17  *
18  * @version <tt>$Revision: 1.2.2.1 $</tt>
19  * @author <a HREF="mailto:bdecoste@jboss.com">William DeCoste</a>
20  */

21 public class MessageDrivenBean extends EnterpriseBean
22 {
23    private static final Logger log = Logger.getLogger(MessageDrivenBean.class);
24
25    public static final String JavaDoc BEAN = "Bean";
26
27    public static final String JavaDoc CONTAINER = "Container";
28
29    // ejb-jar.xml
30
private String JavaDoc acknowledgeMode;
31
32    private String JavaDoc transactionType;
33    
34    private MessageDrivenDestination messageDrivenDestination;
35    
36    public MessageDrivenDestination getMessageDrivenDestination()
37    {
38       return messageDrivenDestination;
39    }
40
41    public void setMessageDrivenDestination(MessageDrivenDestination messageDrivenDestination)
42    {
43       this.messageDrivenDestination = messageDrivenDestination;
44    }
45
46    public String JavaDoc getAcknowledgeMode()
47    {
48       return acknowledgeMode;
49    }
50
51    public void setAcknowledgeMode(String JavaDoc acknowledgeMode)
52    {
53       this.acknowledgeMode = acknowledgeMode;
54    }
55
56    public String JavaDoc getTransactionType()
57    {
58       return transactionType;
59    }
60
61    public void setTransactionType(String JavaDoc transactionType)
62    {
63       if (transactionType.equals(BEAN))
64          tmType = TransactionManagementType.BEAN;
65       else if (transactionType.equals(CONTAINER))
66          tmType = TransactionManagementType.CONTAINER;
67       this.transactionType = transactionType;
68    }
69
70    public String JavaDoc toString()
71    {
72       StringBuffer JavaDoc sb = new StringBuffer JavaDoc(100);
73       sb.append('[');
74       sb.append(super.toString());
75       sb.append(",");
76       sb.append("acknowledgeMode=").append(acknowledgeMode);
77       sb.append(']');
78       return sb.toString();
79    }
80 }
81
Popular Tags