geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject cvs commit: incubator-geronimo/modules/core/src/java/org/apache/geronimo/security EJBSecurityInterceptor.java
Date Wed, 12 Nov 2003 04:31:55 GMT
adc         2003/11/11 20:31:55

  Modified:    modules/core/src/java/org/apache/geronimo/security
                        EJBSecurityInterceptor.java
  Log:
  Work w/ Subjects instead of AccessControlContexts
  
  Revision  Changes    Path
  1.2       +30 -13    incubator-geronimo/modules/core/src/java/org/apache/geronimo/security/EJBSecurityInterceptor.java
  
  Index: EJBSecurityInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/security/EJBSecurityInterceptor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EJBSecurityInterceptor.java	8 Nov 2003 22:43:08 -0000	1.1
  +++ EJBSecurityInterceptor.java	12 Nov 2003 04:31:55 -0000	1.2
  @@ -65,6 +65,7 @@
   import org.apache.geronimo.security.util.ContextManager;
   
   import javax.security.jacc.PolicyContext;
  +import javax.security.auth.Subject;
   import javax.ejb.EJBException;
   import java.lang.reflect.Method;
   import java.security.AccessControlContext;
  @@ -75,25 +76,41 @@
    * @version $Revision$ $Date$
    */
   public class EJBSecurityInterceptor extends AbstractInterceptor {
  -    private AccessControlContext runAsContext;
  +    private Subject runAsSubject;
  +    private EJBMetadata ejbMetadata;
  +    private GeronimoPolicyConfiguration policyConfiguration;
   
  -    public AccessControlContext getRunAsContext() {
  -        return runAsContext;
  +    public Subject getRunAsSubject() {
  +        return runAsSubject;
       }
   
  -    public void setRunAsContext(AccessControlContext runAsContext) {
  -        this.runAsContext = runAsContext;
  +    public void setRunAsSubject(Subject runAsSubject) {
  +        this.runAsSubject = runAsSubject;
       }
   
  -    public InvocationResult invoke(final Invocation invocation) throws Throwable {
  +    public EJBMetadata getEjbMetadata() {
  +        return ejbMetadata;
  +    }
  +
  +    public void setEjbMetadata(EJBMetadata ejbMetadata) {
  +        this.ejbMetadata = ejbMetadata;
  +    }
  +
  +    public GeronimoPolicyConfiguration getPolicyConfiguration() {
  +        return policyConfiguration;
  +    }
  +
  +    public void setPolicyConfiguration(GeronimoPolicyConfiguration policyConfiguration)
{
  +        this.policyConfiguration = policyConfiguration;
  +    }
  +
  +    public InvocationResult invoke(Invocation invocation) throws Throwable {
   
           AccessControlContext context;
  -        if (runAsContext != null) {
  -            ContextManager.pushContext(runAsContext);
  -            context = runAsContext;
  -        } else {
  -            context = ContextManager.peekContext();
  +        if (runAsSubject != null) {
  +            ContextManager.pushSubject(runAsSubject);
           }
  +        context = ContextManager.peekContext();
   
           String savedContextId = PolicyContext.getContextID();
   
  @@ -117,7 +134,7 @@
           } finally {
               PolicyContext.setContextID(savedContextId);
   
  -            if (runAsContext != null) ContextManager.popContext();
  +            if (runAsSubject != null) ContextManager.popSubject();
           }
           return result;
       }
  
  
  

Mime
View raw message