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

Shane Bryzak sbryzak at redhat.com
Thu Jan 3 02:03:19 EST 2008


  User: sbryzak2
  Date: 08/01/03 02:03:19

  Modified:    src/main/org/jboss/seam/security/management 
                        JpaIdentityStore.java
  Log:
  can't extend EntityController, identity store is application-scoped.
  
  Revision  Changes    Path
  1.6       +20 -3     jboss-seam/src/main/org/jboss/seam/security/management/JpaIdentityStore.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: JpaIdentityStore.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/security/management/JpaIdentityStore.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- JpaIdentityStore.java	3 Jan 2008 03:51:04 -0000	1.5
  +++ JpaIdentityStore.java	3 Jan 2008 07:03:19 -0000	1.6
  @@ -8,13 +8,14 @@
   import java.util.List;
   import java.util.Set;
   
  +import javax.persistence.EntityManager;
   import javax.persistence.NoResultException;
   
  +import org.jboss.seam.Component;
   import org.jboss.seam.annotations.Create;
   import org.jboss.seam.annotations.Scope;
   import org.jboss.seam.annotations.intercept.BypassInterceptors;
   import org.jboss.seam.core.Events;
  -import org.jboss.seam.framework.EntityController;
   import org.jboss.seam.security.management.UserAccount.AccountType;
   import org.jboss.seam.util.Hex;
   
  @@ -25,7 +26,7 @@
    */
   @Scope(APPLICATION)
   @BypassInterceptors
  -public class JpaIdentityStore extends EntityController implements IdentityStore
  +public class JpaIdentityStore implements IdentityStore
   {  
      public static final String EVENT_ACCOUNT_CREATED = "org.jboss.seam.security.management.accountCreated"; 
      public static final String EVENT_ACCOUNT_AUTHENTICATED = "org.jboss.seam.security.management.accountAuthenticated";
  @@ -33,6 +34,8 @@
      private String hashFunction = "MD5";
      private String hashCharset = "UTF-8";   
      
  +   private String entityManagerName = "entityManager";
  +   
      private Class<? extends UserAccount> accountClass;
      
      private Set<UserAccount> roleCache;
  @@ -343,6 +346,20 @@
         this.accountClass = accountClass;
      }   
      
  +   private EntityManager getEntityManager()
  +   {
  +      return (EntityManager) Component.getInstance(entityManagerName);
  +   }
  +   
  +   public String getEntityManagerName()
  +   {
  +      return entityManagerName;
  +   }
  +   
  +   public void setEntityManagerName(String name)
  +   {
  +      this.entityManagerName = name;
  +   }      
      
      protected String hashPassword(String password)
      {
  
  
  



More information about the jboss-cvs-commits mailing list