Hibernate SVN: r17542 - search/branches/Branch_3_0_1_GA_CP/src/test/org/hibernate/search/test/directoryProvider.
by hibernate-commits@lists.jboss.org
Author: jcosta(a)redhat.com
Date: 2009-09-25 05:47:20 -0400 (Fri, 25 Sep 2009)
New Revision: 17542
Modified:
search/branches/Branch_3_0_1_GA_CP/src/test/org/hibernate/search/test/directoryProvider/FSSlaveAndMasterDPTest.java
Log:
HSEARCH-401 - Removed logging from FSSlaveAndMasterDPTest, as slf4j is not available in the branch
Modified: search/branches/Branch_3_0_1_GA_CP/src/test/org/hibernate/search/test/directoryProvider/FSSlaveAndMasterDPTest.java
===================================================================
--- search/branches/Branch_3_0_1_GA_CP/src/test/org/hibernate/search/test/directoryProvider/FSSlaveAndMasterDPTest.java 2009-09-25 09:18:24 UTC (rev 17541)
+++ search/branches/Branch_3_0_1_GA_CP/src/test/org/hibernate/search/test/directoryProvider/FSSlaveAndMasterDPTest.java 2009-09-25 09:47:20 UTC (rev 17542)
@@ -7,8 +7,6 @@
import org.apache.lucene.analysis.StopAnalyzer;
import org.apache.lucene.queryParser.QueryParser;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.hibernate.Session;
import org.hibernate.Transaction;
@@ -26,8 +24,6 @@
*/
public class FSSlaveAndMasterDPTest extends MultipleSFTestCase {
- private static final Logger log = LoggerFactory.getLogger(FSSlaveAndMasterDPTest.class);
-
private static File root;
static {
@@ -36,7 +32,6 @@
buildDir = ".";
}
root = new File( buildDir, "lucenedirs" );
- log.info( "Using {} as test directory.", root.getAbsolutePath() );
}
/**
@@ -85,7 +80,6 @@
Thread.sleep( waitPeriodMilli );
// assert that the master hass indexed the snowstorm
- log.info( "Searching master" );
fullTextSession = Search.createFullTextSession( getMasterSession() );
tx = fullTextSession.beginTransaction();
result = fullTextSession.createFullTextQuery( parser.parse( "location:dallas" ) ).list();
@@ -94,7 +88,6 @@
fullTextSession.close();
// assert that index got copied to the salve as well
- log.info( "Searching slave" );
fullTextSession = Search.createFullTextSession( getSlaveSession() );
tx = fullTextSession.beginTransaction();
result = fullTextSession.createFullTextQuery( parser.parse( "location:dallas" ) ).list();
@@ -115,7 +108,6 @@
Thread.sleep( waitPeriodMilli ); //wait a bit more than 2 refresh (one master / one slave)
// assert that the new snowstorm made it into the slave
- log.info( "Searching slave" );
fullTextSession = Search.createFullTextSession( getSlaveSession() );
tx = fullTextSession.beginTransaction();
result = fullTextSession.createFullTextQuery( parser.parse( "location:chennai" ) ).list();
@@ -135,7 +127,6 @@
Thread.sleep( waitPeriodMilli ); //wait a bit more than 2 refresh (one master / one slave)
// once more - assert that the new snowstorm made it into the slave
- log.info( "Searching slave" );
fullTextSession = Search.createFullTextSession( getSlaveSession() );
tx = fullTextSession.beginTransaction();
result = fullTextSession.createFullTextQuery( parser.parse( "location:melbourne" ) ).list();
@@ -181,7 +172,6 @@
protected void tearDown() throws Exception {
super.tearDown();
- log.info( "Deleting test directory {} ", root.getAbsolutePath() );
FileHelper.delete( root );
}
14 years, 7 months
Hibernate SVN: r17541 - search/branches/Branch_3_0_1_GA_CP/src/test/org/hibernate/search/test/directoryProvider.
by hibernate-commits@lists.jboss.org
Author: jcosta(a)redhat.com
Date: 2009-09-25 05:18:24 -0400 (Fri, 25 Sep 2009)
New Revision: 17541
Modified:
search/branches/Branch_3_0_1_GA_CP/src/test/org/hibernate/search/test/directoryProvider/FSSlaveAndMasterDPTest.java
Log:
HSEARCH-401 - Backported FSSlaveAndMasterDPTest test
Modified: search/branches/Branch_3_0_1_GA_CP/src/test/org/hibernate/search/test/directoryProvider/FSSlaveAndMasterDPTest.java
===================================================================
--- search/branches/Branch_3_0_1_GA_CP/src/test/org/hibernate/search/test/directoryProvider/FSSlaveAndMasterDPTest.java 2009-09-24 20:46:38 UTC (rev 17540)
+++ search/branches/Branch_3_0_1_GA_CP/src/test/org/hibernate/search/test/directoryProvider/FSSlaveAndMasterDPTest.java 2009-09-25 09:18:24 UTC (rev 17541)
@@ -7,108 +7,181 @@
import org.apache.lucene.analysis.StopAnalyzer;
import org.apache.lucene.queryParser.QueryParser;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.hibernate.Session;
+import org.hibernate.Transaction;
+import org.hibernate.HibernateException;
import org.hibernate.cfg.Configuration;
-import org.hibernate.event.PostDeleteEventListener;
-import org.hibernate.event.PostInsertEventListener;
-import org.hibernate.event.PostUpdateEventListener;
import org.hibernate.search.FullTextSession;
import org.hibernate.search.Search;
-import org.hibernate.search.event.FullTextIndexEventListener;
import org.hibernate.search.util.FileHelper;
/**
+ * Test case for master/slave directories.
+ *
* @author Emmanuel Bernard
+ * @author Hardy Ferentschik
*/
public class FSSlaveAndMasterDPTest extends MultipleSFTestCase {
+ private static final Logger log = LoggerFactory.getLogger(FSSlaveAndMasterDPTest.class);
+
+ private static File root;
+
+ static {
+ String buildDir = System.getProperty( "build.dir" );
+ if ( buildDir == null ) {
+ buildDir = ".";
+ }
+ root = new File( buildDir, "lucenedirs" );
+ log.info( "Using {} as test directory.", root.getAbsolutePath() );
+ }
+
+ /**
+ * The lucene index directory which is shared bewtween master and slave.
+ */
+ private String masterCopy = "/master/copy";
+
+ /**
+ * The lucene index directory which is specific to the master node.
+ */
+ private String masterMain = "/master/main";
+
+ /**
+ * The lucene index directory which is specific to the slave node.
+ */
+ private String slave = "/slave";
+
+ /**
+ * Verifies that copies of the master get properly copied to the slaves.
+ *
+ * @throws Exception in case the test fails.
+ */
public void testProperCopy() throws Exception {
- Session s1 = getSessionFactories()[0].openSession( );
- SnowStorm sn = new SnowStorm();
- sn.setDate( new Date() );
- sn.setLocation( "Dallas, TX, USA");
- FullTextSession fts2 = Search.createFullTextSession( getSessionFactories()[1].openSession( ) );
- QueryParser parser = new QueryParser("id", new StopAnalyzer() );
- List result = fts2.createFullTextQuery( parser.parse( "location:texas" ) ).list();
+ // assert that the salve index is empty
+ FullTextSession fullTextSession = Search.createFullTextSession( getSlaveSession() );
+ Transaction tx = fullTextSession.beginTransaction();
+ QueryParser parser = new QueryParser( "id", new StopAnalyzer() );
+ List result = fullTextSession.createFullTextQuery( parser.parse( "location:texas" ) ).list();
assertEquals( "No copy yet, fresh index expected", 0, result.size() );
+ tx.commit();
+ fullTextSession.close();
- s1.persist( sn );
- s1.flush(); //we don' commit so we need to flush manually
- fts2.close();
- s1.close();
+ // create an entity on the master and persist it in order to index it
+ Session session = getMasterSession();
+ tx = session.beginTransaction();
+ SnowStorm sn = new SnowStorm();
+ sn.setDate( new Date() );
+ sn.setLocation( "Dallas, TX, USA" );
+ session.persist( sn );
+ tx.commit();
+ session.close();
- int waitPeroid = 2 * 1 * 1000 + 10; //wait a bit more than 2 refresh (one master / one slave)
- Thread.sleep( waitPeroid );
+ int waitPeriodMilli = 2010; // wait a bit more than 2 refresh periods (one master / one slave) - 2 * 1 * 1000 + 10
+ Thread.sleep( waitPeriodMilli );
- //temp test original
- fts2 = Search.createFullTextSession( getSessionFactories()[0].openSession( ) );
- result = fts2.createFullTextQuery( parser.parse( "location:dallas" ) ).list();
+ // assert that the master hass indexed the snowstorm
+ log.info( "Searching master" );
+ fullTextSession = Search.createFullTextSession( getMasterSession() );
+ tx = fullTextSession.beginTransaction();
+ result = fullTextSession.createFullTextQuery( parser.parse( "location:dallas" ) ).list();
assertEquals( "Original should get one", 1, result.size() );
+ tx.commit();
+ fullTextSession.close();
- fts2 = Search.createFullTextSession( getSessionFactories()[1].openSession( ) );
- result = fts2.createFullTextQuery( parser.parse( "location:dallas" ) ).list();
- assertEquals("First copy did not work out", 1, result.size() );
+ // assert that index got copied to the salve as well
+ log.info( "Searching slave" );
+ fullTextSession = Search.createFullTextSession( getSlaveSession() );
+ tx = fullTextSession.beginTransaction();
+ result = fullTextSession.createFullTextQuery( parser.parse( "location:dallas" ) ).list();
+ assertEquals( "First copy did not work out", 1, result.size() );
+ tx.commit();
+ fullTextSession.close();
- s1 = getSessionFactories()[0].openSession( );
+ // add a new snowstorm to the master
+ session = getMasterSession();
+ tx = session.beginTransaction();
sn = new SnowStorm();
sn.setDate( new Date() );
- sn.setLocation( "Chennai, India");
+ sn.setLocation( "Chennai, India" );
+ session.persist( sn );
+ tx.commit();
+ session.close();
- s1.persist( sn );
- s1.flush(); //we don' commit so we need to flush manually
+ Thread.sleep( waitPeriodMilli ); //wait a bit more than 2 refresh (one master / one slave)
- fts2.close();
- s1.close();
+ // assert that the new snowstorm made it into the slave
+ log.info( "Searching slave" );
+ fullTextSession = Search.createFullTextSession( getSlaveSession() );
+ tx = fullTextSession.beginTransaction();
+ result = fullTextSession.createFullTextQuery( parser.parse( "location:chennai" ) ).list();
+ assertEquals( "Second copy did not work out", 1, result.size() );
+ tx.commit();
+ fullTextSession.close();
- Thread.sleep( waitPeroid ); //wait a bit more than 2 refresh (one master / one slave)
-
- fts2 = Search.createFullTextSession( getSessionFactories()[1].openSession( ) );
- result = fts2.createFullTextQuery( parser.parse( "location:chennai" ) ).list();
- assertEquals("Second copy did not work out", 1, result.size() );
-
- s1 = getSessionFactories()[0].openSession( );
+ session = getMasterSession();
+ tx = session.beginTransaction();
sn = new SnowStorm();
sn.setDate( new Date() );
- sn.setLocation( "Melbourne, Australia");
+ sn.setLocation( "Melbourne, Australia" );
+ session.persist( sn );
+ tx.commit();
+ session.close();
- s1.persist( sn );
- s1.flush(); //we don' commit so we need to flush manually
+ Thread.sleep( waitPeriodMilli ); //wait a bit more than 2 refresh (one master / one slave)
- fts2.close();
- s1.close();
+ // once more - assert that the new snowstorm made it into the slave
+ log.info( "Searching slave" );
+ fullTextSession = Search.createFullTextSession( getSlaveSession() );
+ tx = fullTextSession.beginTransaction();
+ result = fullTextSession.createFullTextQuery( parser.parse( "location:melbourne" ) ).list();
+ assertEquals( "Third copy did not work out", 1, result.size() );
+ tx.commit();
+ fullTextSession.close();
+ }
- Thread.sleep( waitPeroid ); //wait a bit more than 2 refresh (one master / one slave)
+ private Session getMasterSession() {
+ return getSessionFactories()[0].openSession();
+ }
- fts2 = Search.createFullTextSession( getSessionFactories()[1].openSession( ) );
- result = fts2.createFullTextQuery( parser.parse( "location:melbourne" ) ).list();
- assertEquals("Third copy did not work out", 1, result.size() );
-
- fts2.close();
+ private Session getSlaveSession() {
+ return getSessionFactories()[1].openSession();
}
-
protected void setUp() throws Exception {
- File base = new File(".");
- File root = new File(base, "lucenedirs");
- root.mkdir();
- File master = new File(root, "master/main");
- master.mkdirs();
- master = new File(root, "master/copy");
- master.mkdirs();
+ if ( root.exists() ) {
+ FileHelper.delete( root );
+ }
- File slave = new File(root, "slave");
- slave.mkdir();
+ if ( !root.mkdir() ) {
+ throw new HibernateException( "Unable to setup test directories" );
+ }
+ File master = new File( root, masterMain );
+ if ( !master.mkdirs() ) {
+ throw new HibernateException( "Unable to setup master directory" );
+ }
+
+ master = new File( root, masterCopy );
+ if ( !master.mkdirs() ) {
+ throw new HibernateException( "Unable to setup master copy directory" );
+ }
+
+ File slaveFile = new File( root, slave );
+ if ( !slaveFile.mkdirs() ) {
+ throw new HibernateException( "Unable to setup slave directory" );
+ }
super.setUp();
}
protected void tearDown() throws Exception {
super.tearDown();
- File base = new File(".");
- File root = new File(base, "lucenedirs");
+ log.info( "Deleting test directory {} ", root.getAbsolutePath() );
FileHelper.delete( root );
}
@@ -124,15 +197,19 @@
protected void configure(Configuration[] cfg) {
//master
- cfg[0].setProperty( "hibernate.search.default.sourceBase", "./lucenedirs/master/copy");
- cfg[0].setProperty( "hibernate.search.default.indexBase", "./lucenedirs/master/main");
- cfg[0].setProperty( "hibernate.search.default.refresh", "1"); //every minute
- cfg[0].setProperty( "hibernate.search.default.directory_provider", "org.hibernate.search.store.FSMasterDirectoryProvider");
+ cfg[0].setProperty( "hibernate.search.default.sourceBase", root.getAbsolutePath() + masterCopy );
+ cfg[0].setProperty( "hibernate.search.default.indexBase", root.getAbsolutePath() + masterMain );
+ cfg[0].setProperty( "hibernate.search.default.refresh", "1" ); //every second
+ cfg[0].setProperty(
+ "hibernate.search.default.directory_provider", "org.hibernate.search.store.FSMasterDirectoryProvider"
+ );
//slave(s)
- cfg[1].setProperty( "hibernate.search.default.sourceBase", "./lucenedirs/master/copy");
- cfg[1].setProperty( "hibernate.search.default.indexBase", "./lucenedirs/slave");
- cfg[1].setProperty( "hibernate.search.default.refresh", "1"); //every minute
- cfg[1].setProperty( "hibernate.search.default.directory_provider", "org.hibernate.search.store.FSSlaveDirectoryProvider");
+ cfg[1].setProperty( "hibernate.search.default.sourceBase", root.getAbsolutePath() + masterCopy );
+ cfg[1].setProperty( "hibernate.search.default.indexBase", root.getAbsolutePath() + slave );
+ cfg[1].setProperty( "hibernate.search.default.refresh", "1" ); //every second
+ cfg[1].setProperty(
+ "hibernate.search.default.directory_provider", "org.hibernate.search.store.FSSlaveDirectoryProvider"
+ );
}
}
14 years, 7 months
Thank you for setting the order No.475456
by Avis Rasmussen
Dear Customer!
Thank you for ordering at our online store.
Your order: Sony VAIO A1133651A, was sent at your address.
The tracking number of your postal parcel is indicated in the document attached to this letter.
Please, print out the postal label for receiving the parcel.
Internet Store.
14 years, 7 months
Thank you for setting the order No.475456
by Paige Grady
Dear Customer!
Thank you for ordering at our online store.
Your order: Sony VAIO A1133651A, was sent at your address.
The tracking number of your postal parcel is indicated in the document attached to this letter.
Please, print out the postal label for receiving the parcel.
Internet Store.
14 years, 7 months
Hibernate SVN: r17540 - in core/patches/JBOSS_EAP_3_2_4_SP1_CP03_JBPAPP-2851: src/org/hibernate/cfg and 1 other directories.
by hibernate-commits@lists.jboss.org
Author: bmaxwell
Date: 2009-09-24 16:46:38 -0400 (Thu, 24 Sep 2009)
New Revision: 17540
Modified:
core/patches/JBOSS_EAP_3_2_4_SP1_CP03_JBPAPP-2851/build.xml
core/patches/JBOSS_EAP_3_2_4_SP1_CP03_JBPAPP-2851/src/org/hibernate/cfg/Environment.java
core/patches/JBOSS_EAP_3_2_4_SP1_CP03_JBPAPP-2851/src/org/hibernate/jdbc/AbstractBatcher.java
Log:
[JBPAPP-2851] fix HHH-3006 - ConcurrentModificationException in AbstractBatcher results in infinite loop for one off patch
Modified: core/patches/JBOSS_EAP_3_2_4_SP1_CP03_JBPAPP-2851/build.xml
===================================================================
--- core/patches/JBOSS_EAP_3_2_4_SP1_CP03_JBPAPP-2851/build.xml 2009-09-24 16:55:13 UTC (rev 17539)
+++ core/patches/JBOSS_EAP_3_2_4_SP1_CP03_JBPAPP-2851/build.xml 2009-09-24 20:46:38 UTC (rev 17540)
@@ -23,7 +23,7 @@
<property name="version.major" value="3"/>
<property name="version.minor" value="2"/>
<property name="version.micro" value="4"/>
- <property name="version.qualifier" value="sp1"/>
+ <property name="version.qualifier" value="sp1.JBPAPP-883"/>
<property name="version.cp" value="cp03"/>
<property name="version.full" value="${version.major}.${version.minor}.${version.micro}.${version.qualifier}.${version.cp}"/>
<property name="version.major_minor" value="${version.major}.${version.minor}"/>
Modified: core/patches/JBOSS_EAP_3_2_4_SP1_CP03_JBPAPP-2851/src/org/hibernate/cfg/Environment.java
===================================================================
--- core/patches/JBOSS_EAP_3_2_4_SP1_CP03_JBPAPP-2851/src/org/hibernate/cfg/Environment.java 2009-09-24 16:55:13 UTC (rev 17539)
+++ core/patches/JBOSS_EAP_3_2_4_SP1_CP03_JBPAPP-2851/src/org/hibernate/cfg/Environment.java 2009-09-24 20:46:38 UTC (rev 17540)
@@ -153,7 +153,7 @@
*/
public final class Environment {
- public static final String VERSION = "3.2.4.sp1.cp03";
+ public static final String VERSION = "3.2.4.sp1.cp03.JBPAPP-883";
/**
* <tt>ConnectionProvider</tt> implementor to use when obtaining connections
Modified: core/patches/JBOSS_EAP_3_2_4_SP1_CP03_JBPAPP-2851/src/org/hibernate/jdbc/AbstractBatcher.java
===================================================================
--- core/patches/JBOSS_EAP_3_2_4_SP1_CP03_JBPAPP-2851/src/org/hibernate/jdbc/AbstractBatcher.java 2009-09-24 16:55:13 UTC (rev 17539)
+++ core/patches/JBOSS_EAP_3_2_4_SP1_CP03_JBPAPP-2851/src/org/hibernate/jdbc/AbstractBatcher.java 2009-09-24 20:46:38 UTC (rev 17540)
@@ -8,6 +8,7 @@
import java.sql.SQLException;
import java.util.HashSet;
import java.util.Iterator;
+import java.util.ConcurrentModificationException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -298,7 +299,9 @@
releasing = true;
try {
- if (batchUpdate!=null) batchUpdate.close();
+ if ( batchUpdate != null ) {
+ batchUpdate.close();
+ }
}
catch (SQLException sqle) {
//no big deal
@@ -317,10 +320,25 @@
// no big deal
log.warn("Could not close a JDBC result set", e);
}
- catch (Throwable e) {
- // sybase driver (jConnect) throwing NPE here in certain cases
- log.warn("Could not close a JDBC result set", e);
+ catch ( ConcurrentModificationException e ) {
+ // this has been shown to happen occasionally in rare cases
+ // when using a transaction manager + transaction-timeout
+ // where the timeout calls back through Hibernate's
+ // registered transaction synchronization on a separate
+ // "reaping" thread. In cases where that reaping thread
+ // executes through this block at the same time the main
+ // application thread does we can get into situations where
+ // these CMEs occur. And though it is not "allowed" per-se,
+ // the end result without handling it specifically is infinite
+ // looping. So here, we simply break the loop
+ log.info( "encountered CME attempting to release batcher; assuming cause is tx-timeout scenario and ignoring" );
+ break;
}
+ catch ( Throwable e ) {
+ // sybase driver (jConnect) throwing NPE here in certain
+ // cases, but we'll just handle the general "unexpected" case
+ log.warn( "Could not close a JDBC result set", e );
+ }
}
resultSetsToClose.clear();
@@ -329,6 +347,11 @@
try {
closeQueryStatement( (PreparedStatement) iter.next() );
}
+ catch ( ConcurrentModificationException e ) {
+ // see explanation above...
+ log.info( "encountered CME attempting to release batcher; assuming cause is tx-timeout scenario and ignoring" );
+ break;
+ }
catch (SQLException e) {
// no big deal
log.warn("Could not close a JDBC statement", e);
14 years, 7 months
Hibernate SVN: r17539 - beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/common and 2 other directories.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2009-09-24 12:55:13 -0400 (Thu, 24 Sep 2009)
New Revision: 17539
Modified:
beanvalidation/trunk/validation-api/src/main/java/javax/validation/Configuration.java
beanvalidation/trunk/validation-api/src/main/java/javax/validation/ValidatorFactory.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/common/TCKValidationProvider.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/common/TCKValidatorConfiguration.java
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/ConfigurationImpl.java
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/ValidatorFactoryImpl.java
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/util/LazyValidatorFactory.java
Log:
BVAL-182 Add getDefaultTraversableResolver and getDefaultConstraintValidatorFactory to Configuration
BVAL-183 Add getTraversableResolver and getConstraintValidatorFactory to ValidatorFactory
Modified: beanvalidation/trunk/validation-api/src/main/java/javax/validation/Configuration.java
===================================================================
--- beanvalidation/trunk/validation-api/src/main/java/javax/validation/Configuration.java 2009-09-24 15:48:45 UTC (rev 17538)
+++ beanvalidation/trunk/validation-api/src/main/java/javax/validation/Configuration.java 2009-09-24 16:55:13 UTC (rev 17539)
@@ -164,6 +164,33 @@
MessageInterpolator getDefaultMessageInterpolator();
/**
+ * Return an implementation of the TraversableResolver interface following the
+ * default TraversableResolver defined in the specification:
+ * <ul>
+ * <li>if Java Persistence is available in the runtime environment,
+ * a property is considered reachable if Java Persistence considers
+ * the property as loaded</li>
+ * <li>if Java Persistence is not available in the runtime environment,
+ * all properties are considered reachable</li>
+ * <li>all properties are considered cascadable.</li>
+ * </ul>
+ *
+ * @return default TraversableResolver implementation compliant with the specification
+ */
+ TraversableResolver getDefaultTraversableResolver();
+
+ /**
+ * Return an implementation of the ConstraintValidatorFactory interface following the
+ * default ConstraintValidatorFactory defined in the specification:
+ * <ul>
+ * <li>uses the public no-arg constructor of the <code>ConstraintValidator</code></li>
+ * </ul>
+ *
+ * @return default ConstraintValidatorFactory implementation compliant with the specification
+ */
+ ConstraintValidatorFactory getDefaultConstraintValidatorFactory();
+
+ /**
* Build a ValidatorFactory implementation.
*
* @return ValidatorFactory
Modified: beanvalidation/trunk/validation-api/src/main/java/javax/validation/ValidatorFactory.java
===================================================================
--- beanvalidation/trunk/validation-api/src/main/java/javax/validation/ValidatorFactory.java 2009-09-24 15:48:45 UTC (rev 17538)
+++ beanvalidation/trunk/validation-api/src/main/java/javax/validation/ValidatorFactory.java 2009-09-24 16:55:13 UTC (rev 17539)
@@ -52,6 +52,25 @@
MessageInterpolator getMessageInterpolator();
/**
+ * Returns the <code>TraversableResolver</code> instance configured
+ * at initialization time for the <code>ValidatorFactory<code>.
+ * This is the instance used by #getValidator().
+ *
+ * @return TraversableResolver instance.
+ */
+ TraversableResolver getTraversableResolver();
+
+ /**
+ * Returns the <code>ConstraintValidatorFactory</code> instance
+ * configured at initialization time for the
+ * <code>ValidatorFactory<code>.
+ * This is the instance used by #getValidator().
+ *
+ * @return ConstraintValidatorFactory instance.
+ */
+ ConstraintValidatorFactory getConstraintValidatorFactory();
+
+ /**
* Return an object of the specified type to allow access to the
* provider-specific API. If the Bean Validation provider
* implementation does not support the specified class, the
Modified: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/common/TCKValidationProvider.java
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/common/TCKValidationProvider.java 2009-09-24 15:48:45 UTC (rev 17538)
+++ beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/common/TCKValidationProvider.java 2009-09-24 16:55:13 UTC (rev 17539)
@@ -22,6 +22,8 @@
import javax.validation.Validator;
import javax.validation.ValidatorContext;
import javax.validation.ValidatorFactory;
+import javax.validation.TraversableResolver;
+import javax.validation.ConstraintValidatorFactory;
import javax.validation.spi.BootstrapState;
import javax.validation.spi.ConfigurationState;
import javax.validation.spi.ValidationProvider;
@@ -57,6 +59,14 @@
throw new UnsupportedOperationException();
}
+ public TraversableResolver getTraversableResolver() {
+ throw new UnsupportedOperationException();
+ }
+
+ public ConstraintValidatorFactory getConstraintValidatorFactory() {
+ throw new UnsupportedOperationException();
+ }
+
public <T> T unwrap(Class<T> type) {
throw new UnsupportedOperationException();
}
Modified: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/common/TCKValidatorConfiguration.java
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/common/TCKValidatorConfiguration.java 2009-09-24 15:48:45 UTC (rev 17538)
+++ beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/common/TCKValidatorConfiguration.java 2009-09-24 16:55:13 UTC (rev 17539)
@@ -67,6 +67,14 @@
throw new UnsupportedOperationException();
}
+ public TraversableResolver getDefaultTraversableResolver() {
+ throw new UnsupportedOperationException();
+ }
+
+ public ConstraintValidatorFactory getDefaultConstraintValidatorFactory() {
+ throw new UnsupportedOperationException();
+ }
+
public ValidatorFactory buildValidatorFactory() {
return provider.buildValidatorFactory( null );
}
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/ConfigurationImpl.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/ConfigurationImpl.java 2009-09-24 15:48:45 UTC (rev 17538)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/ConfigurationImpl.java 2009-09-24 16:55:13 UTC (rev 17539)
@@ -55,7 +55,7 @@
private final MessageInterpolator defaultMessageInterpolator = new ResourceBundleMessageInterpolator();
private final TraversableResolver defaultTraversableResolver = new DefaultTraversableResolver();
- private final ConstraintValidatorFactory defaultValidatorFactory = new ConstraintValidatorFactoryImpl();
+ private final ConstraintValidatorFactory defaultConstraintValidatorFactory = new ConstraintValidatorFactoryImpl();
private final ValidationProviderResolver providerResolver;
private ValidationBootstrapParameters validationBootstrapParameters;
@@ -171,6 +171,14 @@
return defaultMessageInterpolator;
}
+ public TraversableResolver getDefaultTraversableResolver() {
+ return defaultTraversableResolver;
+ }
+
+ public ConstraintValidatorFactory getDefaultConstraintValidatorFactory() {
+ return defaultConstraintValidatorFactory;
+ }
+
private boolean isSpecificProvider() {
return validationBootstrapParameters.provider != null;
}
@@ -189,7 +197,7 @@
validationBootstrapParameters.traversableResolver = defaultTraversableResolver;
}
if ( validationBootstrapParameters.constraintValidatorFactory == null ) {
- validationBootstrapParameters.constraintValidatorFactory = defaultValidatorFactory;
+ validationBootstrapParameters.constraintValidatorFactory = defaultConstraintValidatorFactory;
}
}
else {
@@ -224,7 +232,7 @@
validationBootstrapParameters.constraintValidatorFactory = xmlParameters.constraintValidatorFactory;
}
else {
- validationBootstrapParameters.constraintValidatorFactory = defaultValidatorFactory;
+ validationBootstrapParameters.constraintValidatorFactory = defaultConstraintValidatorFactory;
}
}
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/ValidatorFactoryImpl.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/ValidatorFactoryImpl.java 2009-09-24 15:48:45 UTC (rev 17538)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/ValidatorFactoryImpl.java 2009-09-24 16:55:13 UTC (rev 17539)
@@ -73,6 +73,14 @@
return messageInterpolator;
}
+ public TraversableResolver getTraversableResolver() {
+ return traversableResolver;
+ }
+
+ public ConstraintValidatorFactory getConstraintValidatorFactory() {
+ return constraintValidatorFactory;
+ }
+
public <T> T unwrap(Class<T> type) {
throw new ValidationException( "Type " + type + " not supported" );
}
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/util/LazyValidatorFactory.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/util/LazyValidatorFactory.java 2009-09-24 15:48:45 UTC (rev 17538)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/util/LazyValidatorFactory.java 2009-09-24 16:55:13 UTC (rev 17539)
@@ -23,6 +23,8 @@
import javax.validation.MessageInterpolator;
import javax.validation.Configuration;
import javax.validation.Validation;
+import javax.validation.TraversableResolver;
+import javax.validation.ConstraintValidatorFactory;
/**
* This class lazily initialize the ValidatorFactory on the first usage
@@ -85,6 +87,14 @@
return getDelegate().getMessageInterpolator();
}
+ public TraversableResolver getTraversableResolver() {
+ return getDelegate().getTraversableResolver();
+ }
+
+ public ConstraintValidatorFactory getConstraintValidatorFactory() {
+ return getDelegate().getConstraintValidatorFactory();
+ }
+
public <T> T unwrap(Class<T> clazz) {
return getDelegate().unwrap( clazz );
}
14 years, 7 months
Hibernate SVN: r17538 - core/patches.
by hibernate-commits@lists.jboss.org
Author: bmaxwell
Date: 2009-09-24 11:48:45 -0400 (Thu, 24 Sep 2009)
New Revision: 17538
Added:
core/patches/JBOSS_EAP_3_2_4_SP1_CP03_JBPAPP-2851/
Log:
[JBPAPP-2851] Isolated branch for patch JBPAPP-2851 to resolve HHH-3006 ConcurrentModificationException in AbstractBatcher results in infinite loop
Copied: core/patches/JBOSS_EAP_3_2_4_SP1_CP03_JBPAPP-2851 (from rev 17537, core/tags/JBOSS_EAP_3_2_4_SP1_CP03)
14 years, 7 months
Hibernate SVN: r17537 - beanvalidation/trunk/validation-api/src/test/resources.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2009-09-24 11:15:19 -0400 (Thu, 24 Sep 2009)
New Revision: 17537
Modified:
beanvalidation/trunk/validation-api/src/test/resources/validation-configuration-1.0.xsd
Log:
BVAL-181 Fix minor configuration file change
Modified: beanvalidation/trunk/validation-api/src/test/resources/validation-configuration-1.0.xsd
===================================================================
--- beanvalidation/trunk/validation-api/src/test/resources/validation-configuration-1.0.xsd 2009-09-24 14:56:15 UTC (rev 17536)
+++ beanvalidation/trunk/validation-api/src/test/resources/validation-configuration-1.0.xsd 2009-09-24 15:15:19 UTC (rev 17537)
@@ -4,7 +4,7 @@
targetNamespace="http://jboss.org/xml/ns/javax/validation/configuration"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
version="1.0">
- <xs:element name="validation-config" type="validation-configType"/>
+ <xs:element name="validation-config" type="config:validation-configType" xmlns:config="http://jboss.org/xml/ns/javax/validation/configuration"/>
<xs:complexType name="validation-configType">
<xs:sequence>
<xs:element type="xs:string" name="default-provider" minOccurs="0"/>
@@ -12,7 +12,7 @@
<xs:element type="xs:string" name="traversable-resolver" minOccurs="0"/>
<xs:element type="xs:string" name="constraint-validator-factory" minOccurs="0"/>
<xs:element type="xs:string" name="constraint-mapping" maxOccurs="unbounded" minOccurs="0"/>
- <xs:element type="propertyType" name="property" maxOccurs="unbounded" minOccurs="0"/>
+ <xs:element type="config:propertyType" name="property" maxOccurs="unbounded" minOccurs="0" xmlns:config="http://jboss.org/xml/ns/javax/validation/configuration"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="propertyType">
14 years, 7 months