KickJava   Java API By Example, From Geeks To Geeks.

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


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 org.jboss.annotation.ejb.Service;
10 import org.jboss.annotation.ejb.Depends;
11 import org.jboss.annotation.ejb.Depends;
12
13 /**
14  * @author <a HREF="mailto:kabir.khan@jboss.org">Kabir Khan</a>
15  * @version $Revision: 1.2.2.3 $
16  */

17 @Service (objectName = "tutorial:service=serviceTwo")
18 @Depends ("jboss.j2ee:name=org.jboss.tutorial.service.bean.ServiceOne,service=EJB3,type=service")
19 public class ServiceTwo implements ServiceTwoManagement
20 {
21    public String JavaDoc sayHello()
22    {
23       return "Hello from service Two";
24    }
25
26    // Lifecycle methods
27
public void start() throws Exception JavaDoc
28    {
29       System.out.println("ServiceTwo - Starting");
30    }
31
32    public void stop()
33    {
34       System.out.println("ServiceTwo - Stopping");
35    }
36 }
37
Popular Tags