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

Shane Bryzak sbryzak at redhat.com
Wed Mar 14 08:19:14 EDT 2007


  User: sbryzak2
  Date: 07/03/14 08:19:14

  Modified:    src/main/org/jboss/seam/security  RuleBasedIdentity.java
  Log:
  add static instance() method to RuleBasedIdentity
  
  Revision  Changes    Path
  1.8       +19 -0     jboss-seam/src/main/org/jboss/seam/security/RuleBasedIdentity.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: RuleBasedIdentity.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/security/RuleBasedIdentity.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -b -r1.7 -r1.8
  --- RuleBasedIdentity.java	25 Feb 2007 06:04:34 -0000	1.7
  +++ RuleBasedIdentity.java	14 Mar 2007 12:19:14 -0000	1.8
  @@ -15,11 +15,13 @@
   import org.drools.RuleBase;
   import org.drools.WorkingMemory;
   import org.jboss.seam.Component;
  +import org.jboss.seam.ScopeType;
   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.annotations.Startup;
  +import org.jboss.seam.contexts.Contexts;
   import org.jboss.seam.log.LogProvider;
   import org.jboss.seam.log.Logging;
   
  @@ -38,6 +40,23 @@
      
      private RuleBase securityRules;
      
  +   public static RuleBasedIdentity instance()
  +   {
  +      if ( !Contexts.isSessionContextActive() )
  +      {
  +         throw new IllegalStateException("No active session context");
  +      }
  +
  +      RuleBasedIdentity instance = (RuleBasedIdentity) Component.getInstance(RuleBasedIdentity.class, ScopeType.SESSION);
  +
  +      if (instance == null)
  +      {
  +         throw new IllegalStateException("No Identity could be created");
  +      }
  +
  +      return instance;
  +   }   
  +   
      @Override
      public void create()
      {
  
  
  



More information about the jboss-cvs-commits mailing list