1 22 package org.jboss.ejb3.test.standalone.servicepojo; 23 24 import org.jboss.annotation.ejb.Service; 25 26 32 @Service 33 public class ServiceTwoBean implements ServiceTwoLocal, ServiceTwoManagement 34 { 35 int state = 0; 36 int attribute; 37 38 public void setAttribute(int attribute) 39 { 40 this.attribute = attribute; 41 } 42 43 public int getAttribute() 44 { 45 return this.attribute; 46 } 47 48 public int getState() 49 { 50 return state; 51 } 52 53 public String sayHello(String name) 54 { 55 return "Hello " + name; 56 } 57 58 public void create() throws Exception 60 { 61 System.out.println("ServiceTwo - Creating"); 62 state++; 63 } 64 65 public void start() throws Exception 66 { 67 System.out.println("ServiceTwo - Starting"); 68 state++; 69 } 70 71 public void stop() 72 { 73 System.out.println("ServiceTwo - Stopping"); 74 state--; 75 } 76 77 public void destroy() 78 { 79 System.out.println("ServiceTwo - Destroying"); 80 state--; 81 } 82 } 83 | Popular Tags |