org.jboss.security
Class SubjectSecurityProxy

java.lang.Object
  extended by org.jboss.security.AbstractSecurityProxy
      extended by org.jboss.security.SubjectSecurityProxy
All Implemented Interfaces:
SecurityProxy

public class SubjectSecurityProxy
extends AbstractSecurityProxy

A subclass of AbstractSecurityProxy that executes as the currently authenticated subject within the invokeHomeOnDelegate and invokeOnDelegate methods. The current subject is accessed via the security manager passed to the init() method, which must be an instance of SubjectSecurityManager. This results in AccessController.checkPermission() calls made from within the security delegate methods to be based on the Subject's permissions. This is just an experiment with the JAAS Subject based permissions.

Version:
$Revision: 1.8.6.1 $
Author:
Scott.Stark@jboss.org
See Also:
Subject, SubjectSecurityManager

Field Summary
 
Fields inherited from class org.jboss.security.AbstractSecurityProxy
delegate, strict
 
Method Summary
 void init(Class beanHome, Class beanRemote, Class beanLocalHome, Class beanLocal, Object securityMgr)
          This method is called by the container SecurityInterceptor to intialize the proxy with the EJB home and remote interface classes that the container is housing.
 void init(Class beanHome, Class beanRemote, Object securityMgr)
          This version invokes init(beanHome, beanRemote, null, null, securityMgr)
protected  void invokeHomeOnDelegate(Method m, Object[] args, Object delegate)
          Subclasses implement this method to actually invoke the given home method on the proxy delegate.
protected  void invokeOnDelegate(Method m, Object[] args, Object delegate)
          Subclasses implement this method to actually invoke the given remote method on the proxy delegate.
 
Methods inherited from class org.jboss.security.AbstractSecurityProxy
invoke, invokeHome, mapHomeMethods, mapRemoteMethods, setEJBContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

init

public void init(Class beanHome,
                 Class beanRemote,
                 Object securityMgr)
          throws InstantiationException
Description copied from class: AbstractSecurityProxy
This version invokes init(beanHome, beanRemote, null, null, securityMgr)

Specified by:
init in interface SecurityProxy
Overrides:
init in class AbstractSecurityProxy
Parameters:
beanHome - The EJB remote home interface class
beanRemote - The EJB remote interface class
securityMgr - The security manager from the security domain
Throws:
InstantiationException
See Also:
AbstractSecurityProxy.init(Class, Class, Class, Class, Object)

init

public void init(Class beanHome,
                 Class beanRemote,
                 Class beanLocalHome,
                 Class beanLocal,
                 Object securityMgr)
          throws InstantiationException
Description copied from class: AbstractSecurityProxy
This method is called by the container SecurityInterceptor to intialize the proxy with the EJB home and remote interface classes that the container is housing. This method creates a mapping from the home and remote classes to the proxy delegate instance. The mapping is based on method name and paramter types. In addition, the proxy delegate is inspected for a setEJBContext(EJBContext) and a setBean(Object) method so that the active EJBContext and EJB instance can be passed to the delegate prior to method invocations.

Specified by:
init in interface SecurityProxy
Overrides:
init in class AbstractSecurityProxy
Parameters:
beanHome - The EJB remote home interface class
beanRemote - The EJB remote interface class
beanLocalHome - The EJB local home interface class
beanLocal - The EJB local interface class
securityMgr - The security manager from the security domain
Throws:
InstantiationException

invokeHomeOnDelegate

protected void invokeHomeOnDelegate(Method m,
                                    Object[] args,
                                    Object delegate)
                             throws SecurityException
Description copied from class: AbstractSecurityProxy
Subclasses implement this method to actually invoke the given home method on the proxy delegate.

Specified by:
invokeHomeOnDelegate in class AbstractSecurityProxy
Throws:
SecurityException
See Also:
AbstractSecurityProxy.invokeHome(Method, Object[])

invokeOnDelegate

protected void invokeOnDelegate(Method m,
                                Object[] args,
                                Object delegate)
                         throws Exception
Description copied from class: AbstractSecurityProxy
Subclasses implement this method to actually invoke the given remote method on the proxy delegate.

Specified by:
invokeOnDelegate in class AbstractSecurityProxy
Throws:
Exception
See Also:
AbstractSecurityProxy.invoke(Method, Object[], Object)


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.