KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > deployment > annotations > impl > JMessageDriven


1 /**
2  * EasyBeans
3  * Copyright (C) 2006 Bull S.A.S.
4  * Contact: easybeans@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: JMessageDriven.java 670 2006-06-18 18:13:29Z benoitf $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.easybeans.deployment.annotations.impl;
27
28 import java.util.ArrayList JavaDoc;
29 import java.util.List JavaDoc;
30
31 import javax.ejb.ActivationConfigProperty JavaDoc;
32
33 /**
34  * Acts as an implementation of @{@link javax.ejb.MessageDriven} annotation.
35  * @author Florent Benoit
36  */

37 public class JMessageDriven extends JCommonBean {
38
39     /**
40      * List of ActivationConfigProperty.
41      */

42     private List JavaDoc<ActivationConfigProperty JavaDoc> activationConfigProperties = null;
43
44     /**
45      * Message listener Interface.
46      */

47     private String JavaDoc messageListenerInterface = null;
48
49     /**
50      * Build an object which represents &#64;{@link javax.ejb.MessageDriven} object.
51      */

52     public JMessageDriven() {
53         super();
54         activationConfigProperties = new ArrayList JavaDoc<ActivationConfigProperty JavaDoc>();
55     }
56
57     /**
58      * Adds an activation config property.
59      * @param activationConfigProperty object to add in the list
60      */

61     public void addActivationConfigProperty(final ActivationConfigProperty JavaDoc activationConfigProperty) {
62         activationConfigProperties.add(activationConfigProperty);
63     }
64
65     /**
66      * Gets the activation config properties.
67      * @return the list of activation config properties
68      */

69     public List JavaDoc<ActivationConfigProperty JavaDoc> getActivationConfigProperties() {
70         return activationConfigProperties;
71     }
72
73     /**
74      * @return message listener interface.
75      */

76     public String JavaDoc getMessageListenerInterface() {
77         return messageListenerInterface;
78     }
79
80     /**
81      * Sets the message listener interface.
82      * @param messageListenerInterface the given interface.
83      */

84     public void setMessageListenerInterface(final String JavaDoc messageListenerInterface) {
85         this.messageListenerInterface = messageListenerInterface;
86     }
87
88     /**
89      * @return string representation
90      */

91     @Override JavaDoc
92     public String JavaDoc toString() {
93         StringBuilder JavaDoc sb = new StringBuilder JavaDoc();
94         // classname
95
sb.append(this.getClass().getName().substring(this.getClass().getPackage().getName().length() + 1));
96
97         sb.append(super.toString());
98
99         // messageListenerInterface
100
sb.append("[messageListenerInterface=");
101         sb.append(messageListenerInterface);
102
103         // property value
104
sb.append(", activationConfigProperties=");
105         sb.append(activationConfigProperties);
106
107         sb.append("]");
108         return sb.toString();
109     }
110 }
111
Popular Tags