KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > security > SecurityProxy


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7 package org.jboss.security;
8
9 import java.lang.reflect.Method JavaDoc;
10 import javax.ejb.EJBContext JavaDoc;
11
12 /** An interface describing the requirements for a SecurityInterceptor proxy.
13 A SecurityProxy allows for the externalization of custom security checks
14 on a per-method basis for both the EJB home and remote interface methods.
15 Custom security checks are those that cannot be described using the
16 standard EJB deployment time declarative role based security.
17
18 @author Scott.Stark@jboss.org
19 @version $Revision: 1.7 $
20 */

21 public interface SecurityProxy
22 {
23    /** Inform a proxy of the context in which it is operating.
24     * @param beanHome The EJB remote home interface class
25     * @param beanRemote The EJB remote interface class
26     * @param securityMgr The security manager from the security domain
27     * @throws InstantiationException
28     */

29    public void init(Class JavaDoc beanHome, Class JavaDoc beanRemote, Object JavaDoc securityMgr)
30       throws InstantiationException JavaDoc;
31    /** Inform a proxy of the context in which it is operating.
32     * @param beanHome The EJB remote home interface class
33     * @param beanRemote The EJB remote interface class
34     * @param beanLocalHome The EJB local home interface class, may be null
35     * @param beanLocal The EJB local interface class, may be null
36     * @param securityMgr The security manager from the security domain
37     * @throws InstantiationException
38     */

39    public void init(Class JavaDoc beanHome, Class JavaDoc beanRemote,
40       Class JavaDoc beanLocalHome, Class JavaDoc beanLocal, Object JavaDoc securityMgr)
41       throws InstantiationException JavaDoc;
42     /** Called prior to any method invocation to set the current EJB context.
43     */

44     public void setEJBContext(EJBContext JavaDoc ctx);
45     /** Called to allow the security proxy to perform any custom security
46         checks required for the EJB remote or local home interface method.
47     @param m , the EJB home or local home interface method
48     @param args , the invocation args
49     */

50     public void invokeHome(Method JavaDoc m, Object JavaDoc[] args) throws Exception JavaDoc;
51     /** Called to allow the security proxy to perform any custom security
52         checks required for the EJB remote or local interface method.
53     @param m , the EJB remote or local interface method
54     @param args , the invocation args
55     @param bean, the EJB implementation class instance
56     */

57     public void invoke(Method JavaDoc m, Object JavaDoc[] args, Object JavaDoc bean) throws Exception JavaDoc;
58 }
59
Popular Tags