git commit: CAMEL-6315: Fixed some scala compile warnings.

2013-05-10 Thread davsclaus
Updated Branches:
  refs/heads/master e6eff40bc -> 3cb60dd92


CAMEL-6315: Fixed some scala compile warnings.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/3cb60dd9
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/3cb60dd9
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/3cb60dd9

Branch: refs/heads/master
Commit: 3cb60dd92cf006002a6aa601b8b13385c9f1555b
Parents: e6eff40
Author: Claus Ibsen 
Authored: Sat May 11 08:49:41 2013 +0200
Committer: Claus Ibsen 
Committed: Sat May 11 08:49:41 2013 +0200

--
 .../org/apache/camel/scala/RichExchange.scala  |2 +-
 .../camel/scala/converter/ScalaCollections.scala   |3 ---
 .../camel/scala/dsl/SAbstractDefinition.scala  |2 +-
 .../camel/scala/dsl/builder/RouteBuilder.scala |2 +-
 .../camel/scala/converter/ConverterSpec.scala  |2 +-
 .../org/apache/camel/scala/dsl/RollbackTest.scala  |4 ++--
 6 files changed, 6 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/3cb60dd9/components/camel-scala/src/main/scala/org/apache/camel/scala/RichExchange.scala
--
diff --git 
a/components/camel-scala/src/main/scala/org/apache/camel/scala/RichExchange.scala
 
b/components/camel-scala/src/main/scala/org/apache/camel/scala/RichExchange.scala
index 690609e..467cd97 100644
--- 
a/components/camel-scala/src/main/scala/org/apache/camel/scala/RichExchange.scala
+++ 
b/components/camel-scala/src/main/scala/org/apache/camel/scala/RichExchange.scala
@@ -32,7 +32,7 @@ class RichExchange(val exchange : Exchange) extends Exchange {
   def in(header:String) : Any = exchange.getIn.getHeader(header)
 
   def in = exchange.getIn.getBody
-  def in[T](implicit manifest: Manifest[T]) : T = 
exchange.getIn.getBody(manifest.erasure).asInstanceOf[T]
+  def in[T](implicit manifest: Manifest[T]) : T = 
exchange.getIn.getBody(manifest.runtimeClass).asInstanceOf[T]
 
   def out = exchange.getOut.getBody
 

http://git-wip-us.apache.org/repos/asf/camel/blob/3cb60dd9/components/camel-scala/src/main/scala/org/apache/camel/scala/converter/ScalaCollections.scala
--
diff --git 
a/components/camel-scala/src/main/scala/org/apache/camel/scala/converter/ScalaCollections.scala
 
b/components/camel-scala/src/main/scala/org/apache/camel/scala/converter/ScalaCollections.scala
index 0869243..0f57b2b 100644
--- 
a/components/camel-scala/src/main/scala/org/apache/camel/scala/converter/ScalaCollections.scala
+++ 
b/components/camel-scala/src/main/scala/org/apache/camel/scala/converter/ScalaCollections.scala
@@ -18,9 +18,6 @@ package org.apache.camel.scala.converter
 import org.apache.camel.Converter
 import collection.JavaConversions._
 
-/**
- * @author Alexander Azarov 
- */
 @Converter
 class ScalaImmutableCollections {
   import collection.{Iterator, Iterable, Map, Seq, Set}

http://git-wip-us.apache.org/repos/asf/camel/blob/3cb60dd9/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/SAbstractDefinition.scala
--
diff --git 
a/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/SAbstractDefinition.scala
 
b/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/SAbstractDefinition.scala
index e4ad9c6..9cc34c4 100644
--- 
a/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/SAbstractDefinition.scala
+++ 
b/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/SAbstractDefinition.scala
@@ -74,7 +74,7 @@ abstract class SAbstractDefinition[P <: 
ProcessorDefinition[_]] extends DSL with
 
   def filter(predicate: Exchange => Any) = 
SFilterDefinition(target.filter(predicateBuilder(predicate)))
 
-  def handle[E <: Throwable](block: => Unit)(implicit manifest: Manifest[E]) = 
SOnExceptionDefinition[E](target.onException(manifest.erasure.asInstanceOf[Class[Throwable]])).apply(block)
+  def handle[E <: Throwable](block: => Unit)(implicit manifest: Manifest[E]) = 
SOnExceptionDefinition[E](target.onException(manifest.runtimeClass.asInstanceOf[Class[Throwable]])).apply(block)
 
   def id(id : String) = wrap(target.id(id))
   def idempotentConsumer(expression: Exchange => Any) = 
SIdempotentConsumerDefinition(target.idempotentConsumer(expression, null))

http://git-wip-us.apache.org/repos/asf/camel/blob/3cb60dd9/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/builder/RouteBuilder.scala
--
diff --git 
a/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/builder/RouteBuilder.scala
 
b/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/builder/RouteBuilder.scala
index c283c

git commit: CAMEL-6315: Removed camel-scala29 as its no longer supported from Camel 2.12 onwards.

2013-05-10 Thread davsclaus
Updated Branches:
  refs/heads/master 9ea0a2725 -> e6eff40bc


CAMEL-6315: Removed camel-scala29 as its no longer supported from Camel 2.12 
onwards.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/e6eff40b
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/e6eff40b
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/e6eff40b

Branch: refs/heads/master
Commit: e6eff40bc503aa1ba0fc6cce5d0e2422835b2eec
Parents: 9ea0a27
Author: Claus Ibsen 
Authored: Fri May 10 17:28:02 2013 +0200
Committer: Claus Ibsen 
Committed: Fri May 10 17:28:02 2013 +0200

--
 apache-camel/pom.xml   |4 -
 apache-camel/src/main/descriptors/common-bin.xml   |1 -
 components/camel-scala29/pom.xml   |  215 ---
 .../src/main/resources/META-INF/LICENSE.txt|  203 --
 .../src/main/resources/META-INF/NOTICE.txt |   11 -
 components/pom.xml |1 -
 parent/pom.xml |7 -
 .../karaf/features/src/main/resources/features.xml |6 -
 8 files changed, 0 insertions(+), 448 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/e6eff40b/apache-camel/pom.xml
--
diff --git a/apache-camel/pom.xml b/apache-camel/pom.xml
index d5a7387..bc0e744 100644
--- a/apache-camel/pom.xml
+++ b/apache-camel/pom.xml
@@ -436,10 +436,6 @@
 
 
   org.apache.camel
-  camel-scala_2.9
-
-
-  org.apache.camel
   camel-script
 
 

http://git-wip-us.apache.org/repos/asf/camel/blob/e6eff40b/apache-camel/src/main/descriptors/common-bin.xml
--
diff --git a/apache-camel/src/main/descriptors/common-bin.xml 
b/apache-camel/src/main/descriptors/common-bin.xml
index c2d3d7e..25ca259 100644
--- a/apache-camel/src/main/descriptors/common-bin.xml
+++ b/apache-camel/src/main/descriptors/common-bin.xml
@@ -121,7 +121,6 @@
 org.apache.camel:camel-rx
 org.apache.camel:camel-saxon
 org.apache.camel:camel-scala
-org.apache.camel:camel-scala_2.9
 org.apache.camel:camel-script
 org.apache.camel:camel-servlet
 org.apache.camel:camel-servletlistener

http://git-wip-us.apache.org/repos/asf/camel/blob/e6eff40b/components/camel-scala29/pom.xml
--
diff --git a/components/camel-scala29/pom.xml b/components/camel-scala29/pom.xml
deleted file mode 100644
index daa727b..000
--- a/components/camel-scala29/pom.xml
+++ /dev/null
@@ -1,215 +0,0 @@
-
-
-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";>
-  4.0.0
-
-  
-org.apache.camel
-components
-2.12-SNAPSHOT
-  
-
-  camel-scala_2.9
-  bundle
-  Camel :: Scala 2.9
-  Camel Scala 2.9 DSL
-
-  
-
-  scala.*;version="[2.9,2.10)"
-
-org.apache.camel.scala.*
-2.9.2
-  
-
-  
-
-  org.apache.camel
-  camel-core
-
-
-  org.scala-lang
-  scala-library
-  ${scala29-version}
-  provided
-
-
-
-
-org.scalatest
-scalatest_${scala29-version}
-1.8
-test
-
-
-  org.apache.camel
-  camel-core
-  test-jar
-  test
-
-
-  org.apache.camel
-  camel-juel
-  test
-
-
-  org.apache.camel
-  camel-jxpath
-  test
-
-
-  org.apache.camel
-  camel-velocity
-  test
-
-
-  org.apache.camel
-  camel-test-spring
-  test
-
-
-  junit
-  junit
-  test
-
-
-  org.slf4j
-  slf4j-log4j12
-  test
-
-  
-
-  
-
-
-
-target/main/scala
-target/main/resources
-target/test/scala
-
-
-  
-org.apache.maven.plugins
-maven-surefire-plugin
-
-  
-**/*Test.class
-**/*Spec.class
-  
-
-  
-
-  
-maven-resources-plugin
-
-  
-copy-main-resources
-validate
-
-  copy-resources
-
-
-  ${basedir}/target/main
-  
-
-  ../camel-scala/src/main
-  true
-
-  
-
-  
-  
-copy-test-resources
-validate
-
-  copy-resources
-
-
-  ${basedir}/target/test
-  
-
-  ../camel-scala/src/test
-   

[1/2] git commit: CAMEL-6349: camel-restlet - Should set response correctly on Exchange depending on has out or not

2013-05-10 Thread davsclaus
Updated Branches:
  refs/heads/camel-2.10.x 69dac4300 -> cdf113969
  refs/heads/camel-2.11.x 9e709b24c -> fddfc0faf


CAMEL-6349: camel-restlet - Should set response correctly on Exchange depending 
on has out or not


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/fddfc0fa
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/fddfc0fa
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/fddfc0fa

Branch: refs/heads/camel-2.11.x
Commit: fddfc0fafe10ba619581474bb075e81bcc19af03
Parents: 9e709b2
Author: Claus Ibsen 
Authored: Fri May 10 16:27:23 2013 +0200
Committer: Claus Ibsen 
Committed: Fri May 10 16:28:04 2013 +0200

--
 .../component/restlet/DefaultRestletBinding.java   |2 +-
 .../component/restlet/RestletSetBodyTest.java  |   43 +++
 2 files changed, 44 insertions(+), 1 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/fddfc0fa/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/DefaultRestletBinding.java
--
diff --git 
a/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/DefaultRestletBinding.java
 
b/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/DefaultRestletBinding.java
index 2aecb7c..f00de32 100644
--- 
a/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/DefaultRestletBinding.java
+++ 
b/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/DefaultRestletBinding.java
@@ -195,7 +195,7 @@ public class DefaultRestletBinding implements 
RestletBinding, HeaderFilterStrate
 return;
 }
 } else {
-out = exchange.getOut();
+out = exchange.hasOut() ? exchange.getOut() : exchange.getIn();
 }
 
 // get content type

http://git-wip-us.apache.org/repos/asf/camel/blob/fddfc0fa/components/camel-restlet/src/test/java/org/apache/camel/component/restlet/RestletSetBodyTest.java
--
diff --git 
a/components/camel-restlet/src/test/java/org/apache/camel/component/restlet/RestletSetBodyTest.java
 
b/components/camel-restlet/src/test/java/org/apache/camel/component/restlet/RestletSetBodyTest.java
new file mode 100644
index 000..bb2ec77
--- /dev/null
+++ 
b/components/camel-restlet/src/test/java/org/apache/camel/component/restlet/RestletSetBodyTest.java
@@ -0,0 +1,43 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.restlet;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.junit.Test;
+
+/**
+ * @version 
+ */
+public class RestletSetBodyTest extends RestletTestSupport {
+
+@Test
+public void testSetBody() throws Exception {
+String response = template.requestBody("restlet:http://0.0.0.0:"; + 
portNum + "/stock/ORCL?restletMethod=get", null, String.class);
+assertEquals("110", response);
+}
+
+@Override
+protected RouteBuilder createRouteBuilder() throws Exception {
+return new RouteBuilder() {
+@Override
+public void configure() throws Exception {
+from("restlet:http://0.0.0.0:"; + portNum + 
"/stock/{symbol}?restletMethods=get")
+.setBody().constant("110");
+}
+};
+}
+}



[2/2] git commit: CAMEL-6349: camel-restlet - Should set response correctly on Exchange depending on has out or not

2013-05-10 Thread davsclaus
CAMEL-6349: camel-restlet - Should set response correctly on Exchange depending 
on has out or not


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/cdf11396
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/cdf11396
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/cdf11396

Branch: refs/heads/camel-2.10.x
Commit: cdf1139696804ec7468a77f016b8b27825f83d6d
Parents: 69dac43
Author: Claus Ibsen 
Authored: Fri May 10 16:27:23 2013 +0200
Committer: Claus Ibsen 
Committed: Fri May 10 16:28:18 2013 +0200

--
 .../component/restlet/DefaultRestletBinding.java   |2 +-
 .../component/restlet/RestletSetBodyTest.java  |   43 +++
 2 files changed, 44 insertions(+), 1 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/cdf11396/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/DefaultRestletBinding.java
--
diff --git 
a/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/DefaultRestletBinding.java
 
b/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/DefaultRestletBinding.java
index 0693f96..19b67d1 100644
--- 
a/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/DefaultRestletBinding.java
+++ 
b/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/DefaultRestletBinding.java
@@ -192,7 +192,7 @@ public class DefaultRestletBinding implements 
RestletBinding, HeaderFilterStrate
 return;
 }
 } else {
-out = exchange.getOut();
+out = exchange.hasOut() ? exchange.getOut() : exchange.getIn();
 }
 
 // get content type

http://git-wip-us.apache.org/repos/asf/camel/blob/cdf11396/components/camel-restlet/src/test/java/org/apache/camel/component/restlet/RestletSetBodyTest.java
--
diff --git 
a/components/camel-restlet/src/test/java/org/apache/camel/component/restlet/RestletSetBodyTest.java
 
b/components/camel-restlet/src/test/java/org/apache/camel/component/restlet/RestletSetBodyTest.java
new file mode 100644
index 000..bb2ec77
--- /dev/null
+++ 
b/components/camel-restlet/src/test/java/org/apache/camel/component/restlet/RestletSetBodyTest.java
@@ -0,0 +1,43 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.restlet;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.junit.Test;
+
+/**
+ * @version 
+ */
+public class RestletSetBodyTest extends RestletTestSupport {
+
+@Test
+public void testSetBody() throws Exception {
+String response = template.requestBody("restlet:http://0.0.0.0:"; + 
portNum + "/stock/ORCL?restletMethod=get", null, String.class);
+assertEquals("110", response);
+}
+
+@Override
+protected RouteBuilder createRouteBuilder() throws Exception {
+return new RouteBuilder() {
+@Override
+public void configure() throws Exception {
+from("restlet:http://0.0.0.0:"; + portNum + 
"/stock/{symbol}?restletMethods=get")
+.setBody().constant("110");
+}
+};
+}
+}



git commit: CAMEL-6349: camel-restlet - Should set response correctly on Exchange depending on has out or not

2013-05-10 Thread davsclaus
Updated Branches:
  refs/heads/master af371089f -> 9ea0a2725


CAMEL-6349: camel-restlet - Should set response correctly on Exchange depending 
on has out or not


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/9ea0a272
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/9ea0a272
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/9ea0a272

Branch: refs/heads/master
Commit: 9ea0a2725392f0869924c8d3b8116494b4108583
Parents: af37108
Author: Claus Ibsen 
Authored: Fri May 10 16:27:23 2013 +0200
Committer: Claus Ibsen 
Committed: Fri May 10 16:27:23 2013 +0200

--
 .../component/restlet/DefaultRestletBinding.java   |2 +-
 .../component/restlet/RestletSetBodyTest.java  |   43 +++
 2 files changed, 44 insertions(+), 1 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/9ea0a272/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/DefaultRestletBinding.java
--
diff --git 
a/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/DefaultRestletBinding.java
 
b/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/DefaultRestletBinding.java
index 2aecb7c..f00de32 100644
--- 
a/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/DefaultRestletBinding.java
+++ 
b/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/DefaultRestletBinding.java
@@ -195,7 +195,7 @@ public class DefaultRestletBinding implements 
RestletBinding, HeaderFilterStrate
 return;
 }
 } else {
-out = exchange.getOut();
+out = exchange.hasOut() ? exchange.getOut() : exchange.getIn();
 }
 
 // get content type

http://git-wip-us.apache.org/repos/asf/camel/blob/9ea0a272/components/camel-restlet/src/test/java/org/apache/camel/component/restlet/RestletSetBodyTest.java
--
diff --git 
a/components/camel-restlet/src/test/java/org/apache/camel/component/restlet/RestletSetBodyTest.java
 
b/components/camel-restlet/src/test/java/org/apache/camel/component/restlet/RestletSetBodyTest.java
new file mode 100644
index 000..bb2ec77
--- /dev/null
+++ 
b/components/camel-restlet/src/test/java/org/apache/camel/component/restlet/RestletSetBodyTest.java
@@ -0,0 +1,43 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.restlet;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.junit.Test;
+
+/**
+ * @version 
+ */
+public class RestletSetBodyTest extends RestletTestSupport {
+
+@Test
+public void testSetBody() throws Exception {
+String response = template.requestBody("restlet:http://0.0.0.0:"; + 
portNum + "/stock/ORCL?restletMethod=get", null, String.class);
+assertEquals("110", response);
+}
+
+@Override
+protected RouteBuilder createRouteBuilder() throws Exception {
+return new RouteBuilder() {
+@Override
+public void configure() throws Exception {
+from("restlet:http://0.0.0.0:"; + portNum + 
"/stock/{symbol}?restletMethods=get")
+.setBody().constant("110");
+}
+};
+}
+}



[2/2] git commit: CAMEL-6348: Fixed getting and restoring JAAS Configuration if non existed. Thanks to David Arthur for the patch.

2013-05-10 Thread davsclaus
CAMEL-6348: Fixed getting and restoring JAAS Configuration if non existed. 
Thanks to David Arthur for the patch.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/69dac430
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/69dac430
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/69dac430

Branch: refs/heads/camel-2.10.x
Commit: 69dac43004c3bf4871f83863fadaf8987f21d432
Parents: f7697b6
Author: Claus Ibsen 
Authored: Fri May 10 15:42:51 2013 +0200
Committer: Claus Ibsen 
Committed: Fri May 10 15:43:36 2013 +0200

--
 .../apache/camel/component/hdfs/HdfsComponent.java |   25 +++
 .../apache/camel/component/hdfs/HdfsConsumer.java  |8 +---
 .../camel/component/hdfs/HdfsInfoFactory.java  |8 +---
 .../apache/camel/component/hdfs/HdfsProducer.java  |   16 ++---
 4 files changed, 33 insertions(+), 24 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/69dac430/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsComponent.java
--
diff --git 
a/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsComponent.java
 
b/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsComponent.java
index 76baa99..1920e1c 100644
--- 
a/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsComponent.java
+++ 
b/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsComponent.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.hdfs;
 
 import java.net.URL;
 import java.util.Map;
+import javax.security.auth.login.Configuration;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.Endpoint;
@@ -54,4 +55,28 @@ public class HdfsComponent extends DefaultComponent {
 }
 }
 
+static Configuration getJAASConfiguration() {
+Configuration auth = null;
+try {
+auth = Configuration.getConfiguration();
+LOG.trace("Existing JAAS Configuration {}", auth);
+} catch (SecurityException e) {
+LOG.trace("Cannot load existing JAAS configuration", e);
+}
+return auth;
+}
+
+static void setJAASConfiguration(Configuration auth) {
+if (auth != null) {
+LOG.trace("Restoring existing JAAS Configuration {}", auth);
+try {
+Configuration.setConfiguration(auth);
+} catch (SecurityException e) {
+LOG.trace("Cannot restore JAAS Configuration. This exception 
is ignored.", e);
+}
+} else {
+LOG.trace("No JAAS Configuration to restore");
+}
+}
+
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/69dac430/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsConsumer.java
--
diff --git 
a/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsConsumer.java
 
b/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsConsumer.java
index 8a6e0ba..b24a9ea 100644
--- 
a/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsConsumer.java
+++ 
b/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsConsumer.java
@@ -93,15 +93,11 @@ public final class HdfsConsumer extends 
ScheduledPollConsumer {
 @Override
 protected int poll() throws Exception {
 // need to remember auth as Hadoop will override that, which otherwise 
means the Auth is broken afterwards
-Configuration auth = Configuration.getConfiguration();
-log.trace("Existing JAAS Configuration {}", auth);
+Configuration auth = HdfsComponent.getJAASConfiguration();
 try {
 return doPoll();
 } finally {
-if (auth != null) {
-log.trace("Restoring existing JAAS Configuration {}", auth);
-Configuration.setConfiguration(auth);
-}
+HdfsComponent.setJAASConfiguration(auth);
 }
 }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/69dac430/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsInfoFactory.java
--
diff --git 
a/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsInfoFactory.java
 
b/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsInfoFactory.java
index 0766ea3..9511c64 100644
--- 
a/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsInfoFactory.java
+++ 
b/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsInfoFactory.java
@@ -31,15 +31,11 @@ public final class HdfsInfoFactory {
 
 public st

[1/2] git commit: CAMEL-6348: Fixed getting and restoring JAAS Configuration if non existed. Thanks to David Arthur for the patch.

2013-05-10 Thread davsclaus
Updated Branches:
  refs/heads/camel-2.10.x f7697b6ef -> 69dac4300
  refs/heads/camel-2.11.x fa7dd10f3 -> 9e709b24c


CAMEL-6348: Fixed getting and restoring JAAS Configuration if non existed. 
Thanks to David Arthur for the patch.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/9e709b24
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/9e709b24
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/9e709b24

Branch: refs/heads/camel-2.11.x
Commit: 9e709b24cb8a4d75cfa0b16f5b2fe59b24187ad5
Parents: fa7dd10
Author: Claus Ibsen 
Authored: Fri May 10 15:42:51 2013 +0200
Committer: Claus Ibsen 
Committed: Fri May 10 15:43:16 2013 +0200

--
 .../apache/camel/component/hdfs/HdfsComponent.java |   25 +++
 .../apache/camel/component/hdfs/HdfsConsumer.java  |8 +---
 .../camel/component/hdfs/HdfsInfoFactory.java  |8 +---
 .../apache/camel/component/hdfs/HdfsProducer.java  |   16 ++---
 4 files changed, 33 insertions(+), 24 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/9e709b24/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsComponent.java
--
diff --git 
a/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsComponent.java
 
b/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsComponent.java
index 76baa99..1920e1c 100644
--- 
a/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsComponent.java
+++ 
b/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsComponent.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.hdfs;
 
 import java.net.URL;
 import java.util.Map;
+import javax.security.auth.login.Configuration;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.Endpoint;
@@ -54,4 +55,28 @@ public class HdfsComponent extends DefaultComponent {
 }
 }
 
+static Configuration getJAASConfiguration() {
+Configuration auth = null;
+try {
+auth = Configuration.getConfiguration();
+LOG.trace("Existing JAAS Configuration {}", auth);
+} catch (SecurityException e) {
+LOG.trace("Cannot load existing JAAS configuration", e);
+}
+return auth;
+}
+
+static void setJAASConfiguration(Configuration auth) {
+if (auth != null) {
+LOG.trace("Restoring existing JAAS Configuration {}", auth);
+try {
+Configuration.setConfiguration(auth);
+} catch (SecurityException e) {
+LOG.trace("Cannot restore JAAS Configuration. This exception 
is ignored.", e);
+}
+} else {
+LOG.trace("No JAAS Configuration to restore");
+}
+}
+
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/9e709b24/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsConsumer.java
--
diff --git 
a/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsConsumer.java
 
b/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsConsumer.java
index 8a6e0ba..b24a9ea 100644
--- 
a/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsConsumer.java
+++ 
b/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsConsumer.java
@@ -93,15 +93,11 @@ public final class HdfsConsumer extends 
ScheduledPollConsumer {
 @Override
 protected int poll() throws Exception {
 // need to remember auth as Hadoop will override that, which otherwise 
means the Auth is broken afterwards
-Configuration auth = Configuration.getConfiguration();
-log.trace("Existing JAAS Configuration {}", auth);
+Configuration auth = HdfsComponent.getJAASConfiguration();
 try {
 return doPoll();
 } finally {
-if (auth != null) {
-log.trace("Restoring existing JAAS Configuration {}", auth);
-Configuration.setConfiguration(auth);
-}
+HdfsComponent.setJAASConfiguration(auth);
 }
 }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/9e709b24/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsInfoFactory.java
--
diff --git 
a/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsInfoFactory.java
 
b/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsInfoFactory.java
index 0766ea3..9511c64 100644
--- 
a/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsInfoFactory.java
+++ 
b/components/camel-hdfs/src/main/java/org/apac

git commit: CAMEL-6348: Fixed getting and restoring JAAS Configuration if non existed. Thanks to David Arthur for the patch.

2013-05-10 Thread davsclaus
Updated Branches:
  refs/heads/master e63b8beb8 -> af371089f


CAMEL-6348: Fixed getting and restoring JAAS Configuration if non existed. 
Thanks to David Arthur for the patch.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/af371089
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/af371089
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/af371089

Branch: refs/heads/master
Commit: af371089f21e2f28cd1446679ecdbfb63f1301c3
Parents: e63b8be
Author: Claus Ibsen 
Authored: Fri May 10 15:42:51 2013 +0200
Committer: Claus Ibsen 
Committed: Fri May 10 15:42:51 2013 +0200

--
 .../apache/camel/component/hdfs/HdfsComponent.java |   25 +++
 .../apache/camel/component/hdfs/HdfsConsumer.java  |8 +---
 .../camel/component/hdfs/HdfsInfoFactory.java  |8 +---
 .../apache/camel/component/hdfs/HdfsProducer.java  |   16 ++---
 4 files changed, 33 insertions(+), 24 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/af371089/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsComponent.java
--
diff --git 
a/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsComponent.java
 
b/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsComponent.java
index 76baa99..1920e1c 100644
--- 
a/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsComponent.java
+++ 
b/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsComponent.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.hdfs;
 
 import java.net.URL;
 import java.util.Map;
+import javax.security.auth.login.Configuration;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.Endpoint;
@@ -54,4 +55,28 @@ public class HdfsComponent extends DefaultComponent {
 }
 }
 
+static Configuration getJAASConfiguration() {
+Configuration auth = null;
+try {
+auth = Configuration.getConfiguration();
+LOG.trace("Existing JAAS Configuration {}", auth);
+} catch (SecurityException e) {
+LOG.trace("Cannot load existing JAAS configuration", e);
+}
+return auth;
+}
+
+static void setJAASConfiguration(Configuration auth) {
+if (auth != null) {
+LOG.trace("Restoring existing JAAS Configuration {}", auth);
+try {
+Configuration.setConfiguration(auth);
+} catch (SecurityException e) {
+LOG.trace("Cannot restore JAAS Configuration. This exception 
is ignored.", e);
+}
+} else {
+LOG.trace("No JAAS Configuration to restore");
+}
+}
+
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/af371089/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsConsumer.java
--
diff --git 
a/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsConsumer.java
 
b/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsConsumer.java
index 8a6e0ba..b24a9ea 100644
--- 
a/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsConsumer.java
+++ 
b/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsConsumer.java
@@ -93,15 +93,11 @@ public final class HdfsConsumer extends 
ScheduledPollConsumer {
 @Override
 protected int poll() throws Exception {
 // need to remember auth as Hadoop will override that, which otherwise 
means the Auth is broken afterwards
-Configuration auth = Configuration.getConfiguration();
-log.trace("Existing JAAS Configuration {}", auth);
+Configuration auth = HdfsComponent.getJAASConfiguration();
 try {
 return doPoll();
 } finally {
-if (auth != null) {
-log.trace("Restoring existing JAAS Configuration {}", auth);
-Configuration.setConfiguration(auth);
-}
+HdfsComponent.setJAASConfiguration(auth);
 }
 }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/af371089/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsInfoFactory.java
--
diff --git 
a/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsInfoFactory.java
 
b/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsInfoFactory.java
index 0766ea3..9511c64 100644
--- 
a/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsInfoFactory.java
+++ 
b/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsInfoFactory.java
@@ -31,15 +31,11

svn commit: r861530 - in /websites/production/camel/content: cache/main.pageCache stax.html

2013-05-10 Thread buildbot
Author: buildbot
Date: Fri May 10 13:18:41 2013
New Revision: 861530

Log:
Production update by buildbot for camel

Modified:
websites/production/camel/content/cache/main.pageCache
websites/production/camel/content/stax.html

Modified: websites/production/camel/content/cache/main.pageCache
==
Binary files - no diff available.

Modified: websites/production/camel/content/stax.html
==
--- websites/production/camel/content/stax.html (original)
+++ websites/production/camel/content/stax.html Fri May 10 13:18:41 2013
@@ -223,7 +223,14 @@ from("file:targ
 
 
 
-Where stax is a static method on 
org.apache.camel.component.stax.StAXBuilder which you can static 
import in the Java code.
+Where stax is a static method on 
org.apache.camel.component.stax.StAXBuilder which you can static 
import in the Java code. The stax builder is by default namespace aware on the 
XMLReader it uses. From Camel 2.11.1 onwards you can turn this off by 
setting the boolean parameter to false, as shown below:
+
+
+from("file:target/in")
+.split(stax(Record.class, false)).streaming()
+.to("mock:records");
+
+
 
 The previous 
example with XML DSL
 The example above could be implemented as follows in XML DSL




git commit: CAMEL-5359: Fixed camel-castor to be able to load mapping from XML file. Also fixed thread safety issues of marshaller. Thanks to Joshua Ecklund for patch. And also thanks to jacob vanderg

2013-05-10 Thread davsclaus
Updated Branches:
  refs/heads/camel-2.10.x fe19edcb1 -> f7697b6ef


CAMEL-5359: Fixed camel-castor to be able to load mapping from XML file. Also 
fixed thread safety issues of marshaller. Thanks to Joshua Ecklund for patch. 
And also thanks to jacob vandergoot for working with this.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f7697b6e
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f7697b6e
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f7697b6e

Branch: refs/heads/camel-2.10.x
Commit: f7697b6ef95d7090748efe35da68d7a14497681c
Parents: fe19edc
Author: Claus Ibsen 
Authored: Fri May 10 14:49:17 2013 +0200
Committer: Claus Ibsen 
Committed: Fri May 10 14:50:14 2013 +0200

--
 .../castor/AbstractCastorDataFormat.java   |  110 ---
 .../castor/MarshalWithMappingDomainObjectTest.java |7 +-
 .../castor/SpringMarshalDomainObjectTest.java  |   30 
 .../apache/camel/dataformat/castor/Student.java|   39 +-
 components/camel-castor/src/test/resources/map.xml |   72 ++
 .../castor/SpringMarshalDomainObjectTest.xml   |9 +-
 6 files changed, 177 insertions(+), 90 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/f7697b6e/components/camel-castor/src/main/java/org/apache/camel/dataformat/castor/AbstractCastorDataFormat.java
--
diff --git 
a/components/camel-castor/src/main/java/org/apache/camel/dataformat/castor/AbstractCastorDataFormat.java
 
b/components/camel-castor/src/main/java/org/apache/camel/dataformat/castor/AbstractCastorDataFormat.java
index 85fc3d1..24cbcf2 100644
--- 
a/components/camel-castor/src/main/java/org/apache/camel/dataformat/castor/AbstractCastorDataFormat.java
+++ 
b/components/camel-castor/src/main/java/org/apache/camel/dataformat/castor/AbstractCastorDataFormat.java
@@ -23,9 +23,12 @@ import java.io.OutputStreamWriter;
 import java.io.Reader;
 import java.io.Writer;
 
+import org.apache.camel.CamelContext;
+import org.apache.camel.CamelContextAware;
 import org.apache.camel.Exchange;
 import org.apache.camel.spi.ClassResolver;
 import org.apache.camel.spi.DataFormat;
+import org.apache.camel.support.ServiceSupport;
 import org.apache.camel.util.ObjectHelper;
 import org.exolab.castor.mapping.Mapping;
 import org.exolab.castor.xml.Marshaller;
@@ -37,25 +40,21 @@ import org.exolab.castor.xml.XMLContext;
  * href="http://camel.apache.org/data-format.html";>data format ({@link 
DataFormat})
  * interface which leverage the Castor library for XML marshaling and
  * unmarshaling
- *
- * @version 
  */
-public abstract class AbstractCastorDataFormat implements DataFormat {
+public abstract class AbstractCastorDataFormat extends ServiceSupport 
implements DataFormat, CamelContextAware {
 
 /**
  * The default encoding used for stream access.
  */
 public static final String DEFAULT_ENCODING = "UTF-8";
 
+private CamelContext camelContext;
 private String encoding = DEFAULT_ENCODING;
 private String mappingFile;
 private String[] classNames;
 private String[] packages;
 private boolean validation;
-
 private volatile XMLContext xmlContext;
-private volatile Marshaller marshaller;
-private volatile Unmarshaller unmarshaller;
 
 public AbstractCastorDataFormat() {
 }
@@ -66,57 +65,63 @@ public abstract class AbstractCastorDataFormat implements 
DataFormat {
 
 public void marshal(Exchange exchange, Object body, OutputStream 
outputStream) throws Exception {
 Writer writer = new OutputStreamWriter(outputStream, encoding);
-Marshaller.marshal(body, writer);
+
+Marshaller marshaller = createMarshaller(exchange);
+marshaller.setWriter(writer);
+marshaller.marshal(body);
 }
 
 public Object unmarshal(Exchange exchange, InputStream inputStream) throws 
Exception {
 Reader reader = new InputStreamReader(inputStream, encoding);
-return getUnmarshaller(exchange).unmarshal(reader);
+return createUnmarshaller(exchange).unmarshal(reader);
 }
 
-public XMLContext getXmlContext(ClassResolver resolver, ClassLoader 
contextClassLoader) throws Exception {
-if (xmlContext == null) {
-xmlContext = new XMLContext();
-
-if (ObjectHelper.isNotEmpty(getMappingFile())) {
-Mapping xmlMap;
-if (contextClassLoader != null) {
-xmlMap = new Mapping(contextClassLoader);
-} else {
-xmlMap = new Mapping();
-}
-
xmlMap.loadMapping(resolver.loadResourceAsURL(getMappingFile()));
-xmlContext.addMapping(xmlMap);
-}
+protected XMLContext createXMLContext(Cla

git commit: CAMEL-5359: Fixed camel-castor to be able to load mapping from XML file. Also fixed thread safety issues of marshaller. Thanks to Joshua Ecklund for patch. And also thanks to jacob vanderg

2013-05-10 Thread davsclaus
Updated Branches:
  refs/heads/camel-2.11.x 24d3a3354 -> fa7dd10f3


CAMEL-5359: Fixed camel-castor to be able to load mapping from XML file. Also 
fixed thread safety issues of marshaller. Thanks to Joshua Ecklund for patch. 
And also thanks to jacob vandergoot for working with this.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/fa7dd10f
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/fa7dd10f
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/fa7dd10f

Branch: refs/heads/camel-2.11.x
Commit: fa7dd10f38def101966f47794d060ab7fc8051e7
Parents: 24d3a33
Author: Claus Ibsen 
Authored: Fri May 10 14:49:17 2013 +0200
Committer: Claus Ibsen 
Committed: Fri May 10 14:49:48 2013 +0200

--
 .../castor/AbstractCastorDataFormat.java   |  110 ---
 .../castor/MarshalWithMappingDomainObjectTest.java |7 +-
 .../castor/SpringMarshalDomainObjectTest.java  |   30 
 .../apache/camel/dataformat/castor/Student.java|   39 +-
 components/camel-castor/src/test/resources/map.xml |   72 ++
 .../castor/SpringMarshalDomainObjectTest.xml   |9 +-
 6 files changed, 177 insertions(+), 90 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/fa7dd10f/components/camel-castor/src/main/java/org/apache/camel/dataformat/castor/AbstractCastorDataFormat.java
--
diff --git 
a/components/camel-castor/src/main/java/org/apache/camel/dataformat/castor/AbstractCastorDataFormat.java
 
b/components/camel-castor/src/main/java/org/apache/camel/dataformat/castor/AbstractCastorDataFormat.java
index 85fc3d1..24cbcf2 100644
--- 
a/components/camel-castor/src/main/java/org/apache/camel/dataformat/castor/AbstractCastorDataFormat.java
+++ 
b/components/camel-castor/src/main/java/org/apache/camel/dataformat/castor/AbstractCastorDataFormat.java
@@ -23,9 +23,12 @@ import java.io.OutputStreamWriter;
 import java.io.Reader;
 import java.io.Writer;
 
+import org.apache.camel.CamelContext;
+import org.apache.camel.CamelContextAware;
 import org.apache.camel.Exchange;
 import org.apache.camel.spi.ClassResolver;
 import org.apache.camel.spi.DataFormat;
+import org.apache.camel.support.ServiceSupport;
 import org.apache.camel.util.ObjectHelper;
 import org.exolab.castor.mapping.Mapping;
 import org.exolab.castor.xml.Marshaller;
@@ -37,25 +40,21 @@ import org.exolab.castor.xml.XMLContext;
  * href="http://camel.apache.org/data-format.html";>data format ({@link 
DataFormat})
  * interface which leverage the Castor library for XML marshaling and
  * unmarshaling
- *
- * @version 
  */
-public abstract class AbstractCastorDataFormat implements DataFormat {
+public abstract class AbstractCastorDataFormat extends ServiceSupport 
implements DataFormat, CamelContextAware {
 
 /**
  * The default encoding used for stream access.
  */
 public static final String DEFAULT_ENCODING = "UTF-8";
 
+private CamelContext camelContext;
 private String encoding = DEFAULT_ENCODING;
 private String mappingFile;
 private String[] classNames;
 private String[] packages;
 private boolean validation;
-
 private volatile XMLContext xmlContext;
-private volatile Marshaller marshaller;
-private volatile Unmarshaller unmarshaller;
 
 public AbstractCastorDataFormat() {
 }
@@ -66,57 +65,63 @@ public abstract class AbstractCastorDataFormat implements 
DataFormat {
 
 public void marshal(Exchange exchange, Object body, OutputStream 
outputStream) throws Exception {
 Writer writer = new OutputStreamWriter(outputStream, encoding);
-Marshaller.marshal(body, writer);
+
+Marshaller marshaller = createMarshaller(exchange);
+marshaller.setWriter(writer);
+marshaller.marshal(body);
 }
 
 public Object unmarshal(Exchange exchange, InputStream inputStream) throws 
Exception {
 Reader reader = new InputStreamReader(inputStream, encoding);
-return getUnmarshaller(exchange).unmarshal(reader);
+return createUnmarshaller(exchange).unmarshal(reader);
 }
 
-public XMLContext getXmlContext(ClassResolver resolver, ClassLoader 
contextClassLoader) throws Exception {
-if (xmlContext == null) {
-xmlContext = new XMLContext();
-
-if (ObjectHelper.isNotEmpty(getMappingFile())) {
-Mapping xmlMap;
-if (contextClassLoader != null) {
-xmlMap = new Mapping(contextClassLoader);
-} else {
-xmlMap = new Mapping();
-}
-
xmlMap.loadMapping(resolver.loadResourceAsURL(getMappingFile()));
-xmlContext.addMapping(xmlMap);
-}
+protected XMLContext createXMLContext(Cla

git commit: CAMEL-5359: Fixed camel-castor to be able to load mapping from XML file. Also fixed thread safety issues of marshaller. Thanks to Joshua Ecklund for patch. And also thanks to jacob vanderg

2013-05-10 Thread davsclaus
Updated Branches:
  refs/heads/master 513065a58 -> e63b8beb8


CAMEL-5359: Fixed camel-castor to be able to load mapping from XML file. Also 
fixed thread safety issues of marshaller. Thanks to Joshua Ecklund for patch. 
And also thanks to jacob vandergoot for working with this.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/e63b8beb
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/e63b8beb
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/e63b8beb

Branch: refs/heads/master
Commit: e63b8beb8ce54988dc0e082ac1cb9f91966bfdc6
Parents: 513065a
Author: Claus Ibsen 
Authored: Fri May 10 14:49:17 2013 +0200
Committer: Claus Ibsen 
Committed: Fri May 10 14:49:17 2013 +0200

--
 .../castor/AbstractCastorDataFormat.java   |  110 ---
 .../castor/MarshalWithMappingDomainObjectTest.java |7 +-
 .../castor/SpringMarshalDomainObjectTest.java  |   30 
 .../apache/camel/dataformat/castor/Student.java|   39 +-
 components/camel-castor/src/test/resources/map.xml |   72 ++
 .../castor/SpringMarshalDomainObjectTest.xml   |9 +-
 6 files changed, 177 insertions(+), 90 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/e63b8beb/components/camel-castor/src/main/java/org/apache/camel/dataformat/castor/AbstractCastorDataFormat.java
--
diff --git 
a/components/camel-castor/src/main/java/org/apache/camel/dataformat/castor/AbstractCastorDataFormat.java
 
b/components/camel-castor/src/main/java/org/apache/camel/dataformat/castor/AbstractCastorDataFormat.java
index 85fc3d1..24cbcf2 100644
--- 
a/components/camel-castor/src/main/java/org/apache/camel/dataformat/castor/AbstractCastorDataFormat.java
+++ 
b/components/camel-castor/src/main/java/org/apache/camel/dataformat/castor/AbstractCastorDataFormat.java
@@ -23,9 +23,12 @@ import java.io.OutputStreamWriter;
 import java.io.Reader;
 import java.io.Writer;
 
+import org.apache.camel.CamelContext;
+import org.apache.camel.CamelContextAware;
 import org.apache.camel.Exchange;
 import org.apache.camel.spi.ClassResolver;
 import org.apache.camel.spi.DataFormat;
+import org.apache.camel.support.ServiceSupport;
 import org.apache.camel.util.ObjectHelper;
 import org.exolab.castor.mapping.Mapping;
 import org.exolab.castor.xml.Marshaller;
@@ -37,25 +40,21 @@ import org.exolab.castor.xml.XMLContext;
  * href="http://camel.apache.org/data-format.html";>data format ({@link 
DataFormat})
  * interface which leverage the Castor library for XML marshaling and
  * unmarshaling
- *
- * @version 
  */
-public abstract class AbstractCastorDataFormat implements DataFormat {
+public abstract class AbstractCastorDataFormat extends ServiceSupport 
implements DataFormat, CamelContextAware {
 
 /**
  * The default encoding used for stream access.
  */
 public static final String DEFAULT_ENCODING = "UTF-8";
 
+private CamelContext camelContext;
 private String encoding = DEFAULT_ENCODING;
 private String mappingFile;
 private String[] classNames;
 private String[] packages;
 private boolean validation;
-
 private volatile XMLContext xmlContext;
-private volatile Marshaller marshaller;
-private volatile Unmarshaller unmarshaller;
 
 public AbstractCastorDataFormat() {
 }
@@ -66,57 +65,63 @@ public abstract class AbstractCastorDataFormat implements 
DataFormat {
 
 public void marshal(Exchange exchange, Object body, OutputStream 
outputStream) throws Exception {
 Writer writer = new OutputStreamWriter(outputStream, encoding);
-Marshaller.marshal(body, writer);
+
+Marshaller marshaller = createMarshaller(exchange);
+marshaller.setWriter(writer);
+marshaller.marshal(body);
 }
 
 public Object unmarshal(Exchange exchange, InputStream inputStream) throws 
Exception {
 Reader reader = new InputStreamReader(inputStream, encoding);
-return getUnmarshaller(exchange).unmarshal(reader);
+return createUnmarshaller(exchange).unmarshal(reader);
 }
 
-public XMLContext getXmlContext(ClassResolver resolver, ClassLoader 
contextClassLoader) throws Exception {
-if (xmlContext == null) {
-xmlContext = new XMLContext();
-
-if (ObjectHelper.isNotEmpty(getMappingFile())) {
-Mapping xmlMap;
-if (contextClassLoader != null) {
-xmlMap = new Mapping(contextClassLoader);
-} else {
-xmlMap = new Mapping();
-}
-
xmlMap.loadMapping(resolver.loadResourceAsURL(getMappingFile()));
-xmlContext.addMapping(xmlMap);
-}
+protected XMLContext createXMLContext(ClassResolver r

[CONF] Apache Camel > StAX

2013-05-10 Thread confluence







StAX
Page edited by Claus Ibsen


 Changes (2)
 




...
{code}  
Where {{stax}} is a static method on {{org.apache.camel.component.stax.StAXBuilder}} which you can static import in the Java code. The stax builder is by default namespace aware on the XMLReader it uses. From *Camel 2.11.1* onwards you can turn this off by setting the boolean parameter to false, as shown below: 
{code:java} from("file:target/in") .split(stax(Record.class, false)).streaming() .to("mock:records"); {code} 
 h4. The previous example with XML DSL 
...


Full Content

StAX Component
Available as of Camel 2.9

The StAX component allows messages to be process through a SAX ContentHandler.
Another feature of this component is to allow to iterate over JAXB records using StAX, for example using the Splitter EIP.

Maven users will need to add the following dependency to their pom.xml for this component:



org.apache.camel
camel-stax
x.x.x





URI format



stax:content-handler-class



example:


stax:org.superbiz.FooContentHandler



Usage of a content handler as StAX parser

The message body after the handling is the handler itself.

Here an example:



from("file:target/in")
  .to("stax:org.superbiz.handler.CountingHandler") 
  // CountingHandler implements org.xml.sax.ContentHandler or extends org.xml.sax.helpers.DefaultHandler
  .process(new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
CountingHandler handler = exchange.getIn().getBody(CountingHandler.class);
// do some great work with the handler
}
  });



Iterate over a collection using JAXB and StAX

First we suppose you have JAXB objects.

For instance a list of records in a wrapper object:



import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "records")
public class Records {
@XmlElement(required = true)
protected List record;

public List getRecord() {
if (record == null) {
record = new ArrayList();
}
return record;
}
}



and



import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "record", propOrder = { "key", "value" })
public class Record {
@XmlAttribute(required = true)
protected String key;

@XmlAttribute(required = true)
protected String value;

public String getKey() {
return key;
}

public void setKey(String key) {
this.key = key;
}

public String getValue() {
return value;
}

public void setValue(String value) {
this.value = value;
}
}



Then you get a XML file to process:



"1.0" encoding="UTF-8" standalone="yes"?>

  "v0" key="0"/>
  "v1" key="1"/>
  "v2" key="2"/>
  "v3" key="3"/>
  "v4" key="4"/>
  "v5" key="5"/>




The StAX component provides an StAXBuilder which can be used when iterating XML elements with the Camel Splitter



from("file:target/in")
.split(stax(Record.class)).streaming()
.to("mock:records");



Where stax is a static method on org.apache.camel.component.stax.StAXBuilder which you can static import in the Java code. The stax builder is by default namespace aware on the XMLReader it uses. From Camel 2.11.1 onwards you can turn this off by setting the boolean parameter to false, as shown below:


from("file:target/in")
.split(stax(Record.class, false)).streaming()
.to("mock:records");



The previous example with XML DSL
The example above could be implemented as follows in XML DSL




"staxRecord" class="org.apache.camel.component.stax.StAXBuilder" factory-method="stax">
  
  "0" value="org.apache.camel.component.stax.model.Record"/>


"http://camel.apache.org/schema/spring">
  

"file:target/in"/>
"true">
  
  
  staxRecord
  
  "mock:records"/>

  





See Also

	Configuring Camel
	Component
	Endpoint
	Getting Started





Change Notification Preferences

View Online
|
View Changes
|
Add Comment









git commit: CAMEL-6343: camel-stax allows to configure namespace aware of the xml reader. Thanks to Kevin Yao for the patch.

2013-05-10 Thread davsclaus
Updated Branches:
  refs/heads/camel-2.11.x 178294d85 -> 24d3a3354


CAMEL-6343: camel-stax allows to configure namespace aware of the xml reader. 
Thanks to Kevin Yao for the patch.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/24d3a335
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/24d3a335
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/24d3a335

Branch: refs/heads/camel-2.11.x
Commit: 24d3a33545f2d8df740ec50f6d54cf227ca62f82
Parents: 178294d
Author: Claus Ibsen 
Authored: Fri May 10 14:25:08 2013 +0200
Committer: Claus Ibsen 
Committed: Fri May 10 14:25:59 2013 +0200

--
 .../apache/camel/component/stax/StAXBuilder.java   |   21 
 .../component/stax/StAXJAXBIteratorExpression.java |   41 ++-
 2 files changed, 60 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/24d3a335/components/camel-stax/src/main/java/org/apache/camel/component/stax/StAXBuilder.java
--
diff --git 
a/components/camel-stax/src/main/java/org/apache/camel/component/stax/StAXBuilder.java
 
b/components/camel-stax/src/main/java/org/apache/camel/component/stax/StAXBuilder.java
index c3abbc4..87fd120 100644
--- 
a/components/camel-stax/src/main/java/org/apache/camel/component/stax/StAXBuilder.java
+++ 
b/components/camel-stax/src/main/java/org/apache/camel/component/stax/StAXBuilder.java
@@ -44,4 +44,25 @@ public final class StAXBuilder {
 public static  Expression stax(String clazzName) {
 return new StAXJAXBIteratorExpression(clazzName);
 }
+
+/**
+ * Creates a {@link 
org.apache.camel.component.stax.StAXJAXBIteratorExpression}.
+ *
+ * @param clazzthe class which has JAXB annotations to bind 
POJO.
+ * @param isNamespaceAware sets the namespace awareness of the xml reader
+ */
+public static  Expression stax(Class clazz, boolean 
isNamespaceAware) {
+return new StAXJAXBIteratorExpression(clazz, isNamespaceAware);
+}
+
+/**
+ * Creates a {@link 
org.apache.camel.component.stax.StAXJAXBIteratorExpression}.
+ *
+ * @param clazzNamethe FQN name of the class which has JAXB 
annotations to bind POJO.
+ * @param isNamespaceAware sets the namespace awareness of the xml reader
+ */
+public static  Expression stax(String clazzName, boolean 
isNamespaceAware) {
+return new StAXJAXBIteratorExpression(clazzName, isNamespaceAware);
+}
+
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/24d3a335/components/camel-stax/src/main/java/org/apache/camel/component/stax/StAXJAXBIteratorExpression.java
--
diff --git 
a/components/camel-stax/src/main/java/org/apache/camel/component/stax/StAXJAXBIteratorExpression.java
 
b/components/camel-stax/src/main/java/org/apache/camel/component/stax/StAXJAXBIteratorExpression.java
index 01e9e2a..b6a7efe 100644
--- 
a/components/camel-stax/src/main/java/org/apache/camel/component/stax/StAXJAXBIteratorExpression.java
+++ 
b/components/camel-stax/src/main/java/org/apache/camel/component/stax/StAXJAXBIteratorExpression.java
@@ -18,12 +18,14 @@ package org.apache.camel.component.stax;
 
 import java.io.Closeable;
 import java.io.IOException;
+import java.io.InputStream;
 import java.util.Iterator;
 import java.util.Map;
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBException;
 import javax.xml.bind.Unmarshaller;
 import javax.xml.stream.XMLEventReader;
+import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.events.XMLEvent;
 
@@ -49,6 +51,7 @@ public class StAXJAXBIteratorExpression extends 
ExpressionAdapter {
 
 private final Class handled;
 private final String handledName;
+private final boolean isNamespaceAware;
 
 /**
  * Creates this expression.
@@ -56,9 +59,20 @@ public class StAXJAXBIteratorExpression extends 
ExpressionAdapter {
  * @param handled the class which has JAXB annotations to bind POJO.
  */
 public StAXJAXBIteratorExpression(Class handled) {
+this(handled, true);
+}
+
+/**
+ * Creates this expression.
+ *
+ * @param handled  the class which has JAXB annotations to bind 
POJO.
+ * @param isNamespaceAware sets the namespace awareness of the xml reader
+ */
+public StAXJAXBIteratorExpression(Class handled, boolean 
isNamespaceAware) {
 ObjectHelper.notNull(handled, "handled");
 this.handled = handled;
 this.handledName = null;
+this.isNamespaceAware = isNamespaceAware;
 }
 
 /**
@@ -67,9 +81,20 @@ public class StAXJAXBIteratorExpression extends 
ExpressionAdapter {
  * @param handledNam

git commit: CAMEL-6343: camel-stax allows to configure namespace aware of the xml reader. Thanks to Kevin Yao for the patch.

2013-05-10 Thread davsclaus
Updated Branches:
  refs/heads/master 3d82bea54 -> 513065a58


CAMEL-6343: camel-stax allows to configure namespace aware of the xml reader. 
Thanks to Kevin Yao for the patch.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/513065a5
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/513065a5
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/513065a5

Branch: refs/heads/master
Commit: 513065a5848a49ebaf1eeb654157aec49faa211e
Parents: 3d82bea
Author: Claus Ibsen 
Authored: Fri May 10 14:25:08 2013 +0200
Committer: Claus Ibsen 
Committed: Fri May 10 14:25:08 2013 +0200

--
 .../apache/camel/component/stax/StAXBuilder.java   |   21 
 .../component/stax/StAXJAXBIteratorExpression.java |   41 ++-
 2 files changed, 60 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/513065a5/components/camel-stax/src/main/java/org/apache/camel/component/stax/StAXBuilder.java
--
diff --git 
a/components/camel-stax/src/main/java/org/apache/camel/component/stax/StAXBuilder.java
 
b/components/camel-stax/src/main/java/org/apache/camel/component/stax/StAXBuilder.java
index c3abbc4..87fd120 100644
--- 
a/components/camel-stax/src/main/java/org/apache/camel/component/stax/StAXBuilder.java
+++ 
b/components/camel-stax/src/main/java/org/apache/camel/component/stax/StAXBuilder.java
@@ -44,4 +44,25 @@ public final class StAXBuilder {
 public static  Expression stax(String clazzName) {
 return new StAXJAXBIteratorExpression(clazzName);
 }
+
+/**
+ * Creates a {@link 
org.apache.camel.component.stax.StAXJAXBIteratorExpression}.
+ *
+ * @param clazzthe class which has JAXB annotations to bind 
POJO.
+ * @param isNamespaceAware sets the namespace awareness of the xml reader
+ */
+public static  Expression stax(Class clazz, boolean 
isNamespaceAware) {
+return new StAXJAXBIteratorExpression(clazz, isNamespaceAware);
+}
+
+/**
+ * Creates a {@link 
org.apache.camel.component.stax.StAXJAXBIteratorExpression}.
+ *
+ * @param clazzNamethe FQN name of the class which has JAXB 
annotations to bind POJO.
+ * @param isNamespaceAware sets the namespace awareness of the xml reader
+ */
+public static  Expression stax(String clazzName, boolean 
isNamespaceAware) {
+return new StAXJAXBIteratorExpression(clazzName, isNamespaceAware);
+}
+
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/513065a5/components/camel-stax/src/main/java/org/apache/camel/component/stax/StAXJAXBIteratorExpression.java
--
diff --git 
a/components/camel-stax/src/main/java/org/apache/camel/component/stax/StAXJAXBIteratorExpression.java
 
b/components/camel-stax/src/main/java/org/apache/camel/component/stax/StAXJAXBIteratorExpression.java
index 01e9e2a..b6a7efe 100644
--- 
a/components/camel-stax/src/main/java/org/apache/camel/component/stax/StAXJAXBIteratorExpression.java
+++ 
b/components/camel-stax/src/main/java/org/apache/camel/component/stax/StAXJAXBIteratorExpression.java
@@ -18,12 +18,14 @@ package org.apache.camel.component.stax;
 
 import java.io.Closeable;
 import java.io.IOException;
+import java.io.InputStream;
 import java.util.Iterator;
 import java.util.Map;
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBException;
 import javax.xml.bind.Unmarshaller;
 import javax.xml.stream.XMLEventReader;
+import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.events.XMLEvent;
 
@@ -49,6 +51,7 @@ public class StAXJAXBIteratorExpression extends 
ExpressionAdapter {
 
 private final Class handled;
 private final String handledName;
+private final boolean isNamespaceAware;
 
 /**
  * Creates this expression.
@@ -56,9 +59,20 @@ public class StAXJAXBIteratorExpression extends 
ExpressionAdapter {
  * @param handled the class which has JAXB annotations to bind POJO.
  */
 public StAXJAXBIteratorExpression(Class handled) {
+this(handled, true);
+}
+
+/**
+ * Creates this expression.
+ *
+ * @param handled  the class which has JAXB annotations to bind 
POJO.
+ * @param isNamespaceAware sets the namespace awareness of the xml reader
+ */
+public StAXJAXBIteratorExpression(Class handled, boolean 
isNamespaceAware) {
 ObjectHelper.notNull(handled, "handled");
 this.handled = handled;
 this.handledName = null;
+this.isNamespaceAware = isNamespaceAware;
 }
 
 /**
@@ -67,9 +81,20 @@ public class StAXJAXBIteratorExpression extends 
ExpressionAdapter {
  * @param handledName the FQN na

svn commit: r861528 - in /websites/production/camel/content: book-component-appendix.html book-in-one-page.html cache/main.pageCache quartz.html twitter.html

2013-05-10 Thread buildbot
Author: buildbot
Date: Fri May 10 12:21:55 2013
New Revision: 861528

Log:
Production update by buildbot for camel

Modified:
websites/production/camel/content/book-component-appendix.html
websites/production/camel/content/book-in-one-page.html
websites/production/camel/content/cache/main.pageCache
websites/production/camel/content/quartz.html
websites/production/camel/content/twitter.html

Modified: websites/production/camel/content/book-component-appendix.html
==
--- websites/production/camel/content/book-component-appendix.html (original)
+++ websites/production/camel/content/book-component-appendix.html Fri May 10 
12:21:55 2013
@@ -12956,7 +12956,7 @@ a unique id is auto assigned, and there 
 
 Configuring 
quartz.properties file
 
-By default Quartz will look for a quartz.properties file in the 
root of the classpath. If you are using WAR deployments this means just drop 
the quartz.properties in WEB-INF/classes.
+By default Quartz will look for a quartz.properties file in the 
org/quartz directory of the classpath. If you are using WAR 
deployments this means just drop the quartz.properties in 
WEB-INF/classes/org/quartz.
 
 However the Camel Quartz component also allows you to configure properties:
 

Modified: websites/production/camel/content/book-in-one-page.html
==
--- websites/production/camel/content/book-in-one-page.html (original)
+++ websites/production/camel/content/book-in-one-page.html Fri May 10 12:21:55 
2013
@@ -33970,7 +33970,7 @@ a unique id is auto assigned, and there 
 
 Configuring 
quartz.properties file
 
-By default Quartz will look for a quartz.properties file in the 
root of the classpath. If you are using WAR deployments this means just drop 
the quartz.properties in WEB-INF/classes.
+By default Quartz will look for a quartz.properties file in the 
org/quartz directory of the classpath. If you are using WAR 
deployments this means just drop the quartz.properties in 
WEB-INF/classes/org/quartz.
 
 However the Camel Quartz component also allows you to configure properties:
 

Modified: websites/production/camel/content/cache/main.pageCache
==
Binary files - no diff available.

Modified: websites/production/camel/content/quartz.html
==
--- websites/production/camel/content/quartz.html (original)
+++ websites/production/camel/content/quartz.html Fri May 10 12:21:55 2013
@@ -128,7 +128,7 @@ a unique id is auto assigned, and there 
 
 Configuring 
quartz.properties file
 
-By default Quartz will look for a quartz.properties file in the 
root of the classpath. If you are using WAR deployments this means just drop 
the quartz.properties in WEB-INF/classes.
+By default Quartz will look for a quartz.properties file in the 
org/quartz directory of the classpath. If you are using WAR 
deployments this means just drop the quartz.properties in 
WEB-INF/classes/org/quartz.
 
 However the Camel Quartz component also allows you to configure properties:
 

Modified: websites/production/camel/content/twitter.html
==
--- websites/production/camel/content/twitter.html (original)
+++ websites/production/camel/content/twitter.html Fri May 10 12:21:55 2013
@@ -125,7 +125,7 @@ You can also configure these options dir
 
 URI Options
 
- Name  Default Value  Description  type  direct  direct, event, or polling  delay  60  in seconds  consumerKey  null  Consumer Key. Can also be configured on the 
TwitterComponent level instead.  consumerSecret  null  Consumer Secret. Can also be configured on the 
TwitterComponent level instead.  accessToken  null  Access Token. Can also be configured on the 
TwitterComponent level instead.  accessTokenSecret  null  Access Token Secret. Can also be configured 
on the TwitterComponent level instead.  user  null  Username, used for user timeline consumption, 
direct message production, etc.  locations null  'lat,lon;lat,lon;...' Bounding boxes, created by pairs of 
lat/lons.  Can be used for streaming/filter  keywords null  'foo1,foo2,foo3...' Can be used for search and 
streaming/filter  userIds null  'username,username...' Can be used for streaming/filter 
 filter
 Old  true 
 Filter out old tweets, 
that has previously been polled. This state is stored in memory only, and based 
on last tweet id. Since Camel 2.11.0 The search producer supports this 
option  sinceId 
 1  Camel 2.11.0: The last 
tweet id which will be used for pulling the tweets. It is useful when the camel 
route is restarted after a long running. lang  null  Camel 2.11.0: The lang string http://en.wikipedia.org/wiki/ISO_639-1"; 
rel="nofollow">I
 SO_639-1 which will be used for searching  count  null  Came

[CONF] Apache Camel > Quartz

2013-05-10 Thread confluence







Quartz
Page edited by Claus Ibsen


 Changes (1)
 




...
h3. Configuring quartz.properties file  
By default Quartz will look for a {{quartz.properties}} file in the root {{org/quartz}} directory of the classpath. If you are using WAR deployments this means just drop the quartz.properties in {{WEB-INF/classes/org/quartz}}. 
 However the Camel [Quartz] component also allows you to configure properties: 
...


Full Content

Quartz Component

The quartz: component provides a scheduled delivery of messages using the Quartz scheduler. 
Each endpoint represents a different timer (in Quartz terms, a Trigger and JobDetail).

Maven users will need to add the following dependency to their pom.xml for this component:



org.apache.camel
camel-quartz
x.x.x





URI format



quartz://timerName?options
quartz://groupName/timerName?options
quartz://groupName/timerName?cron=_expression_
quartz://timerName?cron=_expression_



The component uses either a CronTrigger or a SimpleTrigger. If no cron _expression_ is provided, the component uses a simple trigger. If no groupName is provided, the quartz component uses the Camel group name.

You can append query options to the URI in the following format, ?option=value&option=value&...

Options



 Parameter 
 Default 
 Description 


 cron 
 None 
 Specifies a cron _expression_ (not compatible with the trigger.* or job.* options). 


 trigger.repeatCount 
 0 
 SimpleTrigger: How many times should the timer repeat? 


 trigger.repeatInterval 
 0 
 SimpleTrigger: The amount of time in milliseconds between repeated triggers. 


 job.name 
 null 
 Sets the job name. 


 job.XXX 
 null 
 Sets the job option with the XXX setter name. 


 trigger.XXX 
 null 
 Sets the trigger option with the XXX setter name. 


 stateful 
 false 
 Uses a Quartz StatefulJob instead of the default job. 


 fireNow 
 false 
 New to Camel 2.2.0, if it is true will fire the trigger when the route is start when using SimpleTrigger.





For example, the following routing rule will fire two timer events to the mock:results endpoint:


from("quartz://myGroup/myTimerName?trigger.repeatInterval=2&trigger.repeatCount=1").routeId("myRoute").to("mock:result");



When using a StatefulJob, the JobDataMap is re-persisted after every execution of the job, thus preserving state for the next execution.

Running in OSGi and having multiple bundles with quartz routesIf you run in OSGi such as Apache ServiceMix, or Apache Karaf, and have multiple bundles with Camel routes that start from Quartz endpoints, then make sure if you assign
an id to the  that this id is unique, as this is required by the QuartzScheduler in the OSGi container. If you do not set any id on  then
a unique id is auto assigned, and there is no problem.

Configuring quartz.properties file

By default Quartz will look for a quartz.properties file in the org/quartz directory of the classpath. If you are using WAR deployments this means just drop the quartz.properties in WEB-INF/classes/org/quartz.

However the Camel Quartz component also allows you to configure properties:



 Parameter 
 Default 
 Type 
 Description 


 properties 
 null 
 Properties 
 Camel 2.4: You can configure a java.util.Properties instance. 


 propertiesFile 
 null 
 String 
 Camel 2.4: File name of the properties to load from the classpath 





To do this you can configure this in Spring XML as follows



"quartz" class="org.apache.camel.component.quartz.QuartzComponent">
"propertiesFile" value="com/mycompany/myquartz.properties"/>





Starting the Quartz scheduler
Available as of Camel 2.4

The Quartz component offers an option to let the Quartz scheduler be started delayed, or not auto started at all.



 Parameter 
 Default 
 Type 
 Description 


 startDelayedSeconds 
 0 
 int 
 Camel 2.4: Seconds to wait before starting the quartz scheduler. 


 autoStartScheduler 
 true 
 boolean 
 Camel 2.4: Whether or not the scheduler should be auto started. 





To do this you can configure this in Spring XML as follows



"quartz" class="org.apache.camel.component.quartz.QuartzComponent">
"startDelayedSeconds" value="5"/>





Clustering
Available as of Camel 2.4

If you use Quartz in clustered mode, e.g. the JobStore is clustered. Then from Camel 2.4 onwards the Quartz component will not pause/remove triggers when a node is being stopped/shutdown. This allows the trigger to keep running on the other nodes in the cluster.

Note: When running in clustered node no checking is done to ensure unique job name/group for endpoints. 


Message Headers
Camel adds the getters from the Quartz Execution Context as header values. The following headers are added:
calendar, fireTime, jobDetail, jobInstance, jobRuntTi

[CONF] Apache Camel > Twitter

2013-05-10 Thread confluence







Twitter
Page edited by Claus Ibsen


 Changes (2)
 




...
| user | {{null}} | Username, used for user timeline consumption, direct message production, etc. | | locations| {{null}} | 'lat,lon;lat,lon;...' Bounding boxes, created by pairs of lat/lons.  Can be used for streaming/filter | 
| keywords| {{null}} | 'foo1,foo2,foo3...' Can be used for search and streaming/filter | 
| keywords| {{null}} | 'foo1,foo2,foo3...' Can be used for search and streaming/filter. See [Advanced search|https://support.twitter.com/articles/71577-using-advanced-search] for keywords syntax for searching with for example OR. | 
| userIds| {{null}} | 'username,username...' Can be used for streaming/filter | | filterOld | {{true}} | Filter out old tweets, that has previously been polled. This state is stored in memory only, and based on last tweet id. *Since Camel 2.11.0* The search producer supports this option | 
...


Full Content

Twitter
Available as of Camel 2.10

The Twitter component enables the most useful features of the Twitter API by encapsulating Twitter4J. It allows direct, polling, or event-driven consumption of timelines, users, trends, and direct messages. Also, it supports producing messages as status updates or direct messages.

Twitter now requires the use of OAuth for all client application authentication.  In order to use camel-twitter with your account, you'll need to create a new application within Twitter at https://dev.twitter.com/apps/new and grant the application access to your account. Finally, generate your access token and secret.

Maven users will need to add the following dependency to their pom.xml for this component:



org.apache.camel
camel-twitter
${camel-version}




URI format



twitter://[endpoint]?[options]



TwitterComponent:

The twitter component can be configured with the Twitter account settings which is mandatory to configure before using.
You can also configure these options directly in the endpoint.



 Option 
 Description 


 consumerKey 
 The consumer key 


 consumerSecret 
 The consumer secret 


 accessToken 
 The access token 


 accessTokenSecret 
 The access token secret 





Consumer Endpoints:
Rather than the endpoints returning a List through one single route exchange, camel-twitter creates one route exchange per returned object.  As an example, if "timeline/home" results in five statuses, the route will be executed five times (one for each Status).



 Endpoint 
 Context 
 Body Type 
 Notice 


 directmessage 
 direct, polling 
 twitter4j.DirectMessage 
 


 search 
 direct, polling 
 twitter4j.Tweet 
 


 streaming/filter 
 event, polling 
 twitter4j.Status 
 


 streaming/sample 
 event, polling 
 twitter4j.Status 
 


 timeline/home 
 direct, polling 
 twitter4j.Status 
 


 timeline/mentions 
 direct, polling 
 twitter4j.Status 
 


 timeline/public 
 direct, polling 
 twitter4j.Status 
 @deprecated. Use timeline/home or direct/home instead. Removed from Camel 2.11 onwards. 


 timeline/retweetsofme 
 direct, polling 
 twitter4j.Status 
 


 timeline/user 
 direct, polling 
 twitter4j.Status 
 


 trends/daily 
 Camel 2.10.1: direct, polling 
 twitter4j.Status 
 @deprecated. Removed from Camel 2.11 onwards. 


 trends/weekly 
 Camel 2.10.1: direct, polling 
 twitter4j.Status 
 @deprecated. Removed from Camel 2.11 onwards. 





Producer Endpoints:



 Endpoint 
 Body Type 


 directmessage 
 String 


 search 
 List 


 timeline/user 
 String 





URI Options



 Name 
 Default Value 
 Description 


 type 
 direct 
 direct, event, or polling 


 delay 
 60 
 in seconds 


 consumerKey 
 null 
 Consumer Key. Can also be configured on the TwitterComponent level instead. 


 consumerSecret 
 null 
 Consumer Secret. Can also be configured on the TwitterComponent level instead. 


 accessToken 
 null 
 Access Token. Can also be configured on the TwitterComponent level instead. 


 accessTokenSecret 
 null 
 Access Token Secret. Can also be configured on the TwitterComponent level instead. 


 user 
 null 
 Username, used for user timeline consumption, direct message production, etc. 


 locations
 null 
 'lat,lon;lat,lon;...' Bounding boxes, created by pairs of lat/lons.  Can be used for streaming/filter 


 keywords
 null 
 'foo1,foo2,foo3...' Can be used for search and streaming/filter. See Advanced search for keywords syntax for searching with for example OR. 


 userIds
 null 
 'username,username...' Can be used for streaming/filter 


 filterOld 
 true 
 Filter out old tweets, that has previously been polled. This state is stored in memory only, and based on last tweet id. Since Camel 2.11.0 The search producer supports this option 


 sinceId 
 1 
 Camel 2.11.0: The last tweet id wh

svn commit: r861519 - in /websites/production/camel/content: cache/main.pageCache download.html

2013-05-10 Thread buildbot
Author: buildbot
Date: Fri May 10 09:18:55 2013
New Revision: 861519

Log:
Production update by buildbot for camel

Modified:
websites/production/camel/content/cache/main.pageCache
websites/production/camel/content/download.html

Modified: websites/production/camel/content/cache/main.pageCache
==
Binary files - no diff available.

Modified: websites/production/camel/content/download.html
==
--- websites/production/camel/content/download.html (original)
+++ websites/production/camel/content/download.html Fri May 10 09:18:55 2013
@@ -141,7 +141,7 @@
 Help us test the latest https://repository.apache.org/content/repositories/snapshots/org/apache/camel/apache-camel";>SNAPSHOTS
 
 
- Version  https://repository.apache.org/content/repositories/snapshots/org/apache/camel/apache-camel/2.12-SNAPSHOT/";>Download
 Apache Camel 2.12-SNAPSHOT 
+ Version  https://repository.apache.org/content/repositories/snapshots/org/apache/camel/apache-camel/2.12-SNAPSHOT/";>Download
 Apache Camel 2.12-SNAPSHOT  https://repository.apache.org/content/repositories/snapshots/org/apache/camel/apache-camel/2.11.1-SNAPSHOT/";>Download
 Apache Camel 2.11.1-SNAPSHOT  https://repository.apache.org/content/repositories/snapshots/org/apache/camel/apache-camel/2.10.5-SNAPSHOT/";>Download
 Apache Camel 2.10.5-SNAPSHOT 
 
 
 




[CONF] Apache Camel > Download

2013-05-10 Thread confluence







Download
Page edited by Christian Mueller


 Changes (1)
 




...
|| Version || | [Download Apache Camel 2.12-SNAPSHOT|https://repository.apache.org/content/repositories/snapshots/org/apache/camel/apache-camel/2.12-SNAPSHOT/] | 
| [Download Apache Camel 2.11.1-SNAPSHOT|https://repository.apache.org/content/repositories/snapshots/org/apache/camel/apache-camel/2.11.1-SNAPSHOT/] | | [Download Apache Camel 2.10.5-SNAPSHOT|https://repository.apache.org/content/repositories/snapshots/org/apache/camel/apache-camel/2.10.5-SNAPSHOT/] | 
 {info} 
...


Full Content

Latest Releases







Grab these releases while they are hot!


	The latest release for Camel 2.11.x is Camel 2.11.0 Release.
	The latest release for Camel 2.10.x is Camel 2.10.4 Release.
	The latest release for Camel 2.9.x is Camel 2.9.7 Release.
	Support for Camel 2.8.x and previous releases is discontinued.





Older Releases

See Download Archives


Getting the latest distributions
The URLs below use redirectionThe above URLs use the Apache Mirror system to redirect you to a suitable mirror for your download. Some users have experienced issues with some versions of browsers (e.g. some Safari browsers). If the download doesn't seem to work for you from the above URL then try using Mozilla Firefox

Binary Distribution




Description
Download Link
PGP Signature file of download
MD5 Checksum file of download
SHA1 Checksum file of download


Windows Distribution
 apache-camel-2.11.0.zip
 apache-camel-2.11.0.zip.asc
 apache-camel-2.11.0.zip.md5
 apache-camel-2.11.0.zip.sha1


Unix/Linux/Cygwin Distribution
 apache-camel-2.11.0.tar.gz
 apache-camel-2.11.0.tar.gz.asc
 apache-camel-2.10.4.tar.gz.md5
 apache-camel-2.11.0.tar.gz.sha1


Windows Distribution
 apache-camel-2.10.4.zip
 apache-camel-2.10.4.zip.asc
 apache-camel-2.10.4.zip.md5
 apache-camel-2.10.4.zip.sha1


Unix/Linux/Cygwin Distribution
 apache-camel-2.10.4.tar.gz
 apache-camel-2.10.4.tar.gz.asc
 apache-camel-2.10.4.tar.gz.md5
 apache-camel-2.10.4.tar.gz.sha1


Windows Distribution (2.9.x branch)
 apache-camel-2.9.7.zip
 apache-camel-2.9.7.zip.asc
 apache-camel-2.9.7.zip.md5
 apache-camel-2.9.7.zip.sha1


Unix/Linux/Cygwin Distribution (2.9.x branch)
 apache-camel-2.9.7.tar.gz
 apache-camel-2.9.7.tar.gz.asc
 apache-camel-2.9.7.tar.gz.md5
 apache-camel-2.9.7.tar.gz.sha1





Source Distribution




Description
Download Link
PGP Signature file of download
MD5 Checksum file of download
SHA1 Checksum file of download


Source (zip - 2.11.x branch) 
 apache-camel-2.11.0-src.zip
 apache-camel-2.11.0-src.zip.asc
 apache-camel-2.11.0-src.zip.md5
 apache-camel-2.11.0-src.zip.sha1


Source (zip - 2.10.x branch) 
 apache-camel-2.10.4-src.zip
 apache-camel-2.10.4-src.zip.asc
 apache-camel-2.10.4-src.zip.md5
 apache-camel-2.10.4-src.zip.sha1


Source (zip - 2.9.x branch) 
 apache-camel-2.9.7-src.zip
 apache-camel-2.9.7-src.zip.asc
 apache-camel-2.9.7-src.zip.md5
 apache-camel-2.9.7-src.zip.sha1





Keys
The KEYS used to sign the release can be found here.

Getting the Binaries using Maven 2

To use this release in your maven project, the proper dependency configuration that you should use in your Maven POM is:




  org.apache.camel
  camel-core
  2.11.0





Getting past releases

See the Download Archives for all time releases.

Releases In Progress

The following releases are currently in progress

Camel 2.12.0 ReleaseCamel x.y.z Release (template)


Snapshots

Help us test the latest SNAPSHOTS




 Version 


 Download Apache Camel 2.12-SNAPSHOT 


 Download Apache Camel 2.11.1-SNAPSHOT 


 Download Apache Camel 2.10.5-SNAPSHOT 





The camel-1.x branch is no longer maintained therefore snapshots for that branch are not available.

Maven 2 Repositories




 Repository 
 URL 


 Apache Camel Releases 
 https://repository.apache.org/content/repositories/releases/


 Apache Camel Releases (old) 
 For Camel 1.6.0 or older releases: http://people.apache.org/repo/m2-ibiblio-rsync-repository/ 


 Apache Camel SNAPSHOTS 
 https://repository.apache.org/content/repositories/snapshots/ 





Maven 2 snapshot repository in pom

Camel
In your pom.xml file you can add the Maven 2 snapshot repository if you want to try out the xxx-SNAPSHOT versions:


  
  apache.snapshots
  Apache Development Snapshot Repository
  https://repository.apache.org/content/repositories/snapshots/
  
  false
  
  
  true
  
  



Then you can use the SNAPSHOT version of camel in your pom.xml:



org.apache.camel
camel-core
2.12-SNAPSHOT




Camel Plugins
And the same setting for the plugin repository if you want to try the latest Apache Camel maven tools also:


  
  apache.snapshots
  Apache Developm

svn commit: r861516 - in /websites/production/camel/content: articles.html cache/main.pageCache

2013-05-10 Thread buildbot
Author: buildbot
Date: Fri May 10 08:19:17 2013
New Revision: 861516

Log:
Production update by buildbot for camel

Modified:
websites/production/camel/content/articles.html
websites/production/camel/content/cache/main.pageCache

Modified: websites/production/camel/content/articles.html
==
--- websites/production/camel/content/articles.html (original)
+++ websites/production/camel/content/articles.html Fri May 10 08:19:17 2013
@@ -146,7 +146,7 @@
 
 Webinar,
 Screenshot, and Video presentations on Camel
 
-http://macstrac.blogspot.com/"; rel="nofollow">James Strachan's http://www.parleys.com/#sl=11&st=5&id=1577"; rel="nofollow">Devoxx 
2009 talk is mostly about Camel and ActiveMQScreenCast: an 
introduction to http://activemq.apache.org/camel/";>Apache Camel and the use of http://activemq.apache.org/camel/enterprise-integration-patterns.html";>Enterprise
 Integration Patterns in http://open.iona.com/resources/video-archived-webinars/camel-screencast-1-medium-resolution/";
 rel="nofollow">Medium Resolution or http://open.iona.com/resources/video-archived-webinars/camel-screencast-1-high-resolution/";
 rel="nofollow">High Resolution by James Strachanhttp://bsnyderblog.blogspot.com/2008/05/activemq-and-servicemix-at-apachecon-us.html";
 rel="nofollow">Taking Camel for a ride presentation by Bruce Snyder at 
ApacheCon US 2008 (Click on link to the presentation in his blog).http://www4.java.no/incogito/session/Taking+Apache+Camel+for+a+Ride.html#";
 rel="nofollow">JavaZone Conference - Taking Apache Camel for a Rider - 
Video presentation by Bruce Snyder at JavaZone September 2008 in Oslo, Norway 
(Click on link to the presentation to show the video).http://www.java-tv.com/2009/07/24/introduction-to-messaging-with-apache-activemq/";
 rel="nofollow">Introduction to messaging with ActiveMQ at http://www.oredev.com/"; rel="nofollow">Øredev 
2008 conference 
 presented by http://bsnyderblog.blogspot.com/"; rel="nofollow">Bruce Snyder (with 
Camel in the end).http://www.springhispano.org/?q=node/564"; rel="nofollow">Videos de las 
charlas de la 9a reunión de JavaMexico (Spanish) by Domingo 
Suarez who did a 1 hour presentation. This is a video recording of his 
presentation.http://fusesource.com/resources/video-archived-webinars/"; 
rel="nofollow">FuseSource webinars - Upcoming and archived webinars on 
Apache Camel and other related Apache products.http://www.youtube.com/fusesource"; 
rel="nofollow">FuseSource YouTube - FuseSource You Tube Channel with 
webcasts about Camel and related Apache projects.http://www.screencast.com/users/tfennelly/folders/Camtasia/med
 ia/c3cef9dd-e667-41ac-8597-74ca01d39968" rel="nofollow">Screencast/Demo of 
Smooks and Apache Camel processing UN/EDIFACT - by Tom Fennelly showing how 
Smooks and Camel works togetherhttp://davsclaus.blogspot.com/"; rel="nofollow">Claus Ibsen's http://www.parleys.com/#id=2158&st=5"; rel="nofollow">Devoxx 2010 
talk is all about Apache Camelhttp://screencasts.chariotsolutions.com/facebook-integration-using-apache-camel";
 rel="nofollow">Facebook integration Apache Camel - 15 min screenshot 
showing how to integrate Camel with Facebook. This screenshot is part of a 
series, with new videos coming up.http://www.parleys.com/#id=2432&st=5&sl=0"; 
rel="nofollow">Paris JUG 2011 - Integration with Apache Camel and ESB - 
Video presentation by Charles Moulliard sh
 owing Apache Camel and Apache ServiceMix. In french.http://jeeconf.com/program/camel/"; 
rel="nofollow">JEEConf 2011 - What riding the Camel can do to make integration 
easier for you - Video presentation by Claus Ibsen, at the JEEConference in 
Kiew, Ukraine, May 2011.http://www.parleys.com/#id=2601&st=5"; rel="nofollow">Belgium JUG 2011 
- Integration with Apache ServiceMix and Camel - Video presentation by 
Charles Moulliard, talking about ESB and Camel.http://skillsmatter.com/podcast/design-architecture/riding-camel/JS-2327"; 
rel="nofollow">In the brain of James Strachan, riding the Camel - Video 
presentation by http://macstrac.blogspot.com/"; rel="nofollow">James Strachan, talking 
about Camel at Skillsmatter, August 2011.http://fusesource.com/fuse/camelone-2011-videos/"; 
rel="nofollow">CamelOne 2011 Video presentations - The video presentations 
from the http://fusesource.com/camelone2011/"; rel="nofollow">CamelOne 2011 
conference, which took place in May 2011.http://vimeo.com/28760458"; rel="nofollow">What 
Riding the Camel can make integration easier for you - Video presentation 
by http://davsclaus.blogspot.com"; 
rel="nofollow">Claus Ibsen, talking about Camel at JavaZone, September 
2011http://vimeo.com/28760446"; rel="nofollow">Er Apache Camel riktig valg for 
deg? Lytt til erfarne Camel spotters - Video presentation by Rune Peter 
Bjørnstad, and Bjørn Nordlund talking about their experience with 
using Camel. The build up a live use-case and present it with
  a sense of humor. The talk is in norwegian.