KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > security > ejb > MissingMethodBean


1 package org.jboss.test.security.ejb;
2
3 import org.jboss.logging.Logger;
4
5 import javax.ejb.SessionBean JavaDoc;
6 import javax.ejb.SessionContext JavaDoc;
7 import javax.ejb.CreateException JavaDoc;
8 import java.security.Principal JavaDoc;
9
10 /** A simple session bean that is used to test the
11
12  @author Scott.Stark@jboss.org
13  @version $Revision: 58115 $
14  */

15 public class MissingMethodBean implements SessionBean JavaDoc
16 {
17    private static Logger log = Logger.getLogger(MissingMethodBean.class);
18    private SessionContext JavaDoc sessionContext;
19
20    public void ejbCreate() throws CreateException JavaDoc
21    {
22       MissingMethodBean.log.debug("ejbCreate() called");
23    }
24
25    public void ejbActivate()
26    {
27       MissingMethodBean.log.debug("ejbActivate() called");
28    }
29
30    public void ejbPassivate()
31    {
32       MissingMethodBean.log.debug("ejbPassivate() called");
33    }
34
35    public void ejbRemove()
36    {
37       MissingMethodBean.log.debug("ejbRemove() called");
38    }
39
40    public void setSessionContext(SessionContext JavaDoc context)
41    {
42       sessionContext = context;
43    }
44
45    public String JavaDoc invokeEcho(String JavaDoc arg)
46    {
47       log.debug("invokeEcho, arg="+arg);
48       Principal JavaDoc p = sessionContext.getCallerPrincipal();
49       log.debug("echo, callerPrincipal="+p);
50       boolean isCaller = sessionContext.isCallerInRole("EchoCaller");
51       log.debug("echo, isCallerInRole('EchoCaller')="+isCaller);
52       isCaller = sessionContext.isCallerInRole("InternalRole");
53       log.debug("echo, isCallerInRole('InternalRole')="+isCaller);
54       return arg;
55    }
56
57    public void callEcho()
58    {
59       log.debug("callEcho");
60    }
61
62    public void noop()
63    {
64       log.debug("noop");
65    }
66 }
67
Popular Tags