1 22 package org.jboss.ejb3.test.service; 23 24 import javax.management.ObjectName ; 25 import org.jboss.annotation.ejb.Depends; 26 import org.jboss.annotation.ejb.Management; 27 import org.jboss.annotation.ejb.Service; 28 29 33 @Service 34 @Management(ServiceFiveManagement.class) 35 public class ServiceFive implements ServiceFiveManagement 36 { 37 @Depends("jboss.ejb3:management=interface,with=customName,is=serviceThree") 38 public ServiceThreeManagement serviceThreeA; 39 40 @Depends("jboss.j2ee:service=EJB3,jar=service-test.jar,name=ServiceFour,type=ManagementInterface") 41 public ObjectName serviceFourA; 42 43 private ServiceThreeManagement serviceThreeB; 44 private ObjectName serviceFourB; 45 46 @Depends("jboss.ejb3:management=interface,with=customName,is=serviceThree") 47 public void setServiceThree(ServiceThreeManagement proxy) 48 { 49 serviceThreeB = proxy; 50 } 51 52 @Depends("jboss.j2ee:service=EJB3,jar=service-test.jar,name=ServiceFour,type=ManagementInterface") 53 public void setServiceFour(ObjectName on) 54 { 55 serviceFourB = on; 56 } 57 58 public void create() throws Exception 59 { 60 System.out.println("ServiceFive - CREATE"); 61 Tester.creates.add("5"); 62 } 63 64 public void start() throws Exception 65 { 66 System.out.println("ServiceFive - START"); 67 Tester.starts.add("5"); 68 } 69 70 public boolean getInjectedProxyField() 71 { 72 return serviceThreeA != null; 73 } 74 75 public boolean getInjectedObjectNameField() 76 { 77 return serviceFourA != null; 78 } 79 80 public boolean getInjectedProxyMethod() 81 { 82 return serviceThreeB != null; 83 } 84 85 public boolean getInjectedObjectNameMethod() 86 { 87 return serviceFourB != null; 88 } 89 } 90 | Popular Tags |