1 7 package org.jboss.tutorial.service.bean; 8 9 import javax.ejb.Local ; 10 import javax.ejb.Remote ; 11 import org.jboss.annotation.ejb.Service; 12 13 14 18 @Service 19 @Local (ServiceOneLocal.class) 20 @Remote (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 sayHello() 36 { 37 return "Hello from service One"; 38 } 39 40 public void create() throws Exception 42 { 43 System.out.println("ServiceOne - Creating"); 44 } 45 46 public void start() throws Exception 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 |