geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vamsic...@apache.org
Subject svn commit: r997868 - /geronimo/server/trunk/plugins/bval/geronimo-bval/src/main/java/org/apache/geronimo/bval/DefaultValidatorFactoryReference.java
Date Thu, 16 Sep 2010 18:01:42 GMT
Author: vamsic007
Date: Thu Sep 16 18:01:41 2010
New Revision: 997868

URL: http://svn.apache.org/viewvc?rev=997868&view=rev
Log:
GERONIMO-5221 Add naming support for Validator and ValidatorFactory
 o Cache the factory instance so that a single instance is used per module

Modified:
    geronimo/server/trunk/plugins/bval/geronimo-bval/src/main/java/org/apache/geronimo/bval/DefaultValidatorFactoryReference.java

Modified: geronimo/server/trunk/plugins/bval/geronimo-bval/src/main/java/org/apache/geronimo/bval/DefaultValidatorFactoryReference.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/bval/geronimo-bval/src/main/java/org/apache/geronimo/bval/DefaultValidatorFactoryReference.java?rev=997868&r1=997867&r2=997868&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/bval/geronimo-bval/src/main/java/org/apache/geronimo/bval/DefaultValidatorFactoryReference.java
(original)
+++ geronimo/server/trunk/plugins/bval/geronimo-bval/src/main/java/org/apache/geronimo/bval/DefaultValidatorFactoryReference.java
Thu Sep 16 18:01:41 2010
@@ -23,14 +23,22 @@ package org.apache.geronimo.bval;
 import javax.naming.NamingException;
 import javax.naming.Reference;
 import javax.validation.Validation;
+import javax.validation.ValidatorFactory;
+
 import org.apache.xbean.naming.reference.SimpleReference;
 
 /**
  * @version $Rev$ $Date$
  */
 public class DefaultValidatorFactoryReference extends SimpleReference {
+    private ValidatorFactory factory;
+    
     @Override
     public Object getContent() throws NamingException {
-        return Validation.buildDefaultValidatorFactory();
+        if(factory == null) {
+            factory = Validation.buildDefaultValidatorFactory();
+        }
+        
+        return factory;
     }
 }



Mime
View raw message