KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2 * JBoss, Home of Professional Open Source
3 * Copyright 2005, JBoss Inc., and individual contributors as indicated
4 * by the @authors tag. See the copyright.txt in the distribution for a
5 * full listing of individual contributors.
6 *
7 * This is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this software; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 */

22 package org.jboss.ejb3.metamodel;
23
24 import javax.ejb.TransactionManagementType JavaDoc;
25 import org.jboss.logging.Logger;
26
27 /**
28  * Represents a message-driven element of the ejb-jar.xml deployment descriptor for
29  * the 1.4 schema
30  *
31  * @author <a HREF="mailto:bdecoste@jboss.com">William DeCoste</a>
32  * @version <tt>$Revision: 46471 $</tt>
33  */

34 public class MessageDrivenBean extends EnterpriseBean
35 {
36    private static final Logger log = Logger.getLogger(MessageDrivenBean.class);
37
38    public static final String JavaDoc BEAN = "Bean";
39
40    public static final String JavaDoc CONTAINER = "Container";
41
42    // ejb-jar.xml
43
private String JavaDoc acknowledgeMode;
44
45    private String JavaDoc transactionType;
46    
47    private String JavaDoc messagingType;
48    
49    private String JavaDoc resourceAdaptorName;
50
51    private MessageDrivenDestination messageDrivenDestination;
52    
53    private ActivationConfig activationConfig;
54    private ActivationConfig defaultActivationConfig;
55    
56    private String JavaDoc destinationJndiName;
57    
58    private String JavaDoc mdbUser;
59    private String JavaDoc mdbPassword;
60    private String JavaDoc mdbSubscriptionId;
61
62    private Method aroundInvoke;
63    private Method postConstruct;
64    private Method postActivate;
65    private Method preDestroy;
66    private Method prePassivate;
67    
68    public ActivationConfig getDefaultActivationConfig()
69    {
70       return defaultActivationConfig;
71    }
72
73    public void setDefaultActivationConfig(ActivationConfig defaultActivationConfig)
74    {
75       this.defaultActivationConfig = defaultActivationConfig;
76    }
77    
78    public MessageDrivenDestination getMessageDrivenDestination()
79    {
80       return messageDrivenDestination;
81    }
82
83    public void setMessageDrivenDestination(MessageDrivenDestination messageDrivenDestination)
84    {
85       this.messageDrivenDestination = messageDrivenDestination;
86    }
87    
88    public ActivationConfig getActivationConfig()
89    {
90       return activationConfig;
91    }
92
93    public void setActivationConfig(ActivationConfig activationConfig)
94    {
95       this.activationConfig = activationConfig;
96    }
97    
98    public void setDestinationJndiName(String JavaDoc name)
99    {
100       destinationJndiName = name;
101    }
102    
103    public String JavaDoc getDestinationJndiName()
104    {
105       return destinationJndiName;
106    }
107
108    public String JavaDoc getAcknowledgeMode()
109    {
110       return acknowledgeMode;
111    }
112
113    public void setAcknowledgeMode(String JavaDoc acknowledgeMode)
114    {
115       this.acknowledgeMode = acknowledgeMode;
116    }
117    
118    public String JavaDoc getMessagingType()
119    {
120       return messagingType;
121    }
122
123    public void setMessagingType(String JavaDoc messagingType)
124    {
125       this.messagingType = messagingType;
126    }
127    
128    public String JavaDoc getResourceAdaptorName()
129    {
130       return resourceAdaptorName;
131    }
132
133    public void setResourceAdaptorName(String JavaDoc resourceAdaptorName)
134    {
135       this.resourceAdaptorName = resourceAdaptorName;
136    }
137
138    public String JavaDoc getTransactionType()
139    {
140       return transactionType;
141    }
142
143    public void setTransactionType(String JavaDoc transactionType)
144    {
145       if (transactionType.equals(BEAN))
146          tmType = TransactionManagementType.BEAN;
147       else if (transactionType.equals(CONTAINER))
148          tmType = TransactionManagementType.CONTAINER;
149       this.transactionType = transactionType;
150    }
151    
152    public String JavaDoc getMdbPassword()
153    {
154       return mdbPassword;
155    }
156
157    public void setMdbPassword(String JavaDoc mdbPassword)
158    {
159       this.mdbPassword = mdbPassword;
160    }
161
162    public String JavaDoc getMdbUser()
163    {
164       return mdbUser;
165    }
166
167    public void setMdbUser(String JavaDoc mdbUser)
168    {
169       this.mdbUser = mdbUser;
170    }
171    
172    public String JavaDoc getMdbSubscriptionId()
173    {
174       return mdbSubscriptionId;
175    }
176
177    public void setMdbSubscriptionId(String JavaDoc mdbSubscriptionId)
178    {
179       this.mdbSubscriptionId = mdbSubscriptionId;
180    }
181
182    public Method getAroundInvoke()
183    {
184       return aroundInvoke;
185    }
186
187    public void setAroundInvoke(Method aroundInvoke)
188    {
189       this.aroundInvoke = aroundInvoke;
190    }
191
192    public Method getPostConstruct()
193    {
194       return postConstruct;
195    }
196
197    public void setPostConstruct(Method postConstruct)
198    {
199       this.postConstruct = postConstruct;
200    }
201
202    public Method getPreDestroy()
203    {
204       return preDestroy;
205    }
206
207    public void setPreDestroy(Method preDestroy)
208    {
209       this.preDestroy = preDestroy;
210    }
211    
212    public String JavaDoc toString()
213    {
214       StringBuffer JavaDoc sb = new StringBuffer JavaDoc(100);
215       sb.append("[MessageDrivenBean:");
216       sb.append(super.toString());
217       sb.append(",");
218       sb.append("acknowledgeMode=").append(acknowledgeMode);
219       sb.append("destination=").append(messageDrivenDestination);
220       sb.append("messagingType=").append(messagingType);
221       sb.append(']');
222       return sb.toString();
223    }
224 }
225
Popular Tags