1 22 package org.jboss.test.security.ejb; 23 24 import java.rmi.RemoteException ; 25 26 import javax.ejb.CreateException ; 27 import javax.ejb.EJBException ; 28 import javax.ejb.SessionBean ; 29 import javax.ejb.SessionContext ; 30 31 import org.jboss.logging.Logger; 32 33 35 41 public class UsefulStatelessSessionBean implements SessionBean 42 { 43 44 private static final long serialVersionUID = -6735401489611989066L; 45 static Logger log = Logger.getLogger(UsefulStatelessSessionBean.class); 46 private SessionContext sessionContext; 47 48 public void setSessionContext(SessionContext ctx) 49 throws EJBException , RemoteException 50 { 51 this.sessionContext = ctx; 52 } 53 54 public void ejbCreate() throws CreateException 55 { 56 log.debug("ejbCreate() called"); 57 } 58 59 public void ejbActivate() 60 { 61 log.debug("ejbActivate() called"); 62 } 63 64 public void ejbPassivate() 65 { 66 log.debug("ejbPassivate() called"); 67 } 68 69 public void ejbRemove() 70 { 71 log.debug("ejbRemove() called"); 72 } 73 74 public boolean isCallerInRole(String rolename) 76 { 77 return this.sessionContext.isCallerInRole(rolename); 78 } 79 } 80 | Popular Tags |