svn commit: r768346 - in /camel/branches/camel-1.x: ./ camel-core/src/main/java/org/apache/camel/processor/validation/ValidatingProcessor.java components/camel-spring/src/main/java/org/apache/camel/component/validator/ValidatorComponent.java

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r768346 - in /camel/branches/camel-1.x: ./ camel-core/src/main/java/org/apache/camel/processor/validation/ValidatingProcessor.java components/camel-spring/src/main/java/org/apache/camel/component/validator/ValidatorComponent.java

davsclaus-2
Author: davsclaus
Date: Fri Apr 24 16:09:57 2009
New Revision: 768346

URL: http://svn.apache.org/viewvc?rev=768346&view=rev
Log:
Merged revisions 768342 via svnmerge from
https://svn.apache.org/repos/asf/camel/trunk

........
  r768342 | davsclaus | 2009-04-24 18:05:19 +0200 (Fri, 24 Apr 2009) | 1 line
 
  CAMEL-1565: Validator component now thread safe when loading schema as its done at init time.
........

Modified:
    camel/branches/camel-1.x/   (props changed)
    camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/processor/validation/ValidatingProcessor.java
    camel/branches/camel-1.x/components/camel-spring/src/main/java/org/apache/camel/component/validator/ValidatorComponent.java

Propchange: camel/branches/camel-1.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Apr 24 16:09:57 2009
@@ -1 +1 @@
-/camel/trunk:736980,739733,739904,740251,740295,740306,740596,740663,741848,742231,742705,742739,742854,742856,742898,742906,743613,743762,743773,743920,743959-743960,744123,745105,745367,745541,745751,745826,745978,746269,746872,746895,746962,747258,747678-747704,748392,748436,748821,749563-749564,749574,749628-749629,749936,749956,750017,750334,750396,750761,750796,752068,752117,752418,752751-752755,752764-752773,752956,753087,753101,753175,755136,755487,756313,756348,756870,756939,757636,757693,757743,757865,758539,758563,758600,758617,758692,758990,759362,759453,759887,759931,760003,760890,760909,760937,761194,761536,761583,761607,762047,762633,762650,762935,763095,763484,763551,765154,765686,765729,765743,765824,766016,766289,766584,766588,766590,766602,766673,767403,767824
+/camel/trunk:736980,739733,739904,740251,740295,740306,740596,740663,741848,742231,742705,742739,742854,742856,742898,742906,743613,743762,743773,743920,743959-743960,744123,745105,745367,745541,745751,745826,745978,746269,746872,746895,746962,747258,747678-747704,748392,748436,748821,749563-749564,749574,749628-749629,749936,749956,750017,750334,750396,750761,750796,752068,752117,752418,752751-752755,752764-752773,752956,753087,753101,753175,755136,755487,756313,756348,756870,756939,757636,757693,757743,757865,758539,758563,758600,758617,758692,758990,759362,759453,759887,759931,760003,760890,760909,760937,761194,761536,761583,761607,762047,762633,762650,762935,763095,763484,763551,765154,765686,765729,765743,765824,766016,766289,766584,766588,766590,766602,766673,767403,767824,768342

Propchange: camel/branches/camel-1.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/processor/validation/ValidatingProcessor.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/processor/validation/ValidatingProcessor.java?rev=768346&r1=768345&r2=768346&view=diff
==============================================================================
--- camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/processor/validation/ValidatingProcessor.java (original)
+++ camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/processor/validation/ValidatingProcessor.java Fri Apr 24 16:09:57 2009
@@ -69,6 +69,11 @@
         handler.handleErrors(exchange, schema, result);
     }
 
+    public void loadSchema() throws Exception {
+        // force loading of schema
+        schema = createSchema();
+    }
+
     // Properties
     // -----------------------------------------------------------------------
 

Modified: camel/branches/camel-1.x/components/camel-spring/src/main/java/org/apache/camel/component/validator/ValidatorComponent.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/components/camel-spring/src/main/java/org/apache/camel/component/validator/ValidatorComponent.java?rev=768346&r1=768345&r2=768346&view=diff
==============================================================================
--- camel/branches/camel-1.x/components/camel-spring/src/main/java/org/apache/camel/component/validator/ValidatorComponent.java (original)
+++ camel/branches/camel-1.x/components/camel-spring/src/main/java/org/apache/camel/component/validator/ValidatorComponent.java Fri Apr 24 16:09:57 2009
@@ -40,6 +40,11 @@
             log.debug(this + " using schema resource: " + resource);
         }
         configureValidator(validator, uri, remaining, parameters);
+
+        // force loading of schema at create time otherwise concurrent processing could
+        // cause thread safe issues for the javax.xml.validation.SchemaFactory
+        validator.loadSchema();
+
         return new ProcessorEndpoint(uri, this, validator);
     }