1 7 package org.jboss.ejb3.test.simplecluster; 8 9 import javax.ejb.Remote ; 10 import javax.ejb.Stateful ; 11 import org.jboss.annotation.ejb.Clustered; 12 import org.jboss.system.server.ServerConfig; 13 14 20 @Stateful  21 @Clustered 22 @Remote (StatefulRemote.class) 23 public class StatefulBean implements java.io.Serializable , StatefulRemote 24 { 25 private int state = 0; 26 27 public int increment() 28 { 29 System.out.println("INCREMENT - counter: " + (state++)); 30 return state; 31 } 32 33 public String getHostAddress() 34 { 35 return System.getProperty(ServerConfig.SERVER_BIND_ADDRESS); 36 } 37 } 38 | Popular Tags |