KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > tutorial > service > bean > ServiceOne


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

7 package org.jboss.tutorial.service.bean;
8
9 import javax.ejb.Local JavaDoc;
10 import javax.ejb.Remote JavaDoc;
11 import org.jboss.annotation.ejb.Service;
12
13
14 /**
15  * @author <a HREF="mailto:kabir.khan@jboss.org">Kabir Khan</a>
16  * @version $Revision: 1.3.2.3 $
17  */

18 @Service
19 @Local JavaDoc(ServiceOneLocal.class)
20 @Remote JavaDoc(ServiceOneRemote.class)
21 public class ServiceOne implements ServiceOneLocal, ServiceOneRemote, ServiceOneManagement
22 {
23    int attribute;
24
25    public void setAttribute(int attribute)
26    {
27       this.attribute = attribute;
28    }
29
30    public int getAttribute()
31    {
32       return this.attribute;
33    }
34
35    public String JavaDoc sayHello()
36    {
37       return "Hello from service One";
38    }
39
40    // Lifecycle methods
41
public void create() throws Exception JavaDoc
42    {
43       System.out.println("ServiceOne - Creating");
44    }
45
46    public void start() throws Exception JavaDoc
47    {
48       System.out.println("ServiceOne - Starting");
49    }
50
51    public void stop()
52    {
53       System.out.println("ServiceOne - Stopping");
54    }
55
56    public void destroy()
57    {
58       System.out.println("ServiceOne - Destroying");
59    }
60 }
61
Popular Tags