org.jboss.security
Class SubjectSecurityProxy

java.lang.Object
  extended byorg.jboss.security.AbstractSecurityProxy (src) 
      extended byorg.jboss.security.SubjectSecurityProxy
All Implemented Interfaces:
SecurityProxy (src)

public class SubjectSecurityProxy
extends AbstractSecurityProxy (src)

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.

See Also:
Subject, SubjectSecurityManager (src)

Field Summary
 
Fields inherited from class org.jboss.security.AbstractSecurityProxy (src)
delegate, strict
 
Method Summary
 void init(java.lang.Class beanHome, java.lang.Class beanRemote, java.lang.Class beanLocalHome, java.lang.Class beanLocal, java.lang.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(java.lang.Class beanHome, java.lang.Class beanRemote, java.lang.Object securityMgr)
          This version invokes init(beanHome, beanRemote, null, null, securityMgr)
protected  void invokeHomeOnDelegate(java.lang.reflect.Method m, java.lang.Object[] args, java.lang.Object delegate)
          Subclasses implement this method to actually invoke the given home method on the proxy delegate.
protected  void invokeOnDelegate(java.lang.reflect.Method m, java.lang.Object[] args, java.lang.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 (src)
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(java.lang.Class beanHome,
                 java.lang.Class beanRemote,
                 java.lang.Object securityMgr)
          throws java.lang.InstantiationException
Description copied from class: AbstractSecurityProxy (src)
This version invokes init(beanHome, beanRemote, null, null, securityMgr)

Specified by:
init in interface SecurityProxy (src)
Overrides:
init in class AbstractSecurityProxy (src)
Throws:
java.lang.InstantiationException
See Also:
AbstractSecurityProxy.init(Class, Class, Class, Class, Object)

init

public void init(java.lang.Class beanHome,
                 java.lang.Class beanRemote,
                 java.lang.Class beanLocalHome,
                 java.lang.Class beanLocal,
                 java.lang.Object securityMgr)
          throws java.lang.InstantiationException
Description copied from class: AbstractSecurityProxy (src)
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 (src)
Overrides:
init in class AbstractSecurityProxy (src)
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:
java.lang.InstantiationException

invokeHomeOnDelegate

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

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

invokeOnDelegate

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

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