You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2012/04/29 09:30:07 UTC

svn commit: r1331870 - in /camel/branches/camel-2.9.x: ./ components/camel-bam/pom.xml components/camel-bam/src/main/java/org/apache/camel/bam/rules/ProcessRules.java

Author: davsclaus
Date: Sun Apr 29 07:30:06 2012
New Revision: 1331870

URL: http://svn.apache.org/viewvc?rev=1331870&view=rev
Log:
CAMEL-5060: Fixed concurenncy issue with bam

Modified:
    camel/branches/camel-2.9.x/   (props changed)
    camel/branches/camel-2.9.x/components/camel-bam/pom.xml
    camel/branches/camel-2.9.x/components/camel-bam/src/main/java/org/apache/camel/bam/rules/ProcessRules.java

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

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

Modified: camel/branches/camel-2.9.x/components/camel-bam/pom.xml
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-bam/pom.xml?rev=1331870&r1=1331869&r2=1331870&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-bam/pom.xml (original)
+++ camel/branches/camel-2.9.x/components/camel-bam/pom.xml Sun Apr 29 07:30:06 2012
@@ -1,319 +1,244 @@
 <?xml version="1.0" encoding="UTF-8"?>
-	<!--
-		Licensed to the Apache Software Foundation (ASF) under one or more
-		contributor license agreements. See the NOTICE file distributed with
-		this work for additional information regarding copyright ownership.
-		The ASF licenses this file to You under the Apache License, Version
-		2.0 (the "License"); you may not use this file except in compliance
-		with the License. You may obtain a copy of the License at
-
-		http://www.apache.org/licenses/LICENSE-2.0 Unless required by
-		applicable law or agreed to in writing, software distributed under the
-		License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-		CONDITIONS OF ANY KIND, either express or implied. See the License for
-		the specific language governing permissions and limitations under the
-		License.
-	-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-	<modelVersion>4.0.0</modelVersion>
-
-	<parent>
-		<groupId>org.apache.camel</groupId>
-		<artifactId>camel-parent</artifactId>
-		<version>2.9.3-SNAPSHOT</version>
-        <relativePath>../../parent</relativePath>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements. See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version
+    2.0 (the "License"); you may not use this file except in compliance
+    with the License. You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0 Unless required by
+    applicable law or agreed to in writing, software distributed under the
+    License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+    CONDITIONS OF ANY KIND, either express or implied. See the License for
+    the specific language governing permissions and limitations under the
+    License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.camel</groupId>
+    <artifactId>camel-parent</artifactId>
+    <version>2.9-SNAPSHOT</version>
+    <relativePath>../../parent</relativePath>
     </parent>
 
-	<artifactId>camel-bam</artifactId>
-	<packaging>bundle</packaging>
-	<name>Camel :: BAM</name>
-	<description>Camel BAM support</description>
-
-	<properties>
-		<camel.osgi.export.pkg>org.apache.camel.bam.*</camel.osgi.export.pkg>
-	</properties>
-
-	<dependencies>
-
-		<dependency>
-			<groupId>org.apache.camel</groupId>
-			<artifactId>camel-core</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.camel</groupId>
-			<artifactId>camel-spring</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.springframework</groupId>
-			<artifactId>spring-orm</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.springframework</groupId>
-			<artifactId>spring-jdbc</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.geronimo.specs</groupId>
-			<artifactId>geronimo-jpa_3.0_spec</artifactId>
-		</dependency>
-
-		<!-- testing -->
-		<dependency>
-			<groupId>org.apache.camel</groupId>
-			<artifactId>camel-test</artifactId>
-			<scope>test</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.camel</groupId>
-			<artifactId>camel-juel</artifactId>
-			<scope>test</scope>
-		</dependency>
+  <artifactId>camel-bam</artifactId>
+  <packaging>bundle</packaging>
+  <name>Camel :: BAM</name>
+  <description>Camel BAM support</description>
+
+  <properties>
+    <camel.osgi.export.pkg>org.apache.camel.bam.*</camel.osgi.export.pkg>
+    <eclipselink-version>2.3.2</eclipselink-version>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-spring</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-orm</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-jdbc</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.specs</groupId>
+      <artifactId>geronimo-jpa_2.0_spec</artifactId>
+    </dependency>
+
+    <!-- testing -->
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-test</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-juel</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-log4j12</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <forkMode>always</forkMode>
+          <forkedProcessTimeoutInSeconds>300</forkedProcessTimeoutInSeconds>
+          <systemProperties>
+            <property>
+              <name>derby.stream.error.file</name>
+              <value>target/derby.log</value>
+            </property>
+          </systemProperties>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+  <profiles>
+    <!--  Hibernate Derby profile -->
+    <profile>
+      <id>hibernate-derby</id>
+      <activation>
+        <activeByDefault>true</activeByDefault>
+      </activation>
+      <build>
+        <testResources>
+          <testResource>
+            <directory>${basedir}/src/test/profiles/derby</directory>
+          </testResource>
+        </testResources>
+      </build>
+      <dependencies>
         <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-log4j12</artifactId>
-            <scope>test</scope>
+          <groupId>org.hibernate</groupId>
+          <artifactId>hibernate-entitymanager</artifactId>
+          <scope>test</scope>
         </dependency>
-		<dependency>
-			<groupId>junit</groupId>
-			<artifactId>junit</artifactId>
-			<scope>test</scope>
-		</dependency>
-	</dependencies>
-
-
-	<build>
-		<plugins>
-			<plugin>
-				<artifactId>maven-surefire-plugin</artifactId>
-				<configuration>
-					<forkMode>always</forkMode>
-				</configuration>
-			</plugin>
-		</plugins>
-	</build>
-
-	<profiles>
-
-		<!--  Hibernate HSQL profile -->
-		<profile>
-			<id>hibernate-hsqldb</id>
-			<build>
-				<testResources>
-					<testResource>
-						<directory>${basedir}/src/test/profiles/hibernate</directory>
-					</testResource>
-				</testResources>
-			</build>
-			<dependencies>
-				<dependency>
-					<groupId>org.hibernate</groupId>
-					<artifactId>hibernate-entitymanager</artifactId>
-					<scope>test</scope>
-				</dependency>
-				<dependency>
-					<groupId>org.hibernate</groupId>
-					<artifactId>hibernate</artifactId>
-					<scope>test</scope>
-				</dependency>
-				<dependency>
-					<groupId>org.hsqldb</groupId>
-					<artifactId>hsqldb</artifactId>
-					<scope>test</scope>
-				</dependency>
-				<dependency>
-					<groupId>org.apache.geronimo.specs</groupId>
-					<artifactId>geronimo-jta_1.1_spec</artifactId>
-					<version>${geronimo-jta-spec-version}</version>
-					<scope>test</scope>
-				</dependency>
-			</dependencies>
-		</profile>
-
-		<!--  Hibernate Derby profile -->
-		<profile>
-			<id>hibernate-derby</id>
-			<activation>
-				<activeByDefault>true</activeByDefault>
-			</activation>
-			<build>
-				<testResources>
-					<testResource>
-						<directory>${basedir}/src/test/profiles/derby</directory>
-					</testResource>
-				</testResources>
-			</build>
-			<dependencies>
-				<dependency>
-					<groupId>org.hibernate</groupId>
-					<artifactId>hibernate-entitymanager</artifactId>
-					<scope>test</scope>
-				</dependency>
-				<dependency>
-					<groupId>org.hibernate</groupId>
-					<artifactId>hibernate</artifactId>
-					<scope>test</scope>
-				</dependency>
-				<dependency>
-					<groupId>org.apache.derby</groupId>
-					<artifactId>derby</artifactId>
-					<scope>test</scope>
-				</dependency>
-				<dependency>
-					<groupId>org.apache.geronimo.specs</groupId>
-					<artifactId>geronimo-jta_1.1_spec</artifactId>
-					<version>${geronimo-jta-spec-version}</version>
-					<scope>test</scope>
-				</dependency>
-			</dependencies>
-		</profile>
-
-		<!--  Mysql profile -->
-		<profile>
-			<id>mysql</id>
-			<build>
-				<testResources>
-					<testResource>
-						<directory>${basedir}/src/test/profiles/mysql</directory>
-					</testResource>
-				</testResources>
-			</build>
-			<dependencies>
-				<dependency>
-					<groupId>org.hibernate</groupId>
-					<artifactId>hibernate-entitymanager</artifactId>
-					<scope>test</scope>
-				</dependency>
-				<dependency>
-					<groupId>org.hibernate</groupId>
-					<artifactId>hibernate</artifactId>
-					<scope>test</scope>
-				</dependency>
-				<dependency>
-					<groupId>mysql</groupId>
-					<artifactId>mysql-connector-java</artifactId>
-					<version>5.1.6</version>
-					<scope>test</scope>
-				</dependency>
-				<dependency>
-					<groupId>org.apache.geronimo.specs</groupId>
-					<artifactId>geronimo-jta_1.1_spec</artifactId>
-					<version>${geronimo-spec-version}</version>
-					<scope>test</scope>
-				</dependency>
-			</dependencies>
-		</profile>
-
-		<!-- EclipseLink - HSQLDB -->
-		<!-- TODO fix the issue of CAMEL-2277 -->
-		<profile>
-			<id>eclipselink</id>
-			<build>
-				<testResources>
-					<testResource>
-						<directory>${basedir}/src/test/profiles/eclipselink</directory>
-					</testResource>
-				</testResources>
-			</build>
-			<dependencies>
-				<dependency>
-					<groupId>org.eclipse.persistence</groupId>
-					<artifactId>eclipselink</artifactId>
-					<version>2.0.0</version>
-					<scope>test</scope>
-				</dependency>
-				<dependency>
-					<groupId>org.hsqldb</groupId>
-					<artifactId>hsqldb</artifactId>
-					<scope>test</scope>
-				</dependency>
-			</dependencies>
-			<repositories>
-				<repository>
-					<id>Eclipse</id>
-					<url>http://www.eclipse.org/downloads/download.php?r=1&amp;nf=1&amp;file=/rt/eclipselink/maven.repo</url>
-				</repository>
-			</repositories>
-		</profile>
-
-		<!--  OpenJPA profile -->
-		<!-- TODO fix the issue of CAMEL-2277 -->
-		<profile>
-			<id>openjpa</id>
-			<build>
-				<testResources>
-					<testResource>
-						<directory>${basedir}/src/test/profiles/openjpa</directory>
-					</testResource>
-				</testResources>
-				<resources>
-					<resource>
-						<directory>${basedir}/src/test/profiles/openjpa</directory>
-					</resource>
-				</resources>
-				<plugins>
-					<plugin>
-
-						<!-- Will enhance classes as we run in a non J2EE 5 env <plugin> -->
-						<groupId>org.codehaus.mojo</groupId>
-						<artifactId>openjpa-maven-plugin</artifactId>
-						<executions>
-							<execution>
-								<id>JPA Enhance</id>
-								<phase>process-test-classes</phase>
-								<goals>
-									<goal>enhance</goal>
-								</goals>
-							</execution>
-						</executions>
-						<configuration>
-							<addDefaultConstructor>true</addDefaultConstructor>
-							<enforcePropertyRestrictions>true</enforcePropertyRestrictions>
-						</configuration>
-						<dependencies>
-				            <dependency>
-			                     <groupId>org.apache.camel</groupId>
-			                     <artifactId>camel-core</artifactId>
-			                     <version>${project.version}</version>
-		                    </dependency>
-		                    <dependency>
-			                     <groupId>org.springframework</groupId>
-			                     <artifactId>spring-orm</artifactId>
-			                     <version>${spring-version}</version>
-		                    </dependency>
-						</dependencies>
-					</plugin>
-				</plugins>
-			</build>
-			<dependencies>
-				<dependency>
-					<groupId>org.apache.openjpa</groupId>
-					<artifactId>openjpa</artifactId>
-					<!--
-						Can't be used as we have this error : Caused by:
-						<openjpa-1.2.1-r752877:753278 nonfatal general error>
-						it is same with openjpa-1.2.2
-						org.apache.openjpa.persistence.PersistenceException: Constraint
-						already exists: UNQ_NAME in statement [CREATE TABLE
-						CAMEL_PROCESSDEFINITION (id BIGINT NOT NULL, name VARCHAR(255) NOT
-						NULL, PRIMARY KEY (id), CONSTRAINT UNQ_name UNIQUE (name))] and
-						solved in openJpa 1.3.0-SNAPSHOT, as we are heading to camel 2.2.2 release
-						I change the version to lastest released openjpa 
-					-->
-					<version>1.2.2</version>
-					<scope>test</scope>
-				</dependency>
-				<dependency>
-					<groupId>org.hsqldb</groupId>
-					<artifactId>hsqldb</artifactId>
-					<scope>test</scope>
-				</dependency>
-				<dependency>
-					<groupId>org.apache.derby</groupId>
-					<artifactId>derby</artifactId>
-					<scope>test</scope>
-				</dependency>
-			</dependencies>
-		</profile>
-	</profiles>
-</project>
+        <dependency>
+          <groupId>org.hibernate</groupId>
+          <artifactId>hibernate</artifactId>
+          <scope>test</scope>
+        </dependency>
+        <dependency>
+          <groupId>org.apache.derby</groupId>
+          <artifactId>derby</artifactId>
+          <scope>test</scope>
+        </dependency>
+        <dependency>
+          <groupId>org.apache.geronimo.specs</groupId>
+          <artifactId>geronimo-jta_1.1_spec</artifactId>
+          <version>${geronimo-jta-spec-version}</version>
+          <scope>test</scope>
+        </dependency>
+      </dependencies>
+    </profile>
 
+    <!-- EclipseLink HSQLDB profile -->
+    <!-- TODO fix the issue of CAMEL-2277 -->
+    <profile>
+      <id>eclipselink</id>
+      <build>
+        <testResources>
+          <testResource>
+            <directory>${basedir}/src/test/profiles/eclipselink</directory>
+          </testResource>
+        </testResources>
+      </build>
+      <dependencies>
+        <dependency>
+          <groupId>org.eclipse.persistence</groupId>
+          <artifactId>eclipselink</artifactId>
+          <version>${eclipselink-version}</version>
+          <scope>test</scope>
+        </dependency>
+        <dependency>
+          <groupId>org.hsqldb</groupId>
+          <artifactId>hsqldb</artifactId>
+          <scope>test</scope>
+        </dependency>
+      </dependencies>
+      <repositories>
+        <repository>
+          <id>Eclipse</id>
+          <url>http://www.eclipse.org/downloads/download.php?r=1&amp;nf=1&amp;file=/rt/eclipselink/maven.repo</url>
+        </repository>
+      </repositories>
+    </profile>
+
+    <!--  OpenJPA HSQLDB profile -->
+    <!-- TODO fix the issue of CAMEL-2277 -->
+    <profile>
+      <id>openjpa</id>
+      <build>
+        <testResources>
+          <testResource>
+            <directory>${basedir}/src/test/profiles/openjpa</directory>
+          </testResource>
+        </testResources>
+        <resources>
+          <resource>
+            <directory>${basedir}/src/test/profiles/openjpa</directory>
+          </resource>
+        </resources>
+        <plugins>
+          <plugin>
+
+            <!-- Will enhance classes as we run in a non J2EE 5 env <plugin> -->
+            <groupId>org.apache.openjpa</groupId>
+            <artifactId>openjpa-maven-plugin</artifactId>
+            <version>${openjpa-version}</version>
+            <executions>
+              <execution>
+                <id>JPA Enhance</id>
+                <phase>process-test-classes</phase>
+                <goals>
+                  <goal>enhance</goal>
+                </goals>
+              </execution>
+            </executions>
+            <configuration>
+              <addDefaultConstructor>true</addDefaultConstructor>
+              <enforcePropertyRestrictions>true</enforcePropertyRestrictions>
+            </configuration>
+            <dependencies>
+              <dependency>
+                <groupId>org.apache.camel</groupId>
+                <artifactId>camel-core</artifactId>
+                <version>${project.version}</version>
+              </dependency>
+              <dependency>
+                <groupId>org.springframework</groupId>
+                <artifactId>spring-orm</artifactId>
+                <version>${spring-version}</version>
+              </dependency>
+            </dependencies>
+          </plugin>
+        </plugins>
+      </build>
+
+      <dependencies>
+        <dependency>
+          <groupId>org.apache.openjpa</groupId>
+          <artifactId>openjpa</artifactId>
+          <version>${openjpa-version}</version>
+          <scope>test</scope>
+        </dependency>
+        <dependency>
+          <groupId>org.hsqldb</groupId>
+          <artifactId>hsqldb</artifactId>
+          <scope>test</scope>
+        </dependency>
+        <!--<dependency>-->
+          <!--<groupId>org.apache.derby</groupId>-->
+          <!--<artifactId>derby</artifactId>-->
+          <!--<scope>test</scope>-->
+        <!--</dependency>-->
+      </dependencies>
+    </profile>
+  </profiles>
+</project>

Modified: camel/branches/camel-2.9.x/components/camel-bam/src/main/java/org/apache/camel/bam/rules/ProcessRules.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-bam/src/main/java/org/apache/camel/bam/rules/ProcessRules.java?rev=1331870&r1=1331869&r2=1331870&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-bam/src/main/java/org/apache/camel/bam/rules/ProcessRules.java (original)
+++ camel/branches/camel-2.9.x/components/camel-bam/src/main/java/org/apache/camel/bam/rules/ProcessRules.java Sun Apr 29 07:30:06 2012
@@ -33,13 +33,13 @@ public class ProcessRules extends Servic
     private ProcessDefinition processDefinition;
     private List<ActivityRules> activities = new ArrayList<ActivityRules>();
 
-    public void processExpired(ActivityState activityState) throws Exception {
+    public synchronized void processExpired(ActivityState activityState) throws Exception {
         for (ActivityRules activityRules : activities) {
             activityRules.processExpired(activityState);
         }
     }
 
-    public void processExchange(Exchange exchange, ProcessInstance process) {
+    public synchronized void processExchange(Exchange exchange, ProcessInstance process) {
         for (ActivityRules activityRules : activities) {
             activityRules.processExchange(exchange, process);
         }