1 22 package org.jboss.test.security.ejb; 23 24 import java.io.IOException ; 25 import java.security.Principal ; 26 import javax.ejb.CreateException ; 27 import javax.ejb.EJBException ; 28 import javax.ejb.SessionBean ; 29 import javax.ejb.SessionContext ; 30 import org.jboss.logging.Logger; 31 32 37 public class IOStatelessSessionBean implements SessionBean 38 { 39 static Logger log = Logger.getLogger(IOStatelessSessionBean.class); 40 41 private SessionContext sessionContext; 42 43 public void ejbCreate() throws CreateException 44 { 45 log.debug("ejbCreate() called"); 46 } 47 48 public void ejbActivate() 49 { 50 log.debug("ejbActivate() called"); 51 } 52 53 public void ejbPassivate() 54 { 55 log.debug("ejbPassivate() called"); 56 } 57 58 public void ejbRemove() 59 { 60 log.debug("ejbRemove() called"); 61 } 62 63 public void setSessionContext(SessionContext context) 64 { 65 sessionContext = context; 66 } 67 68 public String retryableRead(String path) throws IOException 69 { 70 return read(path); 71 } 72 73 public String read(String path) throws IOException 74 { 75 log.debug("read, path=" + path); 76 Principal p = sessionContext.getCallerPrincipal(); 77 log.debug("read, callerPrincipal=" + p); 78 return path; 79 } 80 81 public void write(String path) throws IOException 82 { 83 log.debug("write, path=" + path); 84 Principal p = sessionContext.getCallerPrincipal(); 85 log.debug("write, callerPrincipal=" + p); 86 } 87 } 88 | Popular Tags |