[seam-commits] Seam SVN: r13075 - modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Mon Jun 7 03:33:26 EDT 2010


Author: shane.bryzak at jboss.com
Date: 2010-06-07 03:33:25 -0400 (Mon, 07 Jun 2010)
New Revision: 13075

Modified:
   modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java
Log:
attribute configuration


Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java	2010-06-07 05:38:30 UTC (rev 13074)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java	2010-06-07 07:33:25 UTC (rev 13075)
@@ -84,6 +84,11 @@
     */
    private Map<String,Property<Object>> modelProperties = new HashMap<String,Property<Object>>();   
    
+   /**
+    * Attribute properties
+    */
+   private Map<String,Property<Object>> attributeProperties = new HashMap<String,Property<Object>>();
+   
    private class PropertyTypeCriteria implements PropertyCriteria
    {
       private PropertyType pt;
@@ -616,14 +621,31 @@
    
    protected void configureAttributes()
    {
+      // If an attribute class has been configured, scan it for attributes
       if (attributeClass != null)
       {
+         List<Property<Object>> props = PropertyQueries.createQuery(attributeClass)
+            .addCriteria(new PropertyTypeCriteria(PropertyType.ATTRIBUTE))
+            .getResultList();
          
-         
+         for (Property<Object> p : props)
+         {
+            attributeProperties.put(
+                  p.getAnnotatedElement().getAnnotation(IdentityProperty.class).attributeName(), 
+                  p);
+         }         
       }
-      else
+
+      // Scan for additional attributes in the identity class also
+      List<Property<Object>> props = PropertyQueries.createQuery(identityClass)
+         .addCriteria(new PropertyTypeCriteria(PropertyType.ATTRIBUTE))
+         .getResultList();
+   
+      for (Property<Object> p : props)
       {
-         
+         attributeProperties.put(
+               p.getAnnotatedElement().getAnnotation(IdentityProperty.class).attributeName(), 
+               p);
       }
    }
    



More information about the seam-commits mailing list