KickJava   Java API By Example, From Geeks To Geeks.

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


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: JCommonBean.java 106 2006-03-03 11:02:22Z benoitf $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.easybeans.deployment.annotations.impl;
27
28
29 /**
30  * Defines common methods used by Session Bean and Message Driven beans.
31  * @author Florent Benoit
32  */

33 public class JCommonBean {
34
35     /**
36      * Name of the bean.
37      */

38     private String JavaDoc name = null;
39
40     /**
41      * Mapped name (could be used as JNDI name).
42      */

43     private String JavaDoc mappedName = null;
44
45     /**
46      * Description.
47      */

48     private String JavaDoc description = null;
49
50     /**
51      * Build an object that will be shared by EJB (Session + MDB).
52      */

53     public JCommonBean() {
54
55     }
56
57     /**
58      * @return the description.
59      */

60     public String JavaDoc getDescription() {
61         return description;
62     }
63
64     /**
65      * Sets the description.
66      * @param description value of description
67      */

68     public void setDescription(final String JavaDoc description) {
69         this.description = description;
70     }
71
72     /**
73      * @return the mapped name (JNDI ?)
74      */

75     public String JavaDoc getMappedName() {
76         return mappedName;
77     }
78
79     /**
80      * Sets the mapped name.
81      * @param mappedName the value to set
82      */

83     public void setMappedName(final String JavaDoc mappedName) {
84         this.mappedName = mappedName;
85     }
86
87     /**
88      * @return name of the bean.
89      */

90     public String JavaDoc getName() {
91         return name;
92     }
93
94     /**
95      * Sets the bean name.
96      * @param name the bean's name
97      */

98     public void setName(final String JavaDoc name) {
99         this.name = name;
100     }
101
102     /**
103      * @return string representation
104      */

105     @Override JavaDoc
106     public String JavaDoc toString() {
107         StringBuilder JavaDoc sb = new StringBuilder JavaDoc();
108         // classname
109
sb.append(this.getClass().getName().substring(this.getClass().getPackage().getName().length() + 1));
110
111         // name
112
sb.append("[name=");
113         sb.append(name);
114
115         // mappedName
116
sb.append("[mappedName=");
117         sb.append(mappedName);
118
119         // description
120
sb.append("[description=");
121         sb.append(description);
122
123         sb.append("]");
124         return sb.toString();
125     }
126 }
127
Popular Tags