camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1331871 - in /camel/branches/camel-2.9.x: ./ components/camel-bam/src/main/java/org/apache/camel/bam/ components/camel-bam/src/test/profiles/openjpa/META-INF/ components/camel-bam/src/test/profiles/openjpa/META-INF/spring/
Date Sun, 29 Apr 2012 07:31:44 GMT
Author: davsclaus
Date: Sun Apr 29 07:31:44 2012
New Revision: 1331871

URL: http://svn.apache.org/viewvc?rev=1331871&view=rev
Log:
CAMEL-5060: Upgrading to OpenJPA 2.x

Modified:
    camel/branches/camel-2.9.x/   (props changed)
    camel/branches/camel-2.9.x/components/camel-bam/src/main/java/org/apache/camel/bam/ActivityBuilder.java
    camel/branches/camel-2.9.x/components/camel-bam/src/main/java/org/apache/camel/bam/ProcessBuilder.java
    camel/branches/camel-2.9.x/components/camel-bam/src/test/profiles/openjpa/META-INF/persistence.xml
    camel/branches/camel-2.9.x/components/camel-bam/src/test/profiles/openjpa/META-INF/spring/spring.xml

Propchange: camel/branches/camel-2.9.x/
------------------------------------------------------------------------------
  Merged /camel/trunk:r1331764

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

Modified: camel/branches/camel-2.9.x/components/camel-bam/src/main/java/org/apache/camel/bam/ActivityBuilder.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-bam/src/main/java/org/apache/camel/bam/ActivityBuilder.java?rev=1331871&r1=1331870&r2=1331871&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-bam/src/main/java/org/apache/camel/bam/ActivityBuilder.java
(original)
+++ camel/branches/camel-2.9.x/components/camel-bam/src/main/java/org/apache/camel/bam/ActivityBuilder.java
Sun Apr 29 07:31:44 2012
@@ -29,10 +29,11 @@ import org.apache.camel.bam.rules.Activi
  * @version 
  */
 public class ActivityBuilder {
-    private ProcessBuilder processBuilder;
-    private Endpoint endpoint;
-    private ActivityRules activityRules;
+    private final ProcessBuilder processBuilder;
+    private final Endpoint endpoint;
+    private final ActivityRules activityRules;
     private Expression correlationExpression;
+    private volatile Processor processor;
 
     public ActivityBuilder(ProcessBuilder processBuilder, Endpoint endpoint) {
         this.processBuilder = processBuilder;
@@ -52,8 +53,10 @@ public class ActivityBuilder {
     /**
      * Returns the processor of the route
      */
-    public Processor getProcessor() throws Exception {
-        Processor processor = createProcessor();
+    public synchronized Processor getProcessor() throws Exception {
+        if (processor == null) {
+            processor = createProcessor();
+        }
         if (processor == null) {
             throw new IllegalArgumentException("No processor created for ActivityBuilder:
" + this);
         }

Modified: camel/branches/camel-2.9.x/components/camel-bam/src/main/java/org/apache/camel/bam/ProcessBuilder.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-bam/src/main/java/org/apache/camel/bam/ProcessBuilder.java?rev=1331871&r1=1331870&r2=1331871&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-bam/src/main/java/org/apache/camel/bam/ProcessBuilder.java
(original)
+++ camel/branches/camel-2.9.x/components/camel-bam/src/main/java/org/apache/camel/bam/ProcessBuilder.java
Sun Apr 29 07:31:44 2012
@@ -50,10 +50,10 @@ public abstract class ProcessBuilder ext
     private JpaTemplate jpaTemplate;
     private TransactionTemplate transactionTemplate;
     private String processName;
-    private List<ActivityBuilder> activityBuilders = new ArrayList<ActivityBuilder>();
+    private final List<ActivityBuilder> activityBuilders = new ArrayList<ActivityBuilder>();
     private Class<ProcessInstance> entityType = ProcessInstance.class;
-    private ProcessRules processRules = new ProcessRules();
-    private ProcessDefinition processDefinition;
+    private final ProcessRules processRules = new ProcessRules();
+    private volatile ProcessDefinition processDefinition;
     private ActivityMonitorEngine engine;
 
     protected ProcessBuilder() {
@@ -138,7 +138,7 @@ public abstract class ProcessBuilder ext
         return processName;
     }
 
-    public ProcessDefinition getProcessDefinition() {
+    public synchronized ProcessDefinition getProcessDefinition() {
         if (processDefinition == null) {
             processDefinition = findOrCreateProcessDefinition();
         }

Modified: camel/branches/camel-2.9.x/components/camel-bam/src/test/profiles/openjpa/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-bam/src/test/profiles/openjpa/META-INF/persistence.xml?rev=1331871&r1=1331870&r2=1331871&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-bam/src/test/profiles/openjpa/META-INF/persistence.xml
(original)
+++ camel/branches/camel-2.9.x/components/camel-bam/src/test/profiles/openjpa/META-INF/persistence.xml
Sun Apr 29 07:31:44 2012
@@ -16,7 +16,7 @@
 -->
 <persistence xmlns="http://java.sun.com/xml/ns/persistence"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-             version="1.0">
+             version="2.0">
 
   <persistence-unit name="bam" transaction-type="RESOURCE_LOCAL">
     <class>org.apache.camel.bam.model.ActivityDefinition</class>
@@ -26,20 +26,19 @@
 
     <properties>
       
-      <!-- Derby DB 
-      <property name="openjpa.ConnectionURL" value="jdbc:derby:target/bamTest;create=true"/>
-      <property name="openjpa.ConnectionDriverName" value="org.apache.derby.jdbc.EmbeddedDriver"/>
-      <property name="openjpa.Log" value="DefaultLevel=INFO, Tool=INFO, Runtime=TRACE,
SQL=TRACE"/>
-      <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema" /> 
-      -->
-      
+      <!-- Derby DB -->
+      <!--<property name="openjpa.ConnectionURL" value="jdbc:derby:target/bamTest;create=true"/>-->
+      <!--<property name="openjpa.ConnectionDriverName" value="org.apache.derby.jdbc.EmbeddedDriver"/>-->
+      <!--<property name="openjpa.Log" value="DefaultLevel=INFO, Tool=INFO, Runtime=TRACE,
SQL=TRACE"/>-->
+      <!--<property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema" />-->
+
       <!--  HSQL DB -->
-      <property name="openjpa.ConnectionDriverName" value="org.hsqldb.jdbcDriver" />
-	  <property name="openjpa.ConnectionURL" value="jdbc:hsqldb:target/bamTest" />
+      <property name="openjpa.ConnectionDriverName" value="org.hsqldb.jdbcDriver"/>
+      <property name="openjpa.ConnectionURL" value="jdbc:hsqldb:target/bamTest"/>
       <property name="openjpa.Log" value="commons"/>
-	  <property name="openjpa.ConnectionUserName" value="sa" />
-	  <property name="openjpa.ConnectionPassword" value="" />
-      <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema" />
+      <property name="openjpa.ConnectionUserName" value="sa"/>
+      <property name="openjpa.ConnectionPassword" value=""/>
+      <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema"/>
 
     </properties>
   </persistence-unit>

Modified: camel/branches/camel-2.9.x/components/camel-bam/src/test/profiles/openjpa/META-INF/spring/spring.xml
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-bam/src/test/profiles/openjpa/META-INF/spring/spring.xml?rev=1331871&r1=1331870&r2=1331871&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-bam/src/test/profiles/openjpa/META-INF/spring/spring.xml
(original)
+++ camel/branches/camel-2.9.x/components/camel-bam/src/test/profiles/openjpa/META-INF/spring/spring.xml
Sun Apr 29 07:31:44 2012
@@ -36,9 +36,9 @@
 		<property name="jpaVendorAdapter" ref="jpaAdapter"/>
 	</bean>
 	
-    <!-- OpenJPA addapter -->
+    <!-- OpenJPA adapter -->
 	<bean id="jpaAdapter" class="org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter">
 		<property name="databasePlatform" value="org.apache.openjpa.jdbc.sql.HSQLDictionary"/>
-		<property name="database" value="HSQL"/> 
+		<property name="database" value="HSQL"/>
 	</bean>
 </beans>



Mime
View raw message