KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > jbossnet > ejbsimple > server > HelloLocalBean


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7
8 package org.jboss.test.jbossnet.ejbsimple.server;
9
10 import javax.ejb.EJBException JavaDoc;
11
12 import org.jboss.test.util.ejb.SessionSupport;
13
14 import org.jboss.test.jbossnet.ejbsimple.HelloData;
15 import org.w3c.dom.Element JavaDoc;
16
17 /**
18  * The typical Hello Session Bean this time
19  * as a web-service.
20  * @author jung
21  * @version $Revision: 1.1.1.1 $
22  * @ejb.bean name="HelloLocal"
23  * display-name="Hello World Bean Local"
24  * type="Stateless"
25  * view-type="local"
26  * local-jndi-name="hello/HelloLocal"
27  * @ejb.transaction type="Required"
28  * @jboss-net.web-service urn="HelloLocal"
29  * @ejb.interface local-class="org.jboss.test.jbossnet.ejbsimple.server.HelloLocal" local-extends="javax.ejb.EJBLocalObject"
30  * @ejb.home local-class="org.jboss.test.jbossnet.ejbsimple.server.HelloLocalHome" local-extends="javax.ejb.EJBLocalHome"
31  */

32
33 public class HelloLocalBean
34    extends SessionSupport
35    implements javax.ejb.SessionBean JavaDoc {
36    /**
37     * @jboss-net.web-method
38     * @ejb.interface-method view-type="local"
39     */

40
41    public String JavaDoc hello(String JavaDoc name) {
42       return "Hello " + name + "!";
43    }
44
45    /**
46     * @jboss-net.web-method
47     * @ejb.interface-method view-type="local"
48     */

49
50    public String JavaDoc howdy(HelloData name) {
51       return "Howdy " + name.getName() + "!";
52    }
53
54    /**
55     * @jboss-net.web-method
56     * @ejb.interface-method view-type="local"
57     */

58
59    public void throwException() {
60       throw new EJBException JavaDoc("Something went wrong");
61    }
62
63    /**
64     * @jboss-net:web-method
65     * @ejb:interface-method view-type="local"
66     */

67    public Object JavaDoc[] arrays(Object JavaDoc[] values) {
68       return values;
69    }
70
71    /**
72     * @jboss-net:web-method
73     * @ejb:interface-method view-type="local"
74     */

75    public Object JavaDoc[] reverse(Object JavaDoc[] values) {
76       Object JavaDoc[] result = new Object JavaDoc[values.length];
77       for (int i = 0; i < values.length; ++i)
78          result[i] = values[values.length - i - 1];
79       return result;
80    }
81
82    /**
83     * @jboss-net:web-method
84     * @ejb:interface-method view-type="local"
85     */

86    public HelloData[] typedArrays(HelloData[] values) {
87       return values;
88    }
89    
90    /**
91     * @jboss-net.web-method
92     * @ejb.interface-method view-type="local"
93     */

94
95    public Element JavaDoc element(Element JavaDoc in) {
96       return in;
97    }
98 }
99
Popular Tags