001: /**
002: * EasyBeans
003: * Copyright (C) 2006 Bull S.A.S.
004: * Contact: easybeans@ow2.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * --------------------------------------------------------------------------
022: * $Id: JEjbEJB.java 1970 2007-10-16 11:49:25Z benoitf $
023: * --------------------------------------------------------------------------
024: */package org.ow2.easybeans.deployment.annotations.impl;
025:
026: /**
027: * Acts as an implementation of @{@link javax.ejb.EJB} annotation.
028: * @author Florent Benoit
029: */
030: public class JEjbEJB {
031:
032: /**
033: * Name (resource to be looked up).
034: */
035: private String name = null;
036:
037: /**
038: * Business or home Interface.
039: */
040: private String beanInterface = null;
041:
042: /**
043: * Bean name (Name of stateless, stateful, etc. or ejb-name).
044: */
045: private String beanName = null;
046:
047: /**
048: * mapped name.
049: */
050: private String mappedName = null;
051:
052: /**
053: * Constructor.<br>
054: * Build object with default values.
055: */
056: public JEjbEJB() {
057: this .name = "";
058: this .beanName = "";
059: this .mappedName = null;
060: }
061:
062: /**
063: * @return Name (resource to be looked up).
064: */
065: public String getName() {
066: return name;
067: }
068:
069: /**
070: * Sets Name (resource to be looked up).
071: * @param name the given name.
072: */
073: public void setName(final String name) {
074: this .name = name;
075: }
076:
077: /**
078: * @return Bean name (Name of stateless, stateful, etc. or ejb-name).
079: */
080: public String getBeanName() {
081: return beanName;
082: }
083:
084: /**
085: * Sets bean name (Name of stateless, stateful, etc. or ejb-name).
086: * @param beanName the given name.
087: */
088: public void setBeanName(final String beanName) {
089: this .beanName = beanName;
090: }
091:
092: /**
093: * @return business or home Interface.
094: */
095: public String getBeanInterface() {
096: return beanInterface;
097: }
098:
099: /**
100: * Sets the business or home Interface.
101: * @param beanInterface the given interface.
102: */
103: public void setBeanInterface(final String beanInterface) {
104: this .beanInterface = beanInterface;
105: }
106:
107: /**
108: * @return MappedName.
109: */
110: public String getMappedName() {
111: return mappedName;
112: }
113:
114: /**
115: * Sets mapped Name.
116: * @param mappedName the given mappedName.
117: */
118: public void setMappedName(final String mappedName) {
119: this .mappedName = mappedName;
120: }
121:
122: /**
123: * @return string representation
124: */
125: @Override
126: public String toString() {
127: StringBuilder sb = new StringBuilder();
128: // classname
129: sb.append(this .getClass().getName().substring(
130: this .getClass().getPackage().getName().length() + 1));
131:
132: // name
133: sb.append("[name=");
134: sb.append(name);
135:
136: // mappedName
137: sb.append(", mappedName=");
138: sb.append(mappedName);
139:
140: // beanInterface
141: sb.append(", beanInterface=");
142: sb.append(beanInterface);
143:
144: // property value
145: sb.append(", beanName=");
146: sb.append(beanName);
147:
148: sb.append("]");
149: return sb.toString();
150: }
151: }
|