KickJava   Java API By Example, From Geeks To Geeks.

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


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: JEjbEJB.java 410 2006-04-25 14:58:06Z benoitf $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.easybeans.deployment.annotations.impl;
27
28
29 /**
30  * Acts as an implementation of @{@link javax.ejb.EJB} annotation.
31  * @author Florent Benoit
32  */

33 public class JEjbEJB {
34
35     /**
36      * Name (resource to be looked up).
37      */

38     private String JavaDoc name = null;
39
40     /**
41      * Business or home Interface.
42      */

43     private String JavaDoc beanInterface = null;
44
45     /**
46      * Bean name (Name of stateless, stateful, etc. or ejb-name).
47      */

48     private String JavaDoc beanName = null;
49
50     /**
51      * mapped name.
52      */

53     private String JavaDoc mappedName = null;
54
55
56     /**
57      * Constructor.<br>
58      * Build object with default values.
59      */

60     public JEjbEJB() {
61         this.name = "";
62         this.beanName = "";
63         this.mappedName = null;
64     }
65
66     /**
67      * @return Name (resource to be looked up).
68      */

69     public String JavaDoc getName() {
70         return name;
71     }
72
73     /**
74      * Sets Name (resource to be looked up).
75      * @param name the given name.
76      */

77     public void setName(final String JavaDoc name) {
78         this.name = name;
79     }
80
81     /**
82      * @return Bean name (Name of stateless, stateful, etc. or ejb-name).
83      */

84     public String JavaDoc getBeanName() {
85         return beanName;
86     }
87
88     /**
89      * Sets bean name (Name of stateless, stateful, etc. or ejb-name).
90      * @param beanName the given name.
91      */

92     public void setBeanName(final String JavaDoc beanName) {
93         this.beanName = beanName;
94     }
95
96
97     /**
98      * @return business or home Interface.
99      */

100     public String JavaDoc getBeanInterface() {
101         return beanInterface;
102     }
103
104     /**
105      * Sets the business or home Interface.
106      * @param beanInterface the given interface.
107      */

108     public void setBeanInterface(final String JavaDoc beanInterface) {
109         this.beanInterface = beanInterface;
110     }
111
112
113     /**
114      * @return MappedName.
115      */

116     public String JavaDoc getMappedName() {
117         return mappedName;
118     }
119
120     /**
121      * Sets mapped Name.
122      * @param mappedName the given mappedName.
123      */

124     public void setMappedName(final String JavaDoc mappedName) {
125         this.mappedName = mappedName;
126     }
127
128     /**
129      * @return string representation
130      */

131     @Override JavaDoc
132     public String JavaDoc toString() {
133         StringBuilder JavaDoc sb = new StringBuilder JavaDoc();
134         // classname
135
sb.append(this.getClass().getName().substring(this.getClass().getPackage().getName().length() + 1));
136
137         // name
138
sb.append("[name=");
139         sb.append(name);
140
141         // mappedName
142
sb.append(", mappedName=");
143         sb.append(mappedName);
144
145         // beanInterface
146
sb.append(", beanInterface=");
147         sb.append(beanInterface);
148
149         // property value
150
sb.append(", beanName=");
151         sb.append(beanName);
152
153         sb.append("]");
154         return sb.toString();
155     }
156 }
157
Popular Tags