myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject svn commit: r960288 - in /myfaces/extensions/validator/branches/branch_for_jsf_2_0: component-support/trinidad-support/src/main/java/org/apache/myfaces/extensions/validator/trinidad/storage/ core/src/main/java/org/apache/myfaces/extensions/validator/co...
Date Sun, 04 Jul 2010 01:25:14 GMT
Author: gpetracek
Date: Sun Jul  4 01:25:13 2010
New Revision: 960288

URL: http://svn.apache.org/viewvc?rev=960288&view=rev
Log:
EXTVAL-80 request-scoped storage cache

Modified:
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/component-support/trinidad-support/src/main/java/org/apache/myfaces/extensions/validator/trinidad/storage/DefaultClientValidatorStorageManager.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/extractor/DefaultComponentMetaDataExtractor.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultFacesInformationStorageManager.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultFacesMessageStorageManager.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultGroupStorageManager.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultMappedConstraintSourceStorageManager.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultMetaDataStorageManager.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultPropertyStorageManager.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultRendererInterceptorPropertyStorageManager.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultRendererProxyStorageManager.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultViolationSeverityInterpreterStorageManager.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/util/ConstraintSourceUtils.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/util/ExtValAnnotationUtils.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/util/ExtValUtils.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/util/ReflectionUtils.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/ExtValBeanValidationContext.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/storage/DefaultModelValidationStorageManager.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/JoinValidationMetaDataStorageFilter.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/baseval/annotation/extractor/DefaultPropertyScanningMetaDataExtractor.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/storage/DefaultCrossValidationStorageManager.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/storage/DefaultProcessedInformationStorageManager.java

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/component-support/trinidad-support/src/main/java/org/apache/myfaces/extensions/validator/trinidad/storage/DefaultClientValidatorStorageManager.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/component-support/trinidad-support/src/main/java/org/apache/myfaces/extensions/validator/trinidad/storage/DefaultClientValidatorStorageManager.java?rev=960288&r1=960287&r2=960288&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/component-support/trinidad-support/src/main/java/org/apache/myfaces/extensions/validator/trinidad/storage/DefaultClientValidatorStorageManager.java (original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/component-support/trinidad-support/src/main/java/org/apache/myfaces/extensions/validator/trinidad/storage/DefaultClientValidatorStorageManager.java Sun Jul  4 01:25:13 2010
@@ -34,6 +34,8 @@ import org.apache.myfaces.extensions.val
 public class DefaultClientValidatorStorageManager
         extends AbstractRequestScopeAwareStorageManager<TrinidadClientValidatorStorage>
 {
+    private final String key = StorageManager.class.getName() + "_FOR_TRINIDAD_CLIENT_VALIDATOR:KEY";
+
     public DefaultClientValidatorStorageManager()
     {
         register(new DefaultClientValidatorStorageNameMapper());
@@ -41,6 +43,6 @@ public class DefaultClientValidatorStora
 
     public String getStorageManagerKey()
     {
-        return StorageManager.class.getName() + "_FOR_TRINIDAD_CLIENT_VALIDATOR:KEY";
+        return key;
     }
 }

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/extractor/DefaultComponentMetaDataExtractor.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/extractor/DefaultComponentMetaDataExtractor.java?rev=960288&r1=960287&r2=960288&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/extractor/DefaultComponentMetaDataExtractor.java (original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/extractor/DefaultComponentMetaDataExtractor.java Sun Jul  4 01:25:13 2010
@@ -86,12 +86,14 @@ public class DefaultComponentMetaDataExt
          */
         Class entityClass = ProxyUtils.getUnproxiedClass(propertyDetails.getBaseObject().getClass());
 
-        if (isCached(entityClass, propertyDetails.getProperty()))
+        MetaDataStorage storage = getMetaDataStorage();
+
+        if (isCached(storage, entityClass, propertyDetails.getProperty()))
         {
             //create
             propertyInformation.setInformation(PropertyInformationKeys.PROPERTY_DETAILS, propertyDetails);
 
-            for (MetaDataEntry metaDataEntry : getCachedMetaData(entityClass, propertyDetails.getProperty()))
+            for (MetaDataEntry metaDataEntry : getCachedMetaData(storage, entityClass, propertyDetails.getProperty()))
             {
                 propertyInformation.addMetaDataEntry(metaDataEntry);
             }
@@ -99,7 +101,7 @@ public class DefaultComponentMetaDataExt
         else
         {
             propertyInformation = ExtValAnnotationUtils.extractAnnotations(entityClass, propertyDetails);
-            cacheMetaData(propertyInformation);
+            cacheMetaData(storage, propertyInformation);
         }
 
         logger.finest("extract finished");
@@ -107,19 +109,19 @@ public class DefaultComponentMetaDataExt
         return propertyInformation;
     }
 
-    protected boolean isCached(Class entityClass, String property)
+    protected boolean isCached(MetaDataStorage storage, Class entityClass, String property)
     {
-        return getMetaDataStorage().containsMetaDataFor(entityClass, property);
+        return storage.containsMetaDataFor(entityClass, property);
     }
 
-    protected void cacheMetaData(PropertyInformation propertyInformation)
+    protected void cacheMetaData(MetaDataStorage storage, PropertyInformation propertyInformation)
     {
-        getMetaDataStorage().storeMetaDataOf(propertyInformation);
+        storage.storeMetaDataOf(propertyInformation);
     }
 
-    protected MetaDataEntry[] getCachedMetaData(Class entityClass, String property)
+    protected MetaDataEntry[] getCachedMetaData(MetaDataStorage storage, Class entityClass, String property)
     {
-        return getMetaDataStorage().getMetaData(entityClass, property);
+        return storage.getMetaData(entityClass, property);
     }
 
     protected MetaDataStorage getMetaDataStorage()

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultFacesInformationStorageManager.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultFacesInformationStorageManager.java?rev=960288&r1=960287&r2=960288&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultFacesInformationStorageManager.java (original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultFacesInformationStorageManager.java Sun Jul  4 01:25:13 2010
@@ -32,6 +32,8 @@ import org.apache.myfaces.extensions.val
 class DefaultFacesInformationStorageManager extends
         AbstractRequestScopeAwareStorageManager<FacesInformationStorage>
 {
+    private final String key = StorageManager.class.getName() + "_FOR_FACES_INFORMATION_STORAGE:KEY";
+
     DefaultFacesInformationStorageManager()
     {
         register(new DefaultFacesInformationStorageNameMapper());
@@ -39,6 +41,6 @@ class DefaultFacesInformationStorageMana
 
     public String getStorageManagerKey()
     {
-        return StorageManager.class.getName() + "_FOR_FACES_INFORMATION_STORAGE:KEY";
+        return key;
     }
 }

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultFacesMessageStorageManager.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultFacesMessageStorageManager.java?rev=960288&r1=960287&r2=960288&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultFacesMessageStorageManager.java (original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultFacesMessageStorageManager.java Sun Jul  4 01:25:13 2010
@@ -31,6 +31,8 @@ import org.apache.myfaces.extensions.val
 @UsageInformation(INTERNAL)
 class DefaultFacesMessageStorageManager extends AbstractRequestScopeAwareStorageManager<FacesMessageStorage>
 {
+    private static final String KEY = StorageManager.class.getName() + "_FOR_FACES_MESSAGES:KEY";
+
     DefaultFacesMessageStorageManager()
     {
         register(new DefaultFacesMessageStorageNameMapper());
@@ -38,6 +40,6 @@ class DefaultFacesMessageStorageManager 
 
     public String getStorageManagerKey()
     {
-        return StorageManager.class.getName() + "_FOR_FACES_MESSAGES:KEY";
+        return KEY;
     }
 }

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultGroupStorageManager.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultGroupStorageManager.java?rev=960288&r1=960287&r2=960288&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultGroupStorageManager.java (original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultGroupStorageManager.java Sun Jul  4 01:25:13 2010
@@ -30,8 +30,10 @@ import static org.apache.myfaces.extensi
 @UsageInformation(INTERNAL)
 class DefaultGroupStorageManager extends AbstractRequestScopeAwareStorageManager<GroupStorage>
 {
+    private final String key = StorageManager.class.getName() + "_FOR_GROUPS:KEY";
+
     public String getStorageManagerKey()
     {
-        return StorageManager.class.getName() + "_FOR_GROUPS:KEY";
+        return key;
     }
 }

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultMappedConstraintSourceStorageManager.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultMappedConstraintSourceStorageManager.java?rev=960288&r1=960287&r2=960288&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultMappedConstraintSourceStorageManager.java (original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultMappedConstraintSourceStorageManager.java Sun Jul  4 01:25:13 2010
@@ -31,6 +31,8 @@ import org.apache.myfaces.extensions.val
 @UsageInformation(INTERNAL)
 class DefaultMappedConstraintSourceStorageManager extends AbstractApplicationScopeAwareStorageManager<PropertyStorage>
 {
+    private final String key = StorageManager.class.getName() + "_FOR_MAPPED_CONSTRAINT_SOURCE:KEY";
+
     DefaultMappedConstraintSourceStorageManager()
     {
         register(new DefaultMappedConstraintSourceStorageNameMapper());
@@ -38,6 +40,6 @@ class DefaultMappedConstraintSourceStora
 
     public String getStorageManagerKey()
     {
-        return StorageManager.class.getName() + "_FOR_MAPPED_CONSTRAINT_SOURCE:KEY";
+        return key;
     }
 }

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultMetaDataStorageManager.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultMetaDataStorageManager.java?rev=960288&r1=960287&r2=960288&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultMetaDataStorageManager.java (original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultMetaDataStorageManager.java Sun Jul  4 01:25:13 2010
@@ -31,6 +31,8 @@ import org.apache.myfaces.extensions.val
 @UsageInformation(UsageCategory.INTERNAL)
 class DefaultMetaDataStorageManager extends AbstractApplicationScopeAwareStorageManager<MetaDataStorage>
 {
+    private final String key = StorageManager.class.getName() + "_FOR_META_DATA_CACHE:KEY";
+
     DefaultMetaDataStorageManager()
     {
         register(new DefaultMetaDataStorageNameMapper());
@@ -38,6 +40,6 @@ class DefaultMetaDataStorageManager exte
 
     public String getStorageManagerKey()
     {
-        return StorageManager.class.getName() + "_FOR_META_DATA_CACHE:KEY";
+        return key;
     }
 }

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultPropertyStorageManager.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultPropertyStorageManager.java?rev=960288&r1=960287&r2=960288&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultPropertyStorageManager.java (original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultPropertyStorageManager.java Sun Jul  4 01:25:13 2010
@@ -31,6 +31,8 @@ import org.apache.myfaces.extensions.val
 @UsageInformation(INTERNAL)
 class DefaultPropertyStorageManager extends AbstractApplicationScopeAwareStorageManager<PropertyStorage>
 {
+    private final String key = StorageManager.class.getName() + "_FOR_PROPERTY:KEY";
+
     DefaultPropertyStorageManager()
     {
         register(new DefaultPropertyStorageNameMapper());
@@ -38,6 +40,6 @@ class DefaultPropertyStorageManager exte
 
     public String getStorageManagerKey()
     {
-        return StorageManager.class.getName() + "_FOR_PROPERTY:KEY";
+        return key;
     }
-}
+}
\ No newline at end of file

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultRendererInterceptorPropertyStorageManager.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultRendererInterceptorPropertyStorageManager.java?rev=960288&r1=960287&r2=960288&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultRendererInterceptorPropertyStorageManager.java (original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultRendererInterceptorPropertyStorageManager.java Sun Jul  4 01:25:13 2010
@@ -32,6 +32,8 @@ import org.apache.myfaces.extensions.val
 class DefaultRendererInterceptorPropertyStorageManager
         extends AbstractRequestScopeAwareStorageManager<RendererInterceptorPropertyStorage>
 {
+    private final String key = StorageManager.class.getName() + "_FOR_RENDERER_INTERCEPTOR_PROPERTY:KEY";
+
     DefaultRendererInterceptorPropertyStorageManager()
     {
         register(new DefaultRendererInterceptorPropertyStorageNameMapper());
@@ -39,6 +41,6 @@ class DefaultRendererInterceptorProperty
 
     public String getStorageManagerKey()
     {
-        return StorageManager.class.getName() + "_FOR_RENDERER_INTERCEPTOR_PROPERTY:KEY";
+        return key;
     }
-}
+}
\ No newline at end of file

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultRendererProxyStorageManager.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultRendererProxyStorageManager.java?rev=960288&r1=960287&r2=960288&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultRendererProxyStorageManager.java (original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultRendererProxyStorageManager.java Sun Jul  4 01:25:13 2010
@@ -33,6 +33,8 @@ import org.apache.myfaces.extensions.val
 class DefaultRendererProxyStorageManager
     extends AbstractRequestScopeAwareStorageManager<RendererProxyStorage>
 {
+    private final String key = ExtValRendererProxy.class.getName() + ":STORAGE";
+
     DefaultRendererProxyStorageManager()
     {
         register(new DefaultRendererProxyStorageNameMapper());
@@ -41,6 +43,6 @@ class DefaultRendererProxyStorageManager
     public String getStorageManagerKey()
     {
         //for better backward compatibility
-        return ExtValRendererProxy.class.getName() + ":STORAGE";
+        return key;
     }
-}
+}
\ No newline at end of file

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultViolationSeverityInterpreterStorageManager.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultViolationSeverityInterpreterStorageManager.java?rev=960288&r1=960287&r2=960288&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultViolationSeverityInterpreterStorageManager.java (original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultViolationSeverityInterpreterStorageManager.java Sun Jul  4 01:25:13 2010
@@ -32,6 +32,8 @@ import org.apache.myfaces.extensions.val
 class DefaultViolationSeverityInterpreterStorageManager extends
         AbstractRequestScopeAwareStorageManager<ViolationSeverityInterpreterStorage>
 {
+    private final String key = StorageManager.class.getName() + "_FOR_VIOLATIONSEVERITY_INTERPRETER:KEY";
+
     DefaultViolationSeverityInterpreterStorageManager()
     {
         register(new DefaultViolationSeverityInterpreterStorageNameMapper());
@@ -39,6 +41,6 @@ class DefaultViolationSeverityInterprete
 
     public String getStorageManagerKey()
     {
-        return StorageManager.class.getName() + "_FOR_VIOLATIONSEVERITY_INTERPRETER:KEY";
+        return key;
     }
-}
+}
\ No newline at end of file

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/util/ConstraintSourceUtils.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/util/ConstraintSourceUtils.java?rev=960288&r1=960287&r2=960288&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/util/ConstraintSourceUtils.java (original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/util/ConstraintSourceUtils.java Sun Jul  4 01:25:13 2010
@@ -26,6 +26,7 @@ import java.lang.reflect.Method;
 import org.apache.myfaces.extensions.validator.core.ExtValContext;
 import org.apache.myfaces.extensions.validator.core.property.PropertyDetails;
 import org.apache.myfaces.extensions.validator.core.storage.MappedConstraintSourceStorage;
+import org.apache.myfaces.extensions.validator.core.storage.PropertyStorage;
 import org.apache.myfaces.extensions.validator.core.validation.ConstraintSource;
 import org.apache.myfaces.extensions.validator.core.validation.IgnoreConstraintSource;
 import org.apache.myfaces.extensions.validator.core.validation.TargetProperty;
@@ -50,44 +51,53 @@ public final class ConstraintSourceUtils
                                                                    Class originalClass,
                                                                    String originalProperty)
     {
-        if (isMappedConstraintSourceCached(originalClass, originalProperty))
+        MappedConstraintSourceStorage mappedConstraintSourceStorage = getConstraintSourceStorage();
+
+        if (isMappedConstraintSourceCached(mappedConstraintSourceStorage, originalClass, originalProperty))
         {
-            return getMappedConstraintSource(originalClass, originalProperty);
+            return getMappedConstraintSource(mappedConstraintSourceStorage, originalClass, originalProperty);
         }
 
         originalClass = ProxyUtils.getUnproxiedClass(originalClass);
 
-        Class newClass = findMappedClass(originalClass, originalProperty);
+        PropertyStorage propertyStorage = ReflectionUtils.getPropertyStorage();
+        Class newClass = findMappedClass(propertyStorage, originalClass, originalProperty);
 
         //mapped source is ignored via @IgnoreConstraintSource or there is just no mapping annotation at the target
         if (newClass == null)
         {
-            tryToCacheMappedConstraintSourceMetaData(originalClass, originalProperty, null);
+            tryToCacheMappedConstraintSourceMetaData(
+                    mappedConstraintSourceStorage, originalClass, originalProperty, null);
+
             return null;
         }
 
-        String newProperty = findMappedProperty(originalClass, newClass, originalProperty);
+        String newProperty = findMappedProperty(propertyStorage, originalClass, newClass, originalProperty);
 
         PropertyDetails result = new PropertyDetails(originalKey, newClass, newProperty);
 
-        tryToCacheMappedConstraintSourceMetaData(originalClass, originalProperty, result);
+        tryToCacheMappedConstraintSourceMetaData(
+                mappedConstraintSourceStorage, originalClass, originalProperty, result);
+
         return result;
     }
 
-    private static boolean isMappedConstraintSourceCached(Class baseBeanClass, String property)
+    private static boolean isMappedConstraintSourceCached(
+            MappedConstraintSourceStorage storage, Class baseBeanClass, String property)
     {
-        return getConstraintSourceStorage().containsMapping(baseBeanClass, property);
+        return storage.containsMapping(baseBeanClass, property);
     }
 
-    private static PropertyDetails getMappedConstraintSource(Class baseBeanClass, String property)
+    private static PropertyDetails getMappedConstraintSource(
+            MappedConstraintSourceStorage storage, Class baseBeanClass, String property)
     {
-        return getConstraintSourceStorage().getMappedConstraintSource(baseBeanClass, property);
+        return storage.getMappedConstraintSource(baseBeanClass, property);
     }
 
     private static void tryToCacheMappedConstraintSourceMetaData(
-            Class originalClass, String originalProperty, PropertyDetails result)
+            MappedConstraintSourceStorage storage, Class originalClass, String originalProperty, PropertyDetails result)
     {
-        getConstraintSourceStorage().storeMapping(originalClass, originalProperty, result);
+        storage.storeMapping(originalClass, originalProperty, result);
     }
 
     private static MappedConstraintSourceStorage getConstraintSourceStorage()
@@ -96,18 +106,18 @@ public final class ConstraintSourceUtils
                 .getStorage(MappedConstraintSourceStorage.class, MappedConstraintSourceStorage.class.getName());
     }
 
-    private static Class findMappedClass(Class baseBeanClass, String property)
+    private static Class findMappedClass(PropertyStorage storage, Class baseBeanClass, String property)
     {
         Class<? extends Annotation> constraintSourceAnnotationImplementation = (Class) ExtValContext.getContext()
                 .getGlobalProperty(ConstraintSource.class.getName());
 
         Annotation foundConstraintSourceAnnotation = tryToGetAnnotationFromProperty(
-                baseBeanClass, property, constraintSourceAnnotationImplementation);
+                storage, baseBeanClass, property, constraintSourceAnnotationImplementation);
 
         if (foundConstraintSourceAnnotation == null)
         {
             foundConstraintSourceAnnotation = tryToGetAnnotationFromField(
-                    baseBeanClass, property, constraintSourceAnnotationImplementation);
+                    storage, baseBeanClass, property, constraintSourceAnnotationImplementation);
         }
 
         if (foundConstraintSourceAnnotation == null && !isMappedConstraintSourceIgnored(baseBeanClass, property))
@@ -124,9 +134,10 @@ public final class ConstraintSourceUtils
         return null;
     }
 
-    private static String findMappedProperty(Class baseBeanClass, Class newBaseBeanClass, String originalProperty)
+    private static String findMappedProperty(
+            PropertyStorage storage, Class baseBeanClass, Class newBaseBeanClass, String originalProperty)
     {
-        Annotation targetPropertyAnnotation = getTargetPropertyMetaData(baseBeanClass, originalProperty);
+        Annotation targetPropertyAnnotation = getTargetPropertyMetaData(storage, baseBeanClass, originalProperty);
         if (targetPropertyAnnotation != null)
         {
             return extractNewPropertyName(newBaseBeanClass, targetPropertyAnnotation);
@@ -135,16 +146,19 @@ public final class ConstraintSourceUtils
         return originalProperty;
     }
 
-    private static Annotation getTargetPropertyMetaData(Class baseBeanClass, String originalProperty)
+    private static Annotation getTargetPropertyMetaData(
+            PropertyStorage storage, Class baseBeanClass, String originalProperty)
     {
         Class<? extends Annotation> targetPropertyAnnotation = getTargetPropertyAnnotationImplementation();
         Class<? extends Annotation> targetPropertyIdAnnotation = getTargetPropertyIdAnnotationImplementation();
 
-        Annotation result = findTargetPropertyIdAnnotation(baseBeanClass, originalProperty, targetPropertyIdAnnotation);
+        Annotation result = findTargetPropertyIdAnnotation(
+                storage, baseBeanClass, originalProperty, targetPropertyIdAnnotation);
 
         if (result == null)
         {
-            result = findTargetPropertyAnnotation(baseBeanClass, originalProperty, targetPropertyAnnotation);
+            result = findTargetPropertyAnnotation(
+                    storage, baseBeanClass, originalProperty, targetPropertyAnnotation);
         }
 
         return result;
@@ -225,29 +239,32 @@ public final class ConstraintSourceUtils
         return name;
     }
 
-    private static Annotation findTargetPropertyIdAnnotation(Class baseBeanClass,
+    private static Annotation findTargetPropertyIdAnnotation(PropertyStorage storage,
+                                                             Class baseBeanClass,
                                                              String property,
                                                              Class<? extends Annotation> targetPropertyIdAnnotation)
     {
-        Annotation result = tryToGetAnnotationFromProperty(baseBeanClass, property, targetPropertyIdAnnotation);
+        Annotation result = tryToGetAnnotationFromProperty(
+                storage, baseBeanClass, property, targetPropertyIdAnnotation);
 
         if (result == null)
         {
-            result = tryToGetAnnotationFromField(baseBeanClass, property, targetPropertyIdAnnotation);
+            result = tryToGetAnnotationFromField(storage, baseBeanClass, property, targetPropertyIdAnnotation);
         }
 
         return result;
     }
 
-    private static Annotation findTargetPropertyAnnotation(Class baseBeanClass,
+    private static Annotation findTargetPropertyAnnotation(PropertyStorage storage,
+                                                           Class baseBeanClass,
                                                            String property,
                                                            Class<? extends Annotation> targetPropertyAnnotation)
     {
-        Annotation result = tryToGetAnnotationFromProperty(baseBeanClass, property, targetPropertyAnnotation);
+        Annotation result = tryToGetAnnotationFromProperty(storage, baseBeanClass, property, targetPropertyAnnotation);
 
         if (result == null)
         {
-            result = tryToGetAnnotationFromField(baseBeanClass, property, targetPropertyAnnotation);
+            result = tryToGetAnnotationFromField(storage, baseBeanClass, property, targetPropertyAnnotation);
         }
 
         return result;
@@ -255,14 +272,15 @@ public final class ConstraintSourceUtils
 
     private static boolean isMappedConstraintSourceIgnored(Class baseBeanClass, String property)
     {
-        Method method = ReflectionUtils.tryToGetMethodOfProperty(baseBeanClass, property);
+        PropertyStorage storage = ReflectionUtils.getPropertyStorage();
+        Method method = ReflectionUtils.tryToGetMethodOfProperty(storage, baseBeanClass, property);
 
         if (method != null && method.isAnnotationPresent(getIgnoreConstraintSourceAnnotationImplementation()))
         {
             return true;
         }
 
-        Field field = ReflectionUtils.tryToGetFieldOfProperty(baseBeanClass, property);
+        Field field = ReflectionUtils.tryToGetFieldOfProperty(storage, baseBeanClass, property);
 
         if (field != null && field.isAnnotationPresent(getIgnoreConstraintSourceAnnotationImplementation()))
         {
@@ -288,9 +306,9 @@ public final class ConstraintSourceUtils
     }
 
     private static Annotation tryToGetAnnotationFromField(
-            Class baseBeanClass, String property, Class<? extends Annotation> annotationClass)
+            PropertyStorage storage, Class baseBeanClass, String property, Class<? extends Annotation> annotationClass)
     {
-        Field field = ReflectionUtils.tryToGetFieldOfProperty(baseBeanClass, property);
+        Field field = ReflectionUtils.tryToGetFieldOfProperty(storage, baseBeanClass, property);
 
         if (field != null && field.isAnnotationPresent(annotationClass))
         {
@@ -299,11 +317,12 @@ public final class ConstraintSourceUtils
         return null;
     }
 
-    private static Annotation tryToGetAnnotationFromProperty(Class baseBeanClass,
+    private static Annotation tryToGetAnnotationFromProperty(PropertyStorage storage,
+                                                             Class baseBeanClass,
                                                              String property,
                                                              Class<? extends Annotation> annotationClass)
     {
-        Method method = ReflectionUtils.tryToGetMethodOfProperty(baseBeanClass, property);
+        Method method = ReflectionUtils.tryToGetMethodOfProperty(storage, baseBeanClass, property);
 
         if (method != null && method.isAnnotationPresent(annotationClass))
         {

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/util/ExtValAnnotationUtils.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/util/ExtValAnnotationUtils.java?rev=960288&r1=960287&r2=960288&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/util/ExtValAnnotationUtils.java (original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/util/ExtValAnnotationUtils.java Sun Jul  4 01:25:13 2010
@@ -30,6 +30,7 @@ import org.apache.myfaces.extensions.val
 import org.apache.myfaces.extensions.validator.core.property.PropertyInformation;
 import org.apache.myfaces.extensions.validator.core.property.DefaultPropertyInformation;
 import org.apache.myfaces.extensions.validator.core.property.PropertyInformationKeys;
+import org.apache.myfaces.extensions.validator.core.storage.PropertyStorage;
 import org.apache.myfaces.extensions.validator.internal.UsageCategory;
 import org.apache.myfaces.extensions.validator.internal.UsageInformation;
 import org.apache.myfaces.extensions.validator.internal.ToDo;
@@ -51,12 +52,14 @@ public class ExtValAnnotationUtils
         PropertyInformation propertyInformation = new DefaultPropertyInformation();
         propertyInformation.setInformation(PropertyInformationKeys.PROPERTY_DETAILS, propertyDetails);
 
+        PropertyStorage storage = ReflectionUtils.getPropertyStorage();
+
         while (!Object.class.getName().equals(entityClass.getName()))
         {
-            addPropertyAccessAnnotations(entityClass, propertyDetails.getProperty(), propertyInformation);
-            addFieldAccessAnnotations(entityClass, propertyDetails.getProperty(), propertyInformation);
+            addPropertyAccessAnnotations(storage, entityClass, propertyDetails.getProperty(), propertyInformation);
+            addFieldAccessAnnotations(storage, entityClass, propertyDetails.getProperty(), propertyInformation);
 
-            processInterfaces(entityClass, propertyDetails, propertyInformation);
+            processInterfaces(storage, entityClass, propertyDetails, propertyInformation);
 
             entityClass = entityClass.getSuperclass();
         }
@@ -65,11 +68,11 @@ public class ExtValAnnotationUtils
     }
 
     @ToDo(value = Priority.HIGH, description = "add cache")
-    public static void addPropertyAccessAnnotations(Class entity,
+    public static void addPropertyAccessAnnotations(PropertyStorage storage, Class entity,
                                                     String property,
                                                     PropertyInformation propertyInformation)
     {
-        Method method = ReflectionUtils.tryToGetMethodOfProperty(entity, property);
+        Method method = ReflectionUtils.tryToGetMethodOfProperty(storage, entity, property);
 
         if(method != null)
         {
@@ -78,11 +81,11 @@ public class ExtValAnnotationUtils
     }
 
     @ToDo(value = Priority.HIGH, description = "add cache")
-    public static void addFieldAccessAnnotations(Class entity,
+    public static void addFieldAccessAnnotations(PropertyStorage storage, Class entity,
                                                  String property,
                                                  PropertyInformation propertyInformation)
     {
-        Field field = ReflectionUtils.tryToGetFieldOfProperty(entity, property);
+        Field field = ReflectionUtils.tryToGetFieldOfProperty(storage, entity, property);
 
         if(field != null)
         {
@@ -90,15 +93,15 @@ public class ExtValAnnotationUtils
         }
     }
 
-    private static void processInterfaces(Class currentClass,
+    private static void processInterfaces(PropertyStorage storage, Class currentClass,
                                           PropertyDetails propertyDetails,
                                           PropertyInformation propertyInformation)
     {
         for (Class currentInterface : currentClass.getInterfaces())
         {
-            addPropertyAccessAnnotations(currentInterface, propertyDetails.getProperty(), propertyInformation);
+            addPropertyAccessAnnotations(storage, currentInterface, propertyDetails.getProperty(), propertyInformation);
 
-            processInterfaces(currentInterface, propertyDetails, propertyInformation);
+            processInterfaces(storage, currentInterface, propertyDetails, propertyInformation);
         }
     }
 

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/util/ExtValUtils.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/util/ExtValUtils.java?rev=960288&r1=960287&r2=960288&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/util/ExtValUtils.java (original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/util/ExtValUtils.java Sun Jul  4 01:25:13 2010
@@ -645,14 +645,59 @@ public class ExtValUtils
 
     public static <T> T getStorage(Class<T> storageType, String storageName)
     {
-        return (T) getStorageManagerFactory().create(storageType).create(storageName);
+        T storage = getCachedStorage(storageType, storageName);
+
+        if(storage != null)
+        {
+            return storage;
+        }
+        storage = (T) getStorageManagerFactory().create(storageType).create(storageName);
+
+        cacheStorageForRequest(storageType, storageName, storage);
+
+        return storage;
+    }
+
+    private static <T> T getCachedStorage(Class<T> storageType, String storageName)
+    {
+        Map requestMap = FacesContext.getCurrentInstance().getExternalContext().getRequestMap();
+
+        String key = createStorageKey(storageType.getName(), storageName);
+        return (T)requestMap.get(key);
+    }
+
+    private static <T> void cacheStorageForRequest(Class<T> storageType, String storageName, T storage)
+    {
+        Map requestMap = FacesContext.getCurrentInstance().getExternalContext().getRequestMap();
+
+        String key = createStorageKey(storageType.getName(), storageName);
+        requestMap.put(key, storage);
+    }
+
+    private static String createStorageKey(String storageType, String storageName)
+    {
+        StringBuilder key = new StringBuilder("cachedStorage:");
+        key.append(storageType);
+        key.append(":");
+        key.append(storageName);
+        return key.toString();
     }
 
     public static void resetStorage(Class storageType, String storageName)
     {
+        resetCachedStorage(storageType.getName(), storageName);
+
         getStorageManagerFactory().create(storageType).reset(storageName);
     }
 
+    private static void resetCachedStorage(String storageType, String storageName)
+    {
+        String key = createStorageKey(storageType, storageName);
+
+        Map requestMap = FacesContext.getCurrentInstance().getExternalContext().getRequestMap();
+        requestMap.put(key, null);
+    }
+
     private static ClassMappingFactory<Class, StorageManager> getStorageManagerFactory()
     {
         return (ExtValContext.getContext()

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/util/ReflectionUtils.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/util/ReflectionUtils.java?rev=960288&r1=960287&r2=960288&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/util/ReflectionUtils.java (original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/util/ReflectionUtils.java Sun Jul  4 01:25:13 2010
@@ -209,25 +209,37 @@ public class ReflectionUtils
         return ExtValUtils.getStorage(PropertyStorage.class, PropertyStorage.class.getName());
     }
 
+    @Deprecated
     public static Method tryToGetMethodOfProperty(Class entity, String property)
     {
-        if (isCachedMethod(entity, property))
+        return tryToGetMethodOfProperty(getPropertyStorage(), entity, property);
+    }
+
+    public static Method tryToGetMethodOfProperty(PropertyStorage storage, Class entity, String property)
+    {
+        if (isCachedMethod(storage, entity, property))
         {
-            return getCachedMethod(entity, property);
+            return getCachedMethod(storage, entity, property);
         }
 
         Method method = tryToGetReadMethod(entity, property);
 
-        tryToCacheMethod(entity, property, method);
+        tryToCacheMethod(storage, entity, property, method);
 
         return method;
     }
 
+    @Deprecated
     public static Field tryToGetFieldOfProperty(Class entity, String property)
     {
-        if (isCachedField(entity, property))
+        return tryToGetFieldOfProperty(getPropertyStorage(), entity, property);
+    }
+
+    public static Field tryToGetFieldOfProperty(PropertyStorage storage, Class entity, String property)
+    {
+        if (isCachedField(storage, entity, property))
         {
-            return getCachedField(entity, property);
+            return getCachedField(storage, entity, property);
         }
 
         Field field = null;
@@ -265,23 +277,22 @@ public class ReflectionUtils
             }
         }
 
-        tryToCacheField(entity, property, field);
+        tryToCacheField(storage, entity, property, field);
 
         return field;
     }
 
-    private static void tryToCacheField(Class entity, String property, Field field)
+    private static void tryToCacheField(PropertyStorage storage, Class entity, String property, Field field)
     {
-        PropertyStorage propertyStorage = getPropertyStorage();
-        if (!propertyStorage.containsField(entity, property))
+        if (!storage.containsField(entity, property))
         {
-            propertyStorage.storeField(entity, property, field);
+            storage.storeField(entity, property, field);
         }
     }
 
-    private static boolean isCachedField(Class entity, String property)
+    private static boolean isCachedField(PropertyStorage storage, Class entity, String property)
     {
-        return getPropertyStorage().containsField(entity, property);
+        return storage.containsField(entity, property);
     }
 
     private static Method tryToGetReadMethod(Class baseBeanClass, String property)
@@ -350,27 +361,26 @@ public class ReflectionUtils
         }
     }
 
-    private static Field getCachedField(Class entity, String property)
+    private static Field getCachedField(PropertyStorage storage, Class entity, String property)
     {
-        return getPropertyStorage().getField(entity, property);
+        return storage.getField(entity, property);
     }
 
-    private static boolean isCachedMethod(Class entity, String property)
+    private static boolean isCachedMethod(PropertyStorage storage, Class entity, String property)
     {
-        return getPropertyStorage().containsMethod(entity, property);
+        return storage.containsMethod(entity, property);
     }
 
-    private static void tryToCacheMethod(Class entity, String property, Method method)
+    private static void tryToCacheMethod(PropertyStorage storage, Class entity, String property, Method method)
     {
-        PropertyStorage propertyStorage = getPropertyStorage();
-        if (!propertyStorage.containsMethod(entity, property))
+        if (!storage.containsMethod(entity, property))
         {
-            propertyStorage.storeMethod(entity, property, method);
+            storage.storeMethod(entity, property, method);
         }
     }
 
-    private static Method getCachedMethod(Class entity, String property)
+    private static Method getCachedMethod(PropertyStorage storage, Class entity, String property)
     {
-        return getPropertyStorage().getMethod(entity, property);
+        return storage.getMethod(entity, property);
     }
 }

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/ExtValBeanValidationContext.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/ExtValBeanValidationContext.java?rev=960288&r1=960287&r2=960288&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/ExtValBeanValidationContext.java (original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/ExtValBeanValidationContext.java Sun Jul  4 01:25:13 2010
@@ -30,6 +30,7 @@ import org.apache.myfaces.extensions.val
 import org.apache.myfaces.extensions.validator.core.validation.strategy.ValidationStrategy;
 import org.apache.myfaces.extensions.validator.core.storage.GroupStorage;
 import org.apache.myfaces.extensions.validator.core.ExtValContext;
+import org.apache.myfaces.extensions.validator.core.JsfProjectStage;
 import org.apache.myfaces.extensions.validator.util.ExtValUtils;
 import org.apache.myfaces.extensions.validator.internal.UsageInformation;
 import org.apache.myfaces.extensions.validator.internal.UsageCategory;
@@ -60,6 +61,8 @@ public class ExtValBeanValidationContext
 
     protected ModelValidationStorage modelValidationStorage;
 
+    protected boolean developmentMode = false;
+
     protected ExtValBeanValidationContext()
     {
         initGroupStorage();
@@ -67,6 +70,11 @@ public class ExtValBeanValidationContext
 
         initMessageResolver();
         initMessageInterpolator();
+
+        if (JsfProjectStage.is(JsfProjectStage.Development))
+        {
+            this.developmentMode = true;
+        }
     }
 
     @SuppressWarnings({"unchecked"})
@@ -96,7 +104,10 @@ public class ExtValBeanValidationContext
             return (ValidatorFactory)validatorFactory;
         }
 
-        this.logger.warning("fallback to the default bv validator factory");
+        if(this.developmentMode)
+        {
+            this.logger.warning("fallback to the default bv validator factory");
+        }
         return BeanValidationUtils.getDefaultValidatorFactory();
     }
 

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/storage/DefaultModelValidationStorageManager.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/storage/DefaultModelValidationStorageManager.java?rev=960288&r1=960287&r2=960288&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/storage/DefaultModelValidationStorageManager.java (original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/storage/DefaultModelValidationStorageManager.java Sun Jul  4 01:25:13 2010
@@ -33,8 +33,10 @@ import static org.apache.myfaces.extensi
 public class DefaultModelValidationStorageManager
         extends AbstractRequestScopeAwareStorageManager<ModelValidationStorage>
 {
+    private final String key = StorageManager.class.getName() + "_FOR_MODEL_VALIDATION:KEY";
+
     public String getStorageManagerKey()
     {
-        return StorageManager.class.getName() + "_FOR_MODEL_VALIDATION:KEY";
+        return key;
     }
 }
\ No newline at end of file

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/JoinValidationMetaDataStorageFilter.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/JoinValidationMetaDataStorageFilter.java?rev=960288&r1=960287&r2=960288&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/JoinValidationMetaDataStorageFilter.java (original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/JoinValidationMetaDataStorageFilter.java Sun Jul  4 01:25:13 2010
@@ -26,9 +26,11 @@ import org.apache.myfaces.extensions.val
 import org.apache.myfaces.extensions.validator.core.property.PropertyInformation;
 import org.apache.myfaces.extensions.validator.core.property.PropertyInformationKeys;
 import org.apache.myfaces.extensions.validator.core.storage.MetaDataStorageFilter;
+import org.apache.myfaces.extensions.validator.core.storage.PropertyStorage;
 import org.apache.myfaces.extensions.validator.util.ClassUtils;
 import org.apache.myfaces.extensions.validator.util.ExtValUtils;
 import org.apache.myfaces.extensions.validator.util.ProxyUtils;
+import org.apache.myfaces.extensions.validator.util.ReflectionUtils;
 import static org.apache.myfaces.extensions.validator.util.ExtValAnnotationUtils.addPropertyAccessAnnotations;
 import static org.apache.myfaces.extensions.validator.util.ExtValAnnotationUtils.addFieldAccessAnnotations;
 import org.apache.myfaces.extensions.validator.internal.UsageInformation;
@@ -191,8 +193,9 @@ public class JoinValidationMetaDataStora
         {
             PropertyInformation propertyInformation = new DefaultPropertyInformation();
 
-            addPropertyAccessAnnotations(targetClass, targetProperty, propertyInformation);
-            addFieldAccessAnnotations(targetClass, targetProperty, propertyInformation);
+            PropertyStorage storage = ReflectionUtils.getPropertyStorage();
+            addPropertyAccessAnnotations(storage, targetClass, targetProperty, propertyInformation);
+            addFieldAccessAnnotations(storage, targetClass, targetProperty, propertyInformation);
 
             return propertyInformation;
         }

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/baseval/annotation/extractor/DefaultPropertyScanningMetaDataExtractor.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/baseval/annotation/extractor/DefaultPropertyScanningMetaDataExtractor.java?rev=960288&r1=960287&r2=960288&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/baseval/annotation/extractor/DefaultPropertyScanningMetaDataExtractor.java (original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/baseval/annotation/extractor/DefaultPropertyScanningMetaDataExtractor.java Sun Jul  4 01:25:13 2010
@@ -24,12 +24,14 @@ import org.apache.myfaces.extensions.val
 import org.apache.myfaces.extensions.validator.core.property.PropertyDetails;
 import org.apache.myfaces.extensions.validator.core.metadata.extractor.DefaultComponentMetaDataExtractor;
 import org.apache.myfaces.extensions.validator.core.metadata.extractor.MetaDataExtractor;
+import org.apache.myfaces.extensions.validator.core.storage.PropertyStorage;
 import org.apache.myfaces.extensions.validator.internal.ToDo;
 import org.apache.myfaces.extensions.validator.internal.Priority;
 import org.apache.myfaces.extensions.validator.internal.UsageInformation;
 import org.apache.myfaces.extensions.validator.internal.UsageCategory;
 import org.apache.myfaces.extensions.validator.util.ExtValUtils;
 import org.apache.myfaces.extensions.validator.util.ProxyUtils;
+import org.apache.myfaces.extensions.validator.util.ReflectionUtils;
 import static org.apache.myfaces.extensions.validator.util.ExtValAnnotationUtils.addFieldAccessAnnotations;
 import static org.apache.myfaces.extensions.validator.util.ExtValAnnotationUtils.addPropertyAccessAnnotations;
 import org.apache.myfaces.extensions.validator.PropertyValidationModuleKey;
@@ -76,8 +78,10 @@ public class DefaultPropertyScanningMeta
         /*
          * find and add annotations
          */
-        addPropertyAccessAnnotations(entityClass, propertyDetails.getProperty(), propertyInformation);
-        addFieldAccessAnnotations(entityClass, propertyDetails.getProperty(), propertyInformation);
+        PropertyStorage storage = ReflectionUtils.getPropertyStorage();
+
+        addPropertyAccessAnnotations(storage, entityClass, propertyDetails.getProperty(), propertyInformation);
+        addFieldAccessAnnotations(storage, entityClass, propertyDetails.getProperty(), propertyInformation);
 
         return propertyInformation;
     }

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/storage/DefaultCrossValidationStorageManager.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/storage/DefaultCrossValidationStorageManager.java?rev=960288&r1=960287&r2=960288&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/storage/DefaultCrossValidationStorageManager.java (original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/storage/DefaultCrossValidationStorageManager.java Sun Jul  4 01:25:13 2010
@@ -32,9 +32,11 @@ import org.apache.myfaces.extensions.val
 public class DefaultCrossValidationStorageManager
     extends AbstractRequestScopeAwareStorageManager<CrossValidationStorage>
 {
+    private final String key = CrossValidationStorage.class.getName();
+
     public String getStorageManagerKey()
     {
         //for better backward compatibility
-        return CrossValidationStorage.class.getName();
+        return key;
     }
 }

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/storage/DefaultProcessedInformationStorageManager.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/storage/DefaultProcessedInformationStorageManager.java?rev=960288&r1=960287&r2=960288&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/storage/DefaultProcessedInformationStorageManager.java (original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/storage/DefaultProcessedInformationStorageManager.java Sun Jul  4 01:25:13 2010
@@ -33,9 +33,11 @@ import org.apache.myfaces.extensions.val
 public class DefaultProcessedInformationStorageManager
     extends AbstractRequestScopeAwareStorageManager<CrossValidationStorage>
 {
+    private final String key = CrossValidationUtils.class.getName();
+
     public String getStorageManagerKey()
     {
         //for better backward compatibility
-        return CrossValidationUtils.class.getName();
+        return key;
     }
 }
\ No newline at end of file



Mime
View raw message