1 package example;2 3 import javax.annotation.Resource;4 5 import javax.ejb.Stateless ;6 import javax.ejb.TransactionAttribute ;7 import static javax.ejb.TransactionAttributeType.SUPPORTS ;8 9 /**10 * Implementation of the Hello bean.11 */12 @Stateless 13 public class HelloBean implements Hello {14 private String _greeting = "Default Hello";15 16 /**17 * Injector to set the greeting.18 */19 @Resource20 public void setGreeting(String greeting)21 {22 _greeting = greeting;23 }24 25 /**26 * Returns a hello, world string.27 */28 @TransactionAttribute (SUPPORTS)29 public String hello()30 {31 return _greeting;32 }33 }34