1 22 package org.jboss.ejb3.test.clusteredservice; 23 import javax.ejb.Remote ; 24 import javax.ejb.Local ; 25 26 import org.jboss.annotation.ejb.Clustered; 27 import org.jboss.annotation.ejb.Depends; 28 import org.jboss.annotation.ejb.Management; 29 import org.jboss.annotation.ejb.Service; 30 import org.jboss.logging.Logger; 31 32 36 @Service(objectName = "default:service=service") 37 @Clustered(partition = "HASingletonPartition") 38 @Remote (ServiceRemote.class) 39 @Local (ServiceLocal.class) 40 @Management(ServiceManagement.class) 41 @Depends("jboss.ha:service=HASingletonDeployer,type=Barrier") 42 public class ServiceBean implements ServiceLocal, ServiceRemote, ServiceManagement 43 { 44 private static final Logger log = Logger.getLogger(ServiceBean.class); 45 46 private int remoteAccessed = 0; 47 48 public synchronized void localMethod() 49 { 50 } 51 52 public synchronized void remoteMethod() 53 { 54 log.info("ACESSSED " + ++remoteAccessed); 55 } 56 57 public void create() throws Exception 58 { 59 log.info("CREATE"); 60 } 61 62 public void start() throws Exception 63 { 64 log.info("START"); 65 } 66 67 public void stop() 68 { 69 log.info("STOP"); 70 } 71 72 public void destroy() 73 { 74 log.info("DESTROY"); 75 } 76 77 } 78 | Popular Tags |