[jboss-cvs] jboss-seam/src/main/org/jboss/seam/security ...

Shane Bryzak Shane_Bryzak at symantec.com
Tue Jan 30 03:30:53 EST 2007


  User: sbryzak2
  Date: 07/01/30 03:30:53

  Modified:    src/main/org/jboss/seam/security  Identity.java
  Log:
  removed component interception
  
  Revision  Changes    Path
  1.26      +15 -6     jboss-seam/src/main/org/jboss/seam/security/Identity.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Identity.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/security/Identity.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -b -r1.25 -r1.26
  --- Identity.java	30 Jan 2007 00:48:53 -0000	1.25
  +++ Identity.java	30 Jan 2007 08:30:53 -0000	1.26
  @@ -1,5 +1,6 @@
   package org.jboss.seam.security;
   
  +import static org.jboss.seam.InterceptionType.NEVER;
   import static org.jboss.seam.ScopeType.SESSION;
   import static org.jboss.seam.annotations.Install.BUILT_IN;
   
  @@ -33,8 +34,8 @@
   import org.jboss.seam.Component;
   import org.jboss.seam.ScopeType;
   import org.jboss.seam.annotations.Create;
  -import org.jboss.seam.annotations.In;
   import org.jboss.seam.annotations.Install;
  +import org.jboss.seam.annotations.Intercept;
   import org.jboss.seam.annotations.Name;
   import org.jboss.seam.annotations.Scope;
   import org.jboss.seam.contexts.Contexts;
  @@ -47,6 +48,7 @@
   @Name("org.jboss.seam.security.identity")
   @Scope(SESSION)
   @Install(precedence = BUILT_IN, classDependencies="org.drools.WorkingMemory")
  + at Intercept(NEVER)
   public class Identity implements Serializable
   {  
      private static final long serialVersionUID = 3751659008033189259L;
  @@ -83,17 +85,24 @@
      protected Principal principal;   
      protected Subject subject;
      
  -   @In(create = true, required = false)
  -   private RuleBase securityRules;
  -   
      private WorkingMemory securityContext;
         
      @Create
      public void create()
      {     
         subject = new Subject();
  +      initSecurityContext();
  +   }
  +   
  +   private void initSecurityContext()
  +   {
  +      RuleBase securityRules = (RuleBase) Component.getInstance("securityRules", true);
  +      
  +      if (securityRules != null)
  +      {
         securityContext = securityRules.newWorkingMemory(false);
      }
  +   }
   
      public static Identity instance()
      {
  @@ -186,7 +195,7 @@
         principal = null;
         
         subject = new Subject();
  -      securityContext = securityRules.newWorkingMemory(false);
  +      initSecurityContext();
      }
   
      /**
  
  
  



More information about the jboss-cvs-commits mailing list