1 22 package org.jboss.tutorial.ssl.bean; 23 24 import org.jboss.annotation.security.SecurityDomain; 25 import org.jboss.annotation.ejb.RemoteBinding; 26 27 import javax.ejb.Stateless ; 28 import javax.ejb.Remote ; 29 import javax.ejb.TransactionAttribute ; 30 import javax.ejb.TransactionAttributeType ; 31 import javax.annotation.security.PermitAll; 32 import javax.annotation.security.RolesAllowed; 33 34 @Stateless 35 @RemoteBinding(clientBindUrl="sslsocket://0.0.0.0:3843") 36 @SecurityDomain("other") 37 public class CalculatorBean implements Calculator 38 { 39 @PermitAll 40 @TransactionAttribute (TransactionAttributeType.REQUIRES_NEW) 41 public int add(int x, int y) 42 { 43 return x + y; 44 } 45 46 @RolesAllowed({"student"}) 47 public int subtract(int x, int y) 48 { 49 return x - y; 50 } 51 52 @RolesAllowed({"teacher"}) 53 public int divide(int x, int y) 54 { 55 return x / y; 56 } 57 } 58 | Popular Tags |