Modified: websites/production/camel/content/hawtdb.html
==============================================================================
--- websites/production/camel/content/hawtdb.html (original)
+++ websites/production/camel/content/hawtdb.html Fri Aug 25 09:20:43 2017
@@ -36,17 +36,6 @@
     <![endif]-->
 
 
-  <link href='//camel.apache.org/styles/highlighter/styles/shCoreCamel.css' 
rel='stylesheet' type='text/css' />
-  <link href='//camel.apache.org/styles/highlighter/styles/shThemeCamel.css' 
rel='stylesheet' type='text/css' />
-  <script src='//camel.apache.org/styles/highlighter/scripts/shCore.js' 
type='text/javascript'></script>
-  <script src='//camel.apache.org/styles/highlighter/scripts/shBrushJava.js' 
type='text/javascript'></script>
-  <script src='//camel.apache.org/styles/highlighter/scripts/shBrushXml.js' 
type='text/javascript'></script>
-  <script src='//camel.apache.org/styles/highlighter/scripts/shBrushPlain.js' 
type='text/javascript'></script>
-  
-  <script type="text/javascript">
-  SyntaxHighlighter.defaults['toolbar'] = false;
-  SyntaxHighlighter.all();
-  </script>
 
     <title>
     Apache Camel: HawtDB
@@ -91,13 +80,13 @@
 
 <p><a shape="rect" class="external-link" href="http://hawtdb.fusesource.org/"; 
rel="nofollow">HawtDB</a> is a very lightweight and embedable key value 
database. It allows together with Camel to provide persistent support for 
various Camel features such as <a shape="rect" 
href="aggregator2.html">Aggregator</a>. </p>
 
-<div class="confluence-information-macro 
confluence-information-macro-information"><p class="title">Deprecated</p><span 
class="aui-icon aui-icon-small aui-iconfont-info 
confluence-information-macro-icon"></span><div 
class="confluence-information-macro-body">
+<parameter ac:name="title">Deprecated</parameter><rich-text-body>
 <p>The <a shape="rect" class="external-link" 
href="http://hawtdb.fusesource.org/"; rel="nofollow">HawtDB</a>  project is 
being deprecated and replaced by <a shape="rect" class="external-link" 
href="https://code.google.com/p/leveldb/"; rel="nofollow">leveldb</a> as the 
lightweight and embedable key value database. To make using leveldb easy there 
is a <a shape="rect" class="external-link" 
href="https://github.com/fusesource/leveldbjni"; rel="nofollow">leveldbjni</a> 
project for that. The Apache ActiveMQ project is planning on using leveldb as 
their primary file based message store in the future, to replace kahadb.</p>
 
-<p>There os a <a shape="rect" href="leveldb.html">camel-leveldb</a> component 
we recommend to use instead of this.</p></div></div>
+<p>There os a <a shape="rect" href="leveldb.html">camel-leveldb</a> component 
we recommend to use instead of this.</p></rich-text-body>
 
-<div class="confluence-information-macro 
confluence-information-macro-warning"><p class="title">Issue with HawtDB 1.4 or 
older</p><span class="aui-icon aui-icon-small aui-iconfont-error 
confluence-information-macro-icon"></span><div 
class="confluence-information-macro-body">
-<p>There is a bug in HawtDB 1.4 or older which means the filestore will not 
free unused space. That means the file keeps growing. This has been fixed in 
HawtDB 1.5 which is shipped with Camel 2.5 onwards.</p></div></div>
+<parameter ac:name="title">Issue with HawtDB 1.4 or 
older</parameter><rich-text-body>
+<p>There is a bug in HawtDB 1.4 or older which means the filestore will not 
free unused space. That means the file keeps growing. This has been fixed in 
HawtDB 1.5 which is shipped with Camel 2.5 onwards.</p></rich-text-body>
 
 
 <p>Current features it provides:</p>
@@ -133,56 +122,12 @@
 <h4 id="HawtDB-UsingHawtDBAggregationRepositoryinJavaDSL">Using 
HawtDBAggregationRepository in Java DSL</h4>
 <p>In this example we want to persist aggregated messages in the 
<code>target/data/hawtdb.dat</code> file.</p>
 
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent 
panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[
-public void configure() throws Exception {
-    // create the hawtdb repo
-    HawtDBAggregationRepository repo = new 
HawtDBAggregationRepository(&quot;repo1&quot;, 
&quot;target/data/hawtdb.dat&quot;);
-
-    // here is the Camel route where we aggregate
-    from(&quot;direct:start&quot;)
-        .aggregate(header(&quot;id&quot;), new MyAggregationStrategy())
-            // use our created hawtdb repo as aggregation repository
-            .completionSize(5).aggregationRepository(repo)
-            .to(&quot;mock:aggregated&quot;);
-}
-]]></script>
-</div></div>
+<plain-text-body>{snippet:id=e1|lang=java|url=camel/trunk/components/camel-hawtdb/src/test/java/org/apache/camel/component/hawtdb/HawtDBAggregateTest.java}</plain-text-body>
 
 <h4 id="HawtDB-UsingHawtDBAggregationRepositoryinSpringXML">Using 
HawtDBAggregationRepository in Spring XML</h4>
 <p>The same example but using Spring XML instead:</p>
 
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent 
panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[
-
-&lt;!-- a persistent aggregation repository using camel-hawtdb --&gt;
-&lt;bean id=&quot;repo&quot; 
class=&quot;org.apache.camel.component.hawtdb.HawtDBAggregationRepository&quot;&gt;
-    &lt;!-- store the repo in the hawtdb.dat file --&gt;
-    &lt;property name=&quot;persistentFileName&quot; 
value=&quot;target/data/hawtdb.dat&quot;/&gt;
-    &lt;!-- and use repo2 as the repository name --&gt;
-    &lt;property name=&quot;repositoryName&quot; value=&quot;repo2&quot;/&gt;
-&lt;/bean&gt;
-
-&lt;!-- aggregate the messages using this strategy --&gt;
-&lt;bean id=&quot;myAggregatorStrategy&quot; 
class=&quot;org.apache.camel.component.hawtdb.HawtDBSpringAggregateTest$MyAggregationStrategy&quot;/&gt;
-
-&lt;!-- this is the camel routes --&gt;
-&lt;camelContext id=&quot;camel&quot; 
xmlns=&quot;http://camel.apache.org/schema/spring&quot;&gt;
-
-    &lt;route&gt;
-        &lt;from uri=&quot;direct:start&quot;/&gt;
-        &lt;!-- aggregate using our strategy and hawtdb repo, and complete 
when we have 5 messages aggregated --&gt;
-        &lt;aggregate strategyRef=&quot;myAggregatorStrategy&quot; 
aggregationRepositoryRef=&quot;repo&quot; completionSize=&quot;5&quot;&gt;
-            &lt;!-- correlate by header with the key id --&gt;
-            
&lt;correlationExpression&gt;&lt;header&gt;id&lt;/header&gt;&lt;/correlationExpression&gt;
-            &lt;!-- send aggregated messages to the mock endpoint --&gt;
-            &lt;to uri=&quot;mock:aggregated&quot;/&gt;
-        &lt;/aggregate&gt;
-    &lt;/route&gt;
-
-&lt;/camelContext&gt;
-]]></script>
-</div></div>
+<plain-text-body>{snippet:id=e1|lang=xml|url=camel/trunk/components/camel-hawtdb/src/test/resources/org/apache/camel/component/hawtdb/HawtDBSpringAggregateTest.xml}</plain-text-body>
 
 <h3 id="HawtDB-Dependencies">Dependencies</h3>
 
@@ -190,19 +135,16 @@ public void configure() throws Exception
 
 <p>If you use maven you could just add the following to your pom.xml, 
substituting the version number for the latest &amp; greatest release (see <a 
shape="rect" href="download.html">the download page for the latest 
versions</a>).</p>
 
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent 
panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[
+<parameter ac:name="">xml</parameter><plain-text-body>
 &lt;dependency&gt;
   &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
   &lt;artifactId&gt;camel-hawtdb&lt;/artifactId&gt;
   &lt;version&gt;2.3.0&lt;/version&gt;
 &lt;/dependency&gt;
-]]></script>
-</div></div>
+</plain-text-body>
 
 
-<h3 id="HawtDB-SeeAlso">See Also</h3>
-<ul><li><a shape="rect" href="configuring-camel.html">Configuring 
Camel</a></li><li><a shape="rect" 
href="component.html">Component</a></li><li><a shape="rect" 
href="endpoint.html">Endpoint</a></li><li><a shape="rect" 
href="getting-started.html">Getting Started</a></li></ul>
+<parameter ac:name=""><a shape="rect" href="endpoint-see-also.html">Endpoint 
See Also</a></parameter>
 <ul class="alternate"><li><a shape="rect" 
href="aggregator2.html">Aggregator</a></li><li><a shape="rect" 
href="components.html">Components</a></li></ul></div>
         </td>
         <td valign="top">

Modified: websites/production/camel/content/jasypt.html
==============================================================================
--- websites/production/camel/content/jasypt.html (original)
+++ websites/production/camel/content/jasypt.html Fri Aug 25 09:20:43 2017
@@ -36,17 +36,6 @@
     <![endif]-->
 
 
-  <link href='//camel.apache.org/styles/highlighter/styles/shCoreCamel.css' 
rel='stylesheet' type='text/css' />
-  <link href='//camel.apache.org/styles/highlighter/styles/shThemeCamel.css' 
rel='stylesheet' type='text/css' />
-  <script src='//camel.apache.org/styles/highlighter/scripts/shCore.js' 
type='text/javascript'></script>
-  <script src='//camel.apache.org/styles/highlighter/scripts/shBrushJava.js' 
type='text/javascript'></script>
-  <script src='//camel.apache.org/styles/highlighter/scripts/shBrushXml.js' 
type='text/javascript'></script>
-  <script src='//camel.apache.org/styles/highlighter/scripts/shBrushPlain.js' 
type='text/javascript'></script>
-  
-  <script type="text/javascript">
-  SyntaxHighlighter.defaults['toolbar'] = false;
-  SyntaxHighlighter.all();
-  </script>
 
     <title>
     Apache Camel: Jasypt
@@ -86,176 +75,115 @@
        <tbody>
         <tr>
         <td valign="top" width="100%">
-<div class="wiki-content maincontent"><h2 id="Jasypt-Jasyptcomponent">Jasypt 
component</h2><p><strong>Available as of Camel 2.5</strong></p><p><a 
shape="rect" class="external-link" href="http://www.jasypt.org/"; 
rel="nofollow">Jasypt</a> is a simplified encryption library which makes 
encryption and decryption easy. Camel integrates with Jasypt to allow sensitive 
information in <a shape="rect" href="properties.html">Properties</a> files to 
be encrypted. By dropping <strong><code>camel-jasypt</code></strong> on the 
classpath those encrypted values will automatically be decrypted on-the-fly by 
Camel. This ensures that human eyes can't easily spot sensitive information 
such as usernames and passwords.</p><p>Maven users will need to add the 
following dependency to their <code>pom.xml</code> for this component:</p><div 
class="code panel pdl" style="border-width: 1px;"><div class="codeContent 
panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[&lt;dependency&gt;
+<div class="wiki-content maincontent"><h2 id="Jasypt-Jasyptcomponent">Jasypt 
component</h2><p><strong>Available as of Camel 2.5</strong></p><p><a 
shape="rect" class="external-link" href="http://www.jasypt.org/"; 
rel="nofollow">Jasypt</a> is a simplified encryption library which makes 
encryption and decryption easy. Camel integrates with Jasypt to allow sensitive 
information in <a shape="rect" href="properties.html">Properties</a> files to 
be encrypted. By dropping <strong><code>camel-jasypt</code></strong> on the 
classpath those encrypted values will automatically be decrypted on-the-fly by 
Camel. This ensures that human eyes can't easily spot sensitive information 
such as usernames and passwords.</p><p>Maven users will need to add the 
following dependency to their <code>pom.xml</code> for this 
component:</p><parameter 
ac:name="">xml</parameter><plain-text-body>&lt;dependency&gt;
     &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
     &lt;artifactId&gt;camel-jasypt&lt;/artifactId&gt;
     &lt;version&gt;x.x.x&lt;/version&gt;
     &lt;!-- use the same version as your Camel core version --&gt;
 &lt;/dependency&gt;
-]]></script>
-</div></div><h3 id="Jasypt-Tooling">Tooling</h3><p>The <a shape="rect" 
href="jasypt.html">Jasypt</a> component provides a little command line tooling 
to encrypt or decrypt values.</p><p>The console output the syntax and which 
options it provides:</p><div class="code panel pdl" style="border-width: 
1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[Apache Camel Jasypt takes the following 
options
+</plain-text-body><h3 id="Jasypt-Tooling">Tooling</h3><p>The <a shape="rect" 
href="jasypt.html">Jasypt</a> component provides a little command line tooling 
to encrypt or decrypt values.</p><p>The console output the syntax and which 
options it provides:</p><plain-text-body>Apache Camel Jasypt takes the 
following options
 
   -h or -help = Displays the help screen
   -c or -command &lt;command&gt; = Command either encrypt or decrypt
   -p or -password &lt;password&gt; = Password to use
   -i or -input &lt;input&gt; = Text to encrypt or decrypt
   -a or -algorithm &lt;algorithm&gt; = Optional algorithm to use
-]]></script>
-</div></div><p>For example to encrypt the value <code>tiger</code> you run 
with the following parameters. In the apache camel kit, you cd into the lib 
folder and run the following java cmd, where <em>&lt;CAMEL_HOME&gt;</em> is 
where you have downloaded and extract the Camel distribution.</p><div 
class="code panel pdl" style="border-width: 1px;"><div class="codeContent 
panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[$ cd &lt;CAMEL_HOME&gt;/lib
+</plain-text-body><p>For example to encrypt the value <code>tiger</code> you 
run with the following parameters. In the apache camel kit, you cd into the lib 
folder and run the following java cmd, where <em>&lt;CAMEL_HOME&gt;</em> is 
where you have downloaded and extract the Camel 
distribution.</p><plain-text-body>$ cd &lt;CAMEL_HOME&gt;/lib
 $ java -jar camel-jasypt-2.5.0.jar -c encrypt -p secret -i tiger
-]]></script>
-</div></div><p>Which outputs the following result</p><div class="code panel 
pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[Encrypted text: qaEEacuW7BUti8LcMgyjKw==
-]]></script>
-</div></div><p>This means the encrypted representation 
<code>qaEEacuW7BUti8LcMgyjKw==</code> can be decrypted back to 
<code>tiger</code> if you know the master password which was 
<code>secret</code>.<br clear="none"> If you run the tool again then the 
encrypted value will return a different result. But decrypting the value will 
always return the correct original value.</p><p>So you can test it by running 
the tooling using the following parameters:</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[$ cd &lt;CAMEL_HOME&gt;/lib
+</plain-text-body><p>Which outputs the following 
result</p><plain-text-body>Encrypted text: qaEEacuW7BUti8LcMgyjKw==
+</plain-text-body><p>This means the encrypted representation 
<code>qaEEacuW7BUti8LcMgyjKw==</code> can be decrypted back to 
<code>tiger</code> if you know the master password which was 
<code>secret</code>.<br clear="none"> If you run the tool again then the 
encrypted value will return a different result. But decrypting the value will 
always return the correct original value.</p><p>So you can test it by running 
the tooling using the following parameters:</p><plain-text-body>$ cd 
&lt;CAMEL_HOME&gt;/lib
 $ java -jar camel-jasypt-2.5.0.jar -c decrypt -p secret -i 
qaEEacuW7BUti8LcMgyjKw==
-]]></script>
-</div></div><p>Which outputs the following result:</p><div class="code panel 
pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[Decrypted text: tiger
-]]></script>
-</div></div><p>The idea is then to use those encrypted values in your <a 
shape="rect" href="properties.html">Properties</a> files. Notice how the 
password value is encrypted and the value has the tokens surrounding 
<code>ENC(value here)</code></p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[
-# refer to a mock endpoint name by that encrypted password
-cool.result=mock:{{cool.password}}
-
-# here is a password which is encrypted
-cool.password=ENC(bsW9uV37gQ0QHFu7KO03Ww==)
-]]></script>
-</div></div><h4 id="Jasypt-ToolingdependenciesforCamel2.5and2.6">Tooling 
dependencies for Camel 2.5 and 2.6</h4><p>The tooling requires the following 
JARs in the classpath, which has been enlisted in the <code>MANIFEST.MF</code> 
file of <code>camel-jasypt</code> with <code>optional/</code> as prefix. Hence 
why the java cmd above can pickup the needed JARs from the Apache Distribution 
in the <code>optional</code> directory.</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[jasypt-1.6.jar commons-lang-2.4.jar 
commons-codec-1.4.jar icu4j-4.0.1.jar
-]]></script>
-</div></div><div class="confluence-information-macro 
confluence-information-macro-information"><p class="title">Java 1.5 
users</p><span class="aui-icon aui-icon-small aui-iconfont-info 
confluence-information-macro-icon"></span><div 
class="confluence-information-macro-body"><p>The <code>icu4j-4.0.1.jar</code> 
is only needed when running on JDK 1.5.</p><p>This JAR is not distributed by 
Apache Camel and you have to download it manually and copy it to the 
<code>lib/optional</code> directory of the Camel distribution.<br clear="none"> 
You can download it from <a shape="rect" class="external-link" 
href="http://repo2.maven.org/maven2/com/ibm/icu/icu4j/4.0.1/"; 
rel="nofollow">Apache Central Maven repo</a>.</p></div></div><h4 
id="Jasypt-ToolingdependenciesforCamel2.7orbetter">Tooling dependencies for 
Camel 2.7 or better</h4><p>Jasypt 1.7 onwards is now fully standalone so no 
additional JARs is needed.</p><h3 id="Jasypt-URIOptions">URI Options</h3><p>The 
options below are exclusive for the <a 
 shape="rect" href="jasypt.html">Jasypt</a> component.</p><div 
class="confluenceTableSmall">
+</plain-text-body><p>Which outputs the following 
result:</p><plain-text-body>Decrypted text: tiger
+</plain-text-body><p>The idea is then to use those encrypted values in your <a 
shape="rect" href="properties.html">Properties</a> files. Notice how the 
password value is encrypted and the value has the tokens surrounding 
<code>ENC(value 
here)</code></p><plain-text-body>{snippet:id=e1|lang=java|url=camel/trunk/components/camel-jasypt/src/test/resources/org/apache/camel/component/jasypt/myproperties.properties}</plain-text-body><h4
 id="Jasypt-ToolingdependenciesforCamel2.5and2.6">Tooling dependencies for 
Camel 2.5 and 2.6</h4><p>The tooling requires the following JARs in the 
classpath, which has been enlisted in the <code>MANIFEST.MF</code> file of 
<code>camel-jasypt</code> with <code>optional/</code> as prefix. Hence why the 
java cmd above can pickup the needed JARs from the Apache Distribution in the 
<code>optional</code> directory.</p><plain-text-body>jasypt-1.6.jar 
commons-lang-2.4.jar commons-codec-1.4.jar icu4j-4.0.1.jar
+</plain-text-body><parameter ac:name="title">Java 1.5 
users</parameter><rich-text-body><p>The <code>icu4j-4.0.1.jar</code> is only 
needed when running on JDK 1.5.</p><p>This JAR is not distributed by Apache 
Camel and you have to download it manually and copy it to the 
<code>lib/optional</code> directory of the Camel distribution.<br clear="none"> 
You can download it from <a shape="rect" class="external-link" 
href="http://repo2.maven.org/maven2/com/ibm/icu/icu4j/4.0.1/"; 
rel="nofollow">Apache Central Maven repo</a>.</p></rich-text-body><h4 
id="Jasypt-ToolingdependenciesforCamel2.7orbetter">Tooling dependencies for 
Camel 2.7 or better</h4><p>Jasypt 1.7 onwards is now fully standalone so no 
additional JARs is needed.</p><h3 id="Jasypt-URIOptions">URI Options</h3><p>The 
options below are exclusive for the <a shape="rect" 
href="jasypt.html">Jasypt</a> component.</p><parameter 
ac:name="class">confluenceTableSmall</parameter><rich-text-body>
 <div class="table-wrap"><table class="confluenceTable"><tbody><tr><th 
colspan="1" rowspan="1" class="confluenceTh"><p> Name </p></th><th colspan="1" 
rowspan="1" class="confluenceTh"><p> Default Value </p></th><th colspan="1" 
rowspan="1" class="confluenceTh"><p> Type </p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p> Description </p></th></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p> <code>password</code> </p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p> <code>null</code> </p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p> <code>String</code> 
</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Specifies the 
master password to use for decrypting. This option is mandatory. See below for 
more details. </p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p> <code>algorithm</code> </p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p> <code>null</code> </p></td><td colspan="1" 
rowspan="1" class="confluenceTd">
 <p> <code>String</code> </p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p> Name of an optional algorithm to use. 
</p></td></tr></tbody></table></div>
-</div>
-
-
-<h3 id="Jasypt-Protectingthemasterpassword">Protecting the master 
password</h3><p>The master password used by <a shape="rect" 
href="jasypt.html">Jasypt</a> must be provided, so that it's capable of 
decrypting the values. However having this master password out in the open may 
not be an ideal solution. Therefore you could for example provide it as a JVM 
system property or as a OS environment setting. If you decide to do so then the 
<code>password</code> option supports prefixes which dictates this. 
<code>sysenv:</code> means to lookup the OS system environment with the given 
key. <code>sys:</code> means to lookup a JVM system property.</p><p>For example 
you could provided the password before you start the application</p><div 
class="code panel pdl" style="border-width: 1px;"><div class="codeContent 
panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[$ export CAMEL_ENCRYPTION_PASSWORD=secret
-]]></script>
-</div></div><p>Then start the application, such as running the start 
script.</p><p>When the application is up and running you can unset the 
environment</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[$ unset CAMEL_ENCRYPTION_PASSWORD
-]]></script>
-</div></div><p>The <code>password</code> option is then a matter of defining 
as follows: <code>password=sysenv:CAMEL_ENCRYPTION_PASSWORD</code>.</p><h3 
id="Jasypt-ExamplewithJavaDSL">Example with Java DSL</h3><p>In Java DSL you 
need to configure <a shape="rect" href="jasypt.html">Jasypt</a> as a 
<code>JasyptPropertiesParser</code> instance and set it on the <a shape="rect" 
href="properties.html">Properties</a> component as show below:</p><div 
class="code panel pdl" style="border-width: 1px;"><div class="codeContent 
panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[
-// create the jasypt properties parser
-JasyptPropertiesParser jasypt = new JasyptPropertiesParser();
-// and set the master password
-jasypt.setPassword(&quot;secret&quot;);
-
-// create the properties component
-PropertiesComponent pc = new PropertiesComponent();
-pc.setLocation(&quot;classpath:org/apache/camel/component/jasypt/myproperties.properties&quot;);
-// and use the jasypt properties parser so we can decrypt values
-pc.setPropertiesParser(jasypt);
-
-// add properties component to camel context
-context.addComponent(&quot;properties&quot;, pc);
-]]></script>
-</div></div><p>The properties file <code>myproperties.properties</code> then 
contain the encrypted value, such as shown below. Notice how the password value 
is encrypted and the value has the tokens surrounding <code>ENC(value 
here)</code></p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[
-# refer to a mock endpoint name by that encrypted password
-cool.result=mock:{{cool.password}}
-
-# here is a password which is encrypted
-cool.password=ENC(bsW9uV37gQ0QHFu7KO03Ww==)
-]]></script>
-</div></div><h3 id="Jasypt-ExamplewithSpringXML">Example with Spring 
XML</h3><p>In Spring XML you need to configure the 
<code>JasyptPropertiesParser</code> which is shown below. Then the Camel <a 
shape="rect" href="properties.html">Properties</a> component is told to use 
<code>jasypt</code> as the properties parser, which means <a shape="rect" 
href="jasypt.html">Jasypt</a> has its chance to decrypt values looked up in the 
properties.</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[&lt;!-- define the jasypt properties parser 
with the given password to be used --&gt;
-&lt;bean id=&quot;jasypt&quot; 
class=&quot;org.apache.camel.component.jasypt.JasyptPropertiesParser&quot;&gt;
-    &lt;property name=&quot;password&quot; value=&quot;secret&quot;/&gt;
+</rich-text-body><h3 id="Jasypt-Protectingthemasterpassword">Protecting the 
master password</h3><p>The master password used by <a shape="rect" 
href="jasypt.html">Jasypt</a> must be provided, so that it's capable of 
decrypting the values. However having this master password out in the open may 
not be an ideal solution. Therefore you could for example provide it as a JVM 
system property or as a OS environment setting. If you decide to do so then the 
<code>password</code> option supports prefixes which dictates this. 
<code>sysenv:</code> means to lookup the OS system environment with the given 
key. <code>sys:</code> means to lookup a JVM system property.</p><p>For example 
you could provided the password before you start the 
application</p><plain-text-body>$ export CAMEL_ENCRYPTION_PASSWORD=secret
+</plain-text-body><p>Then start the application, such as running the start 
script.</p><p>When the application is up and running you can unset the 
environment</p><plain-text-body>$ unset CAMEL_ENCRYPTION_PASSWORD
+</plain-text-body><p>The <code>password</code> option is then a matter of 
defining as follows: 
<code>password=sysenv:CAMEL_ENCRYPTION_PASSWORD</code>.</p><h3 
id="Jasypt-ExamplewithJavaDSL">Example with Java DSL</h3><p>In Java DSL you 
need to configure <a shape="rect" href="jasypt.html">Jasypt</a> as a 
<code>JasyptPropertiesParser</code> instance and set it on the <a shape="rect" 
href="properties.html">Properties</a> component as show 
below:</p><plain-text-body>{snippet:id=e1|lang=java|url=camel/trunk/components/camel-jasypt/src/test/java/org/apache/camel/component/jasypt/JasyptPropertiesTest.java}</plain-text-body><p>The
 properties file <code>myproperties.properties</code> then contain the 
encrypted value, such as shown below. Notice how the password value is 
encrypted and the value has the tokens surrounding <code>ENC(value 
here)</code></p><plain-text-body>{snippet:id=e1|lang=java|url=camel/trunk/components/camel-jasypt/src/test/resources/org/apache/camel/component/jasypt/mypropert
 ies.properties}</plain-text-body><h3 id="Jasypt-ExamplewithSpringXML">Example 
with Spring XML</h3><p>In Spring XML you need to configure the 
<code>JasyptPropertiesParser</code> which is shown below. Then the Camel <a 
shape="rect" href="properties.html">Properties</a> component is told to use 
<code>jasypt</code> as the properties parser, which means <a shape="rect" 
href="jasypt.html">Jasypt</a> has its chance to decrypt values looked up in the 
properties.</p><parameter 
ac:name="language">xml</parameter><plain-text-body>&lt;!-- define the jasypt 
properties parser with the given password to be used --&gt;
+&lt;bean id="jasypt" 
class="org.apache.camel.component.jasypt.JasyptPropertiesParser"&gt;
+    &lt;property name="password" value="secret"/&gt;
 &lt;/bean&gt;
  
 &lt;!-- define the camel properties component --&gt;
-&lt;bean id=&quot;properties&quot; 
class=&quot;org.apache.camel.component.properties.PropertiesComponent&quot;&gt;
+&lt;bean id="properties" 
class="org.apache.camel.component.properties.PropertiesComponent"&gt;
     &lt;!-- the properties file is in the classpath --&gt;
-    &lt;property name=&quot;location&quot; 
value=&quot;classpath:org/apache/camel/component/jasypt/myproperties.properties&quot;/&gt;
+    &lt;property name="location" 
value="classpath:org/apache/camel/component/jasypt/myproperties.properties"/&gt;
     &lt;!-- and let it leverage the jasypt parser --&gt;
-    &lt;property name=&quot;propertiesParser&quot; ref=&quot;jasypt&quot;/&gt;
+    &lt;property name="propertiesParser" ref="jasypt"/&gt;
 &lt;/bean&gt;
-]]></script>
-</div></div><p>The <a shape="rect" href="properties.html">Properties</a> 
component can also be inlined inside the <code>&lt;camelContext&gt;</code> tag 
which is shown below. Notice how we use the <code>propertiesParserRef</code> 
attribute to refer to <a shape="rect" href="jasypt.html">Jasypt</a>.</p><div 
class="code panel pdl" style="border-width: 1px;"><div class="codeContent 
panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[&lt;!-- define the jasypt properties parser 
with the given password to be used --&gt;
-&lt;bean id=&quot;jasypt&quot; 
class=&quot;org.apache.camel.component.jasypt.JasyptPropertiesParser&quot;&gt;
+</plain-text-body><p>The <a shape="rect" href="properties.html">Properties</a> 
component can also be inlined inside the <code>&lt;camelContext&gt;</code> tag 
which is shown below. Notice how we use the <code>propertiesParserRef</code> 
attribute to refer to <a shape="rect" 
href="jasypt.html">Jasypt</a>.</p><plain-text-body>&lt;!-- define the jasypt 
properties parser with the given password to be used --&gt;
+&lt;bean id="jasypt" 
class="org.apache.camel.component.jasypt.JasyptPropertiesParser"&gt;
     &lt;!-- password is mandatory, you can prefix it with sysenv: or sys: to 
indicate it should use
          an OS environment or JVM system property value, so you dont have the 
master password defined here --&gt;
-    &lt;property name=&quot;password&quot; value=&quot;secret&quot;/&gt;
+    &lt;property name="password" value="secret"/&gt;
 &lt;/bean&gt;
  
-&lt;camelContext xmlns=&quot;http://camel.apache.org/schema/spring&quot;&gt;
+&lt;camelContext xmlns="http://camel.apache.org/schema/spring"&gt;
     &lt;!-- define the camel properties placeholder, and let it leverage 
jasypt --&gt;
-    &lt;propertyPlaceholder id=&quot;properties&quot;
-                         
location=&quot;classpath:org/apache/camel/component/jasypt/myproperties.properties&quot;
-                         propertiesParserRef=&quot;jasypt&quot;/&gt;
+    &lt;propertyPlaceholder id="properties"
+                         
location="classpath:org/apache/camel/component/jasypt/myproperties.properties"
+                         propertiesParserRef="jasypt"/&gt;
     &lt;route&gt;
-        &lt;from uri=&quot;direct:start&quot;/&gt;
-        &lt;to uri=&quot;{{cool.result}}&quot;/&gt;
+        &lt;from uri="direct:start"/&gt;
+        &lt;to uri="{{cool.result}}"/&gt;
     &lt;/route&gt;
 &lt;/camelContext&gt;
-]]></script>
-</div></div><h3 id="Jasypt-ExamplewithBlueprintXML">Example with Blueprint 
XML</h3><p>In Blueprint XML you need to configure 
the&#160;<code>JasyptPropertiesParser</code>&#160;which is shown below. Then 
the Camel&#160;<a shape="rect" 
href="properties.html">Properties</a>&#160;component is told to 
use&#160;<code>jasypt</code>&#160;as the properties parser, which means&#160;<a 
shape="rect" href="jasypt.html">Jasypt</a>&#160;has its chance to decrypt 
values looked up in the properties.</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[&lt;blueprint 
xmlns=&quot;http://www.osgi.org/xmlns/blueprint/v1.0.0&quot;
-           xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
-           
xmlns:cm=&quot;http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0&quot;
-           xsi:schemaLocation=&quot;
-           http://www.osgi.org/xmlns/blueprint/v1.0.0 
http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd&quot;&gt;
+</plain-text-body><h3 id="Jasypt-ExamplewithBlueprintXML">Example with 
Blueprint XML</h3><p>In Blueprint XML you need to configure 
the&#160;<code>JasyptPropertiesParser</code>&#160;which is shown below. Then 
the Camel&#160;<a shape="rect" 
href="properties.html">Properties</a>&#160;component is told to 
use&#160;<code>jasypt</code>&#160;as the properties parser, which means&#160;<a 
shape="rect" href="jasypt.html">Jasypt</a>&#160;has its chance to decrypt 
values looked up in the properties.</p><parameter 
ac:name="language">xml</parameter><plain-text-body>&lt;blueprint 
xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0";
+           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+           
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0";
+           xsi:schemaLocation="
+           http://www.osgi.org/xmlns/blueprint/v1.0.0 
http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd"&gt;
 
-  &lt;cm:property-placeholder id=&quot;myblue&quot; 
persistent-id=&quot;mypersistent&quot;&gt;
+  &lt;cm:property-placeholder id="myblue" persistent-id="mypersistent"&gt;
       &lt;!-- list some properties for this test --&gt;
       &lt;cm:default-properties&gt;
-          &lt;cm:property name=&quot;cool.result&quot; 
value=&quot;mock:{{cool.password}}&quot;/&gt;
-          &lt;cm:property name=&quot;cool.password&quot; 
value=&quot;ENC(bsW9uV37gQ0QHFu7KO03Ww==)&quot;/&gt;
+          &lt;cm:property name="cool.result" 
value="mock:{{cool.password}}"/&gt;
+          &lt;cm:property name="cool.password" 
value="ENC(bsW9uV37gQ0QHFu7KO03Ww==)"/&gt;
       &lt;/cm:default-properties&gt;
   &lt;/cm:property-placeholder&gt;
 
     &lt;!-- define the jasypt properties parser with the given password to be 
used --&gt;
-    &lt;bean id=&quot;jasypt&quot; 
class=&quot;org.apache.camel.component.jasypt.JasyptPropertiesParser&quot;&gt;
-        &lt;property name=&quot;password&quot; value=&quot;secret&quot;/&gt;
+    &lt;bean id="jasypt" 
class="org.apache.camel.component.jasypt.JasyptPropertiesParser"&gt;
+        &lt;property name="password" value="secret"/&gt;
     &lt;/bean&gt;
 
-    &lt;camelContext 
xmlns=&quot;http://camel.apache.org/schema/blueprint&quot;&gt;
+    &lt;camelContext xmlns="http://camel.apache.org/schema/blueprint"&gt;
       &lt;!-- define the camel properties placeholder, and let it leverage 
jasypt --&gt;
-      &lt;propertyPlaceholder id=&quot;properties&quot;
-                           location=&quot;blueprint:myblue&quot;
-                           propertiesParserRef=&quot;jasypt&quot;/&gt;
+      &lt;propertyPlaceholder id="properties"
+                           location="blueprint:myblue"
+                           propertiesParserRef="jasypt"/&gt;
         &lt;route&gt;
-            &lt;from uri=&quot;direct:start&quot;/&gt;
-            &lt;to uri=&quot;{{cool.result}}&quot;/&gt;
+            &lt;from uri="direct:start"/&gt;
+            &lt;to uri="{{cool.result}}"/&gt;
         &lt;/route&gt;
     &lt;/camelContext&gt;
 
 &lt;/blueprint&gt;
 
-]]></script>
-</div></div><p>The&#160;<a shape="rect" 
href="properties.html">Properties</a>&#160;component can also be inlined inside 
the&#160;<code>&lt;camelContext&gt;</code>&#160;tag which is shown below. 
Notice how we use the&#160;<code>propertiesParserRef</code>&#160;attribute to 
refer to&#160;<a shape="rect" href="jasypt.html">Jasypt</a>.</p><div 
class="code panel pdl" style="border-width: 1px;"><div class="codeContent 
panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[&lt;blueprint 
xmlns=&quot;http://www.osgi.org/xmlns/blueprint/v1.0.0&quot;
-           xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
-           
xmlns:cm=&quot;http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0&quot;
-           xsi:schemaLocation=&quot;
-           http://www.osgi.org/xmlns/blueprint/v1.0.0 
http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd&quot;&gt;
+</plain-text-body><p>The&#160;<a shape="rect" 
href="properties.html">Properties</a>&#160;component can also be inlined inside 
the&#160;<code>&lt;camelContext&gt;</code>&#160;tag which is shown below. 
Notice how we use the&#160;<code>propertiesParserRef</code>&#160;attribute to 
refer to&#160;<a shape="rect" href="jasypt.html">Jasypt</a>.</p><parameter 
ac:name="language">xml</parameter><plain-text-body>&lt;blueprint 
xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0";
+           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+           
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0";
+           xsi:schemaLocation="
+           http://www.osgi.org/xmlns/blueprint/v1.0.0 
http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd"&gt;
 
     &lt;!-- define the jasypt properties parser with the given password to be 
used --&gt;
-    &lt;bean id=&quot;jasypt&quot; 
class=&quot;org.apache.camel.component.jasypt.JasyptPropertiesParser&quot;&gt;
-        &lt;property name=&quot;password&quot; value=&quot;secret&quot;/&gt;
+    &lt;bean id="jasypt" 
class="org.apache.camel.component.jasypt.JasyptPropertiesParser"&gt;
+        &lt;property name="password" value="secret"/&gt;
     &lt;/bean&gt;
 
-    &lt;camelContext 
xmlns=&quot;http://camel.apache.org/schema/blueprint&quot;&gt;
+    &lt;camelContext xmlns="http://camel.apache.org/schema/blueprint"&gt;
       &lt;!-- define the camel properties placeholder, and let it leverage 
jasypt --&gt;
-      &lt;propertyPlaceholder id=&quot;properties&quot;
-                           
location=&quot;classpath:org/apache/camel/component/jasypt/myproperties.properties&quot;
-                           propertiesParserRef=&quot;jasypt&quot;/&gt;
+      &lt;propertyPlaceholder id="properties"
+                           
location="classpath:org/apache/camel/component/jasypt/myproperties.properties"
+                           propertiesParserRef="jasypt"/&gt;
         &lt;route&gt;
-            &lt;from uri=&quot;direct:start&quot;/&gt;
-            &lt;to uri=&quot;{{cool.result}}&quot;/&gt;
+            &lt;from uri="direct:start"/&gt;
+            &lt;to uri="{{cool.result}}"/&gt;
         &lt;/route&gt;
     &lt;/camelContext&gt;
 
 &lt;/blueprint&gt;
-]]></script>
-</div></div><p>&#160;</p><h3 id="Jasypt-SeeAlso">See Also</h3><ul 
class="alternate"><li><a shape="rect" 
href="security.html">Security</a></li><li><a shape="rect" 
href="properties.html">Properties</a></li><li><a shape="rect" 
class="external-link" 
href="http://activemq.apache.org/encrypted-passwords.html";>Encrypted passwords 
in ActiveMQ</a> - ActiveMQ has a similar feature as this 
<code>camel-jasypt</code> component</li></ul></div>
+</plain-text-body><p>&#160;</p><h3 id="Jasypt-SeeAlso">See Also</h3><ul 
class="alternate"><li><a shape="rect" 
href="security.html">Security</a></li><li><a shape="rect" 
href="properties.html">Properties</a></li><li><a shape="rect" 
class="external-link" 
href="http://activemq.apache.org/encrypted-passwords.html";>Encrypted passwords 
in ActiveMQ</a> - ActiveMQ has a similar feature as this 
<code>camel-jasypt</code> component</li></ul></div>
         </td>
         <td valign="top">
           <div class="navigation">

Modified: websites/production/camel/content/jaxb.html
==============================================================================
--- websites/production/camel/content/jaxb.html (original)
+++ websites/production/camel/content/jaxb.html Fri Aug 25 09:20:43 2017
@@ -36,17 +36,6 @@
     <![endif]-->
 
 
-  <link href='//camel.apache.org/styles/highlighter/styles/shCoreCamel.css' 
rel='stylesheet' type='text/css' />
-  <link href='//camel.apache.org/styles/highlighter/styles/shThemeCamel.css' 
rel='stylesheet' type='text/css' />
-  <script src='//camel.apache.org/styles/highlighter/scripts/shCore.js' 
type='text/javascript'></script>
-  <script src='//camel.apache.org/styles/highlighter/scripts/shBrushJava.js' 
type='text/javascript'></script>
-  <script src='//camel.apache.org/styles/highlighter/scripts/shBrushXml.js' 
type='text/javascript'></script>
-  <script src='//camel.apache.org/styles/highlighter/scripts/shBrushPlain.js' 
type='text/javascript'></script>
-  
-  <script type="text/javascript">
-  SyntaxHighlighter.defaults['toolbar'] = false;
-  SyntaxHighlighter.all();
-  </script>
 
     <title>
     Apache Camel: JAXB
@@ -86,136 +75,45 @@
        <tbody>
         <tr>
         <td valign="top" width="100%">
-<div class="wiki-content maincontent"><h2 id="JAXB-JAXB">JAXB</h2><p>JAXB is a 
<a shape="rect" href="data-format.html">Data Format</a> which uses the JAXB2 
XML marshalling standard which is included in Java 6 to unmarshal an XML 
payload into Java objects or to marshal Java objects into an XML 
payload.</p><h3 id="JAXB-UsingtheJavaDSL">Using the Java DSL</h3><p>For example 
the following uses a named DataFormat of <em>jaxb</em> which is configured with 
a number of Java package names to initialize the <a shape="rect" 
class="external-link" 
href="http://java.sun.com/javase/6/docs/api/javax/xml/bind/JAXBContext.html"; 
rel="nofollow">JAXBContext</a>.</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[DataFormat jaxb = new 
JaxbDataFormat(&quot;com.acme.model&quot;);
+<div class="wiki-content maincontent"><h2 id="JAXB-JAXB">JAXB</h2><p>JAXB is a 
<a shape="rect" href="data-format.html">Data Format</a> which uses the JAXB2 
XML marshalling standard which is included in Java 6 to unmarshal an XML 
payload into Java objects or to marshal Java objects into an XML 
payload.</p><h3 id="JAXB-UsingtheJavaDSL">Using the Java DSL</h3><p>For example 
the following uses a named DataFormat of <em>jaxb</em> which is configured with 
a number of Java package names to initialize the <a shape="rect" 
class="external-link" 
href="http://java.sun.com/javase/6/docs/api/javax/xml/bind/JAXBContext.html"; 
rel="nofollow">JAXBContext</a>.</p><plain-text-body>DataFormat jaxb = new 
JaxbDataFormat("com.acme.model");
 
-from(&quot;activemq:My.Queue&quot;).
+from("activemq:My.Queue").
   unmarshal(jaxb).
-  to(&quot;mqseries:Another.Queue&quot;);
-]]></script>
-</div></div><p>You can if you prefer use a named reference to a data format 
which can then be defined in your <a shape="rect" 
href="registry.html">Registry</a> such as via your <a shape="rect" 
href="spring.html">Spring</a> XML file. e.g.</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[from(&quot;activemq:My.Queue&quot;).
-  unmarshal(&quot;myJaxbDataType&quot;).
-  to(&quot;mqseries:Another.Queue&quot;);
-]]></script>
-</div></div><h3 id="JAXB-UsingSpringXML">Using Spring XML</h3><p>The following 
example shows how to use JAXB to unmarshal using <a shape="rect" 
href="spring.html">Spring</a> configuring the jaxb data type</p><div 
class="code panel pdl" style="border-width: 1px;"><div class="codeContent 
panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[
-&lt;camelContext id=&quot;camel&quot; 
xmlns=&quot;http://camel.apache.org/schema/spring&quot;&gt;
-  &lt;route&gt;
-    &lt;from uri=&quot;direct:start&quot;/&gt;
-    &lt;unmarshal&gt;
-      &lt;jaxb prettyPrint=&quot;true&quot; 
contextPath=&quot;org.apache.camel.example&quot;/&gt;
-    &lt;/unmarshal&gt;
-    &lt;to uri=&quot;mock:result&quot;/&gt;
-  &lt;/route&gt;
-&lt;/camelContext&gt;
-]]></script>
-</div></div>This example shows how to configure the data type just once and 
reuse it on multiple routes.<div class="code panel pdl" style="border-width: 
1px;"><div class="codeContent panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[
-&lt;camelContext id=&quot;camel&quot; 
xmlns=&quot;http://camel.apache.org/schema/spring&quot;&gt;
-  &lt;dataFormats&gt;
-    &lt;jaxb id=&quot;myJaxb&quot; prettyPrint=&quot;true&quot; 
contextPath=&quot;org.apache.camel.example&quot;/&gt;
-  &lt;/dataFormats&gt;
-
-  &lt;route&gt;
-    &lt;from uri=&quot;direct:start&quot;/&gt;
-    &lt;marshal ref=&quot;myJaxb&quot;/&gt;
-    &lt;to uri=&quot;direct:marshalled&quot;/&gt;
-  &lt;/route&gt;
-  &lt;route&gt;
-    &lt;from uri=&quot;direct:marshalled&quot;/&gt;
-    &lt;unmarshal ref=&quot;myJaxb&quot;/&gt;
-    &lt;to uri=&quot;mock:result&quot;/&gt;
-  &lt;/route&gt;
-
-&lt;/camelContext&gt;
-]]></script>
-</div></div><div class="confluence-information-macro 
confluence-information-macro-tip"><p class="title">Multiple context 
paths</p><span class="aui-icon aui-icon-small aui-iconfont-approve 
confluence-information-macro-icon"></span><div 
class="confluence-information-macro-body"><p>It is possible to use this data 
format with more than one context path. You can specify context path using 
<code>:</code> as separator, for example 
<code>com.mycompany:com.mycompany2</code>. Note that this is handled by JAXB 
implementation and might change if you use different vendor than 
RI.</p></div></div><h3 id="JAXB-Partialmarshalling/unmarshalling">Partial 
marshalling/unmarshalling</h3><p><strong>This feature is new to Camel 
2.2.0.</strong><br clear="none"> JAXB 2 supports marshalling and unmarshalling 
XML tree fragments. By default JAXB looks for <code>@XmlRootElement</code> 
annotation on given class to operate on whole XML tree. This is useful but not 
always - sometimes generated code does not have @X
 mlRootElement annotation, sometimes you need unmarshall only part of tree.<br 
clear="none"> In that case you can use partial unmarshalling. To enable this 
behaviours you need set property <code>partClass</code>. Camel will pass this 
class to JAXB's unmarshaler.</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[
-&lt;camelContext id=&quot;camel&quot; 
xmlns=&quot;http://camel.apache.org/schema/spring&quot;&gt;
-    &lt;route&gt;
-        &lt;from uri=&quot;direct:marshal&quot;/&gt;
-        &lt;marshal&gt;
-            &lt;jaxb prettyPrint=&quot;false&quot; 
contextPath=&quot;org.apache.camel.example&quot;
-                partClass=&quot;org.apache.camel.example.PurchaseOrder&quot;
-                fragment=&quot;true&quot;
-                partNamespace=&quot;{http://example.camel.org/apache}po&quot; 
/&gt;
-        &lt;/marshal&gt;
-        &lt;to uri=&quot;mock:marshal&quot;/&gt;
-    &lt;/route&gt;
-    &lt;route&gt;
-        &lt;from uri=&quot;direct:unmarshal&quot;/&gt;
-        &lt;unmarshal&gt;
-            &lt;jaxb prettyPrint=&quot;false&quot; 
contextPath=&quot;org.apache.camel.example&quot;
-                partClass=&quot;org.apache.camel.example.Partial&quot; /&gt;
-        &lt;/unmarshal&gt;
-        &lt;to uri=&quot;mock:unmarshal&quot;/&gt;
-    &lt;/route&gt;
-&lt;/camelContext&gt;
-]]></script>
-</div></div>For marshalling you have to add <code>partNamespace</code> 
attribute with QName of destination namespace. Example of Spring DSL you can 
find above.<h3 id="JAXB-Fragment">Fragment</h3><p><strong>This feature is new 
to Camel 2.8.0.</strong><br clear="none"> JaxbDataFormat has new property 
fragment which can set the the <code>Marshaller.JAXB_FRAGMENT</code> encoding 
property on the JAXB Marshaller. If you don't want the JAXB Marshaller to 
generate the XML declaration, you can set this option to be true. The default 
value of this property is false.</p><h3 
id="JAXB-IgnoringtheNonXMLCharacter">Ignoring the NonXML 
Character</h3><p><strong>This feature is new to Camel 2.2.0.</strong><br 
clear="none"> JaxbDataFromat supports to ignore the <a shape="rect" 
class="external-link" 
href="http://www.w3.org/TR/2004/REC-xml-20040204/#NT-Char"; 
rel="nofollow">NonXML Character</a>, you just need to set the filterNonXmlChars 
property to be true, JaxbDataFormat will replace the NonXML characte
 r with " " when it is marshaling or unmarshaling the message. You can also do 
it by setting the <a shape="rect" href="exchange.html">Exchange</a> property 
<code>Exchange.FILTER_NON_XML_CHARS</code>.</p><div class="table-wrap"><table 
class="confluenceTable"><tbody><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>&#160;</p></td><th colspan="1" rowspan="1" 
class="confluenceTh"><p>JDK 1.5</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>JDK 1.6+</p></th></tr><tr><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Filtering in use</p></th><td colspan="1" rowspan="1" 
class="confluenceTd"><p>StAX API and implementation</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>No</p></td></tr><tr><th colspan="1" 
rowspan="1" class="confluenceTh"><p>Filtering not in use</p></th><td 
colspan="1" rowspan="1" class="confluenceTd"><p>StAX API only</p></td><td 
colspan="1" rowspan="1" 
class="confluenceTd"><p>No</p></td></tr></tbody></table></div><p>This feature 
has been tested wi
 th Woodstox 3.2.9 and Sun JDK 1.6 StAX implementation.</p><p><strong>New for 
Camel 2.12.1</strong><br clear="none"> JaxbDataFormat now allows you to 
customize the XMLStreamWriter used to marshal the stream to XML. Using this 
configuration, you can add your own stream writer to completely remove, escape, 
or replace non-xml characters.</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[   JaxbDataFormat customWriterFormat = new 
JaxbDataFormat(&quot;org.apache.camel.foo.bar&quot;);
+  to("mqseries:Another.Queue");
+</plain-text-body><p>You can if you prefer use a named reference to a data 
format which can then be defined in your <a shape="rect" 
href="registry.html">Registry</a> such as via your <a shape="rect" 
href="spring.html">Spring</a> XML file. 
e.g.</p><plain-text-body>from("activemq:My.Queue").
+  unmarshal("myJaxbDataType").
+  to("mqseries:Another.Queue");
+</plain-text-body><h3 id="JAXB-UsingSpringXML">Using Spring XML</h3><p>The 
following example shows how to use JAXB to unmarshal using <a shape="rect" 
href="spring.html">Spring</a> configuring the jaxb data 
type<plain-text-body>{snippet:id=example|lang=xml|url=camel/trunk/components/camel-jaxb/src/test/resources/org/apache/camel/example/springDataFormat.xml}</plain-text-body>This
 example shows how to configure the data type just once and reuse it on 
multiple 
routes.<plain-text-body>{snippet:id=example|lang=xml|url=camel/trunk/components/camel-jaxb/src/test/resources/org/apache/camel/example/marshalAndUnmarshalWithRef.xml}</plain-text-body></p><parameter
 ac:name="title">Multiple context paths</parameter><rich-text-body><p>It is 
possible to use this data format with more than one context path. You can 
specify context path using <code>:</code> as separator, for example 
<code>com.mycompany:com.mycompany2</code>. Note that this is handled by JAXB 
implementation and might change if you use
  different vendor than RI.</p></rich-text-body><h3 
id="JAXB-Partialmarshalling/unmarshalling">Partial 
marshalling/unmarshalling</h3><p><strong>This feature is new to Camel 
2.2.0.</strong><br clear="none"> JAXB 2 supports marshalling and unmarshalling 
XML tree fragments. By default JAXB looks for <code>@XmlRootElement</code> 
annotation on given class to operate on whole XML tree. This is useful but not 
always - sometimes generated code does not have @XmlRootElement annotation, 
sometimes you need unmarshall only part of tree.<br clear="none"> In that case 
you can use partial unmarshalling. To enable this behaviours you need set 
property <code>partClass</code>. Camel will pass this class to JAXB's 
unmarshaler.<plain-text-body>{snippet:id=example|lang=xml|url=camel/trunk/components/camel-jaxb/src/test/resources/org/apache/camel/example/springDataFormatPartial.xml}</plain-text-body>For
 marshalling you have to add <code>partNamespace</code> attribute with QName of 
destination namespace. E
 xample of Spring DSL you can find above.</p><h3 
id="JAXB-Fragment">Fragment</h3><p><strong>This feature is new to Camel 
2.8.0.</strong><br clear="none"> JaxbDataFormat has new property fragment which 
can set the the <code>Marshaller.JAXB_FRAGMENT</code> encoding property on the 
JAXB Marshaller. If you don't want the JAXB Marshaller to generate the XML 
declaration, you can set this option to be true. The default value of this 
property is false.</p><h3 id="JAXB-IgnoringtheNonXMLCharacter">Ignoring the 
NonXML Character</h3><p><strong>This feature is new to Camel 2.2.0.</strong><br 
clear="none"> JaxbDataFromat supports to ignore the <a shape="rect" 
class="external-link" 
href="http://www.w3.org/TR/2004/REC-xml-20040204/#NT-Char"; 
rel="nofollow">NonXML Character</a>, you just need to set the filterNonXmlChars 
property to be true, JaxbDataFormat will replace the NonXML character with " " 
when it is marshaling or unmarshaling the message. You can also do it by 
setting the <a shape="rect" hre
 f="exchange.html">Exchange</a> property 
<code>Exchange.FILTER_NON_XML_CHARS</code>.</p><div class="table-wrap"><table 
class="confluenceTable"><tbody><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>&#160;</p></td><th colspan="1" rowspan="1" 
class="confluenceTh"><p>JDK 1.5</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>JDK 1.6+</p></th></tr><tr><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Filtering in use</p></th><td colspan="1" rowspan="1" 
class="confluenceTd"><p>StAX API and implementation</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>No</p></td></tr><tr><th colspan="1" 
rowspan="1" class="confluenceTh"><p>Filtering not in use</p></th><td 
colspan="1" rowspan="1" class="confluenceTd"><p>StAX API only</p></td><td 
colspan="1" rowspan="1" 
class="confluenceTd"><p>No</p></td></tr></tbody></table></div><p>This feature 
has been tested with Woodstox 3.2.9 and Sun JDK 1.6 StAX 
implementation.</p><p><strong>New for Camel 2.12.1</strong><br clear="none">
  JaxbDataFormat now allows you to customize the XMLStreamWriter used to 
marshal the stream to XML. Using this configuration, you can add your own 
stream writer to completely remove, escape, or replace non-xml 
characters.</p><parameter ac:name="language">java</parameter><plain-text-body>  
 JaxbDataFormat customWriterFormat = new 
JaxbDataFormat("org.apache.camel.foo.bar");
   customWriterFormat.setXmlStreamWriterWrapper(new TestXmlStreamWriter());
-]]></script>
-</div></div><p>The following example shows using the Spring DSL and also 
enabling Camel's NonXML filtering:</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[&lt;bean 
id=&quot;testXmlStreamWriterWrapper&quot; 
class=&quot;org.apache.camel.jaxb.TestXmlStreamWriter&quot;/&gt;
-&lt;jaxb filterNonXmlChars=&quot;true&quot;  
contextPath=&quot;org.apache.camel.foo.bar&quot; 
xmlStreamWriterWrapper=&quot;#testXmlStreamWriterWrapper&quot; /&gt;
-]]></script>
-</div></div><h3 id="JAXB-WorkingwiththeObjectFactory">Working with the 
ObjectFactory</h3><p>If you use XJC to create the java class from the schema, 
you will get an ObjectFactory for you JAXB context. Since the ObjectFactory 
uses <a shape="rect" class="external-link" 
href="http://java.sun.com/javase/6/docs/api/javax/xml/bind/JAXBElement.html"; 
rel="nofollow">JAXBElement</a> to hold the reference of the schema and element 
instance value, jaxbDataformat will ignore the JAXBElement by default and you 
will get the element instance value instead of the JAXBElement object form the 
unmarshaled message body. <br clear="none"> If you want to get the JAXBElement 
object form the unmarshaled message body, you need to set the JaxbDataFormat 
object's ignoreJAXBElement property to be false.</p><h3 
id="JAXB-Settingencoding">Setting encoding</h3><p>You can set the 
<strong>encoding</strong> option to use when marshalling. Its the 
<code>Marshaller.JAXB_ENCODING</code> encoding property on the JAXB Mars
 haller.<br clear="none"> You can setup which encoding to use when you declare 
the JAXB data format. You can also provide the encoding in the <a shape="rect" 
href="exchange.html">Exchange</a> property <code>Exchange.CHARSET_NAME</code>. 
This property will overrule the encoding set on the JAXB data format.</p><p>In 
this Spring DSL we have defined to use <code>iso-8859-1</code> as the 
encoding:</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[
-&lt;camelContext id=&quot;camel&quot; 
xmlns=&quot;http://camel.apache.org/schema/spring&quot;&gt;
-    &lt;route&gt;
-        &lt;from uri=&quot;direct:start&quot;/&gt;
-        &lt;marshal&gt;
-            &lt;jaxb prettyPrint=&quot;false&quot; 
encoding=&quot;iso-8859-1&quot; 
contextPath=&quot;org.apache.camel.example&quot;/&gt;
-        &lt;/marshal&gt;
-        &lt;to uri=&quot;mock:result&quot;/&gt;
-    &lt;/route&gt;
-&lt;/camelContext&gt;
-]]></script>
-</div></div><h3 id="JAXB-Controllingnamespaceprefixmapping">Controlling 
namespace prefix mapping</h3><p><strong>Available as of Camel 
2.11</strong></p><p>When marshalling using <a shape="rect" 
href="jaxb.html">JAXB</a> or <a shape="rect" href="soap.html">SOAP</a> then the 
JAXB implementation will automatic assign namespace prefixes, such as ns2, ns3, 
ns4 etc. To control this mapping, Camel allows you to refer to a map which 
contains the desired mapping.</p><p>Notice this requires having JAXB-RI 2.1 or 
better (from SUN) on the classpath, as the mapping functionality is dependent 
on the implementation of JAXB, whether its supported.</p><p>For example in 
Spring XML we can define a Map with the mapping. In the mapping file below, we 
map SOAP to use soap as prefix. While our custom namespace 
"http://www.mycompany.com/foo/2"; is not using any prefix.</p><div class="code 
panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[  &lt;util:map id=&quot;myMap&quot;&gt;
-    &lt;entry key=&quot;http://www.w3.org/2003/05/soap-envelope&quot; 
value=&quot;soap&quot;/&gt;
+</plain-text-body><p>The following example shows using the Spring DSL and also 
enabling Camel's NonXML filtering:</p><parameter 
ac:name="">xml</parameter><plain-text-body>&lt;bean 
id="testXmlStreamWriterWrapper" 
class="org.apache.camel.jaxb.TestXmlStreamWriter"/&gt;
+&lt;jaxb filterNonXmlChars="true"  contextPath="org.apache.camel.foo.bar" 
xmlStreamWriterWrapper="#testXmlStreamWriterWrapper" /&gt;
+</plain-text-body><h3 id="JAXB-WorkingwiththeObjectFactory">Working with the 
ObjectFactory</h3><p>If you use XJC to create the java class from the schema, 
you will get an ObjectFactory for you JAXB context. Since the ObjectFactory 
uses <a shape="rect" class="external-link" 
href="http://java.sun.com/javase/6/docs/api/javax/xml/bind/JAXBElement.html"; 
rel="nofollow">JAXBElement</a> to hold the reference of the schema and element 
instance value, jaxbDataformat will ignore the JAXBElement by default and you 
will get the element instance value instead of the JAXBElement object form the 
unmarshaled message body. <br clear="none"> If you want to get the JAXBElement 
object form the unmarshaled message body, you need to set the JaxbDataFormat 
object's ignoreJAXBElement property to be false.</p><h3 
id="JAXB-Settingencoding">Setting encoding</h3><p>You can set the 
<strong>encoding</strong> option to use when marshalling. Its the 
<code>Marshaller.JAXB_ENCODING</code> encoding property on the JAX
 B Marshaller.<br clear="none"> You can setup which encoding to use when you 
declare the JAXB data format. You can also provide the encoding in the <a 
shape="rect" href="exchange.html">Exchange</a> property 
<code>Exchange.CHARSET_NAME</code>. This property will overrule the encoding 
set on the JAXB data format.</p><p>In this Spring DSL we have defined to use 
<code>iso-8859-1</code> as the 
encoding:<plain-text-body>{snippet:id=example|lang=xml|url=camel/trunk/components/camel-jaxb/src/test/resources/org/apache/camel/example/springDataFormatWithEncoding.xml}</plain-text-body></p><h3
 id="JAXB-Controllingnamespaceprefixmapping">Controlling namespace prefix 
mapping</h3><p><strong>Available as of Camel 2.11</strong></p><p>When 
marshalling using <a shape="rect" href="jaxb.html">JAXB</a> or <a shape="rect" 
href="soap.html">SOAP</a> then the JAXB implementation will automatic assign 
namespace prefixes, such as ns2, ns3, ns4 etc. To control this mapping, Camel 
allows you to refer to a map whic
 h contains the desired mapping.</p><p>Notice this requires having JAXB-RI 2.1 
or better (from SUN) on the classpath, as the mapping functionality is 
dependent on the implementation of JAXB, whether its supported.</p><p>For 
example in Spring XML we can define a Map with the mapping. In the mapping file 
below, we map SOAP to use soap as prefix. While our custom namespace 
"http://www.mycompany.com/foo/2"; is not using any prefix.</p><parameter 
ac:name="">xml</parameter><plain-text-body>  &lt;util:map id="myMap"&gt;
+    &lt;entry key="http://www.w3.org/2003/05/soap-envelope"; value="soap"/&gt;
     &lt;!-- we dont want any prefix for our namespace --&gt;
-    &lt;entry key=&quot;http://www.mycompany.com/foo/2&quot; 
value=&quot;&quot;/&gt;
+    &lt;entry key="http://www.mycompany.com/foo/2"; value=""/&gt;
   &lt;/util:map&gt;
-]]></script>
-</div></div><p>To use this in <a shape="rect" href="jaxb.html">JAXB</a> or <a 
shape="rect" href="soap.html">SOAP</a> you refer to this map, using the 
<code>namespacePrefixRef</code> attribute as shown below. Then Camel will 
lookup in the <a shape="rect" href="registry.html">Registry</a> a 
<code>java.util.Map</code> with the id "myMap", which was what we defined 
above.</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[  &lt;marshal&gt;
-    &lt;soapjaxb version=&quot;1.2&quot; 
contextPath=&quot;com.mycompany.foo&quot; 
namespacePrefixRef=&quot;myMap&quot;/&gt;
+</plain-text-body><p>To use this in <a shape="rect" href="jaxb.html">JAXB</a> 
or <a shape="rect" href="soap.html">SOAP</a> you refer to this map, using the 
<code>namespacePrefixRef</code> attribute as shown below. Then Camel will 
lookup in the <a shape="rect" href="registry.html">Registry</a> a 
<code>java.util.Map</code> with the id "myMap", which was what we defined 
above.</p><parameter ac:name="">xml</parameter><plain-text-body>  
&lt;marshal&gt;
+    &lt;soapjaxb version="1.2" contextPath="com.mycompany.foo" 
namespacePrefixRef="myMap"/&gt;
   &lt;/marshal&gt;
-]]></script>
-</div></div><h3 id="JAXB-Schemavalidation">Schema 
validation</h3><p><strong>Available as of Camel 2.11</strong></p><p>The JAXB <a 
shape="rect" href="data-format.html">Data Format</a> supports validation by 
marshalling and unmarshalling from/to XML. Your can use the prefix 
<strong>classpath:</strong>, <strong>file:* or *http:</strong> to specify how 
the resource should by resolved. You can separate multiple schema files by 
using the <strong>','</strong> character.</p><div 
class="confluence-information-macro 
confluence-information-macro-information"><p class="title">Known issue</p><span 
class="aui-icon aui-icon-small aui-iconfont-info 
confluence-information-macro-icon"></span><div 
class="confluence-information-macro-body"><p>Camel 2.11.0 and 2.11.1 has a 
known issue by validation multiple <code>Exchange</code>'s in parallel. See <a 
shape="rect" class="external-link" 
href="https://issues.apache.org/jira/browse/CAMEL-6630";>CAMEL-6630</a>. This is 
fixed with Camel 2.11.2/2.12.0.</p></div
 ></div><p>Using the Java DSL, you can configure it in the following 
 >way:</p><div class="code panel pdl" style="border-width: 1px;"><div 
 >class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[JaxbDataFormat jaxbDataFormat = new 
JaxbDataFormat();
+</plain-text-body><h3 id="JAXB-Schemavalidation">Schema 
validation</h3><p><strong>Available as of Camel 2.11</strong></p><p>The JAXB <a 
shape="rect" href="data-format.html">Data Format</a> supports validation by 
marshalling and unmarshalling from/to XML. Your can use the prefix 
<strong>classpath:</strong>, <strong>file:* or *http:</strong> to specify how 
the resource should by resolved. You can separate multiple schema files by 
using the <strong>','</strong> character.</p><parameter ac:name="title">Known 
issue</parameter><rich-text-body><p>Camel 2.11.0 and 2.11.1 has a known issue 
by validation multiple <code>Exchange</code>'s in parallel. See <a shape="rect" 
class="external-link" 
href="https://issues.apache.org/jira/browse/CAMEL-6630";>CAMEL-6630</a>. This is 
fixed with Camel 2.11.2/2.12.0.</p></rich-text-body><p>Using the Java DSL, you 
can configure it in the following way:</p><parameter 
ac:name="">java</parameter><plain-text-body>JaxbDataFormat jaxbDataFormat = new 
JaxbDataFormat(
 );
 jaxbDataFormat.setContextPath(Person.class.getPackage().getName());
-jaxbDataFormat.setSchema(&quot;classpath:person.xsd,classpath:address.xsd&quot;);
-]]></script>
-</div></div><p>You can do the same using the XML DSL:</p><div class="code 
panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[&lt;marshal&gt;
-    &lt;jaxb id=&quot;jaxb&quot; 
schema=&quot;classpath:person.xsd,classpath:address.xsd&quot;/&gt;
+jaxbDataFormat.setSchema("classpath:person.xsd,classpath:address.xsd");
+</plain-text-body><p>You can do the same using the XML DSL:</p><parameter 
ac:name="">xml</parameter><plain-text-body>&lt;marshal&gt;
+    &lt;jaxb id="jaxb" schema="classpath:person.xsd,classpath:address.xsd"/&gt;
 &lt;/marshal&gt;
-]]></script>
-</div></div><p>Camel will create and pool the underling 
<code>SchemaFactory</code> instances on the fly, because the 
<code>SchemaFactory</code> shipped with the JDK is not thread safe.<br 
clear="none"> However, if you have a <code>SchemaFactory</code> implementation 
which is thread safe, you can configure the JAXB data format to use this 
one:</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[JaxbDataFormat jaxbDataFormat = new 
JaxbDataFormat();
+</plain-text-body><p>Camel will create and pool the underling 
<code>SchemaFactory</code> instances on the fly, because the 
<code>SchemaFactory</code> shipped with the JDK is not thread safe.<br 
clear="none"> However, if you have a <code>SchemaFactory</code> implementation 
which is thread safe, you can configure the JAXB data format to use this 
one:</p><parameter ac:name="">java</parameter><plain-text-body>JaxbDataFormat 
jaxbDataFormat = new JaxbDataFormat();
 jaxbDataFormat.setSchemaFactory(thradSafeSchemaFactory);
-]]></script>
-</div></div><h3 id="JAXB-SchemaLocation">Schema 
Location</h3><p><strong>Available as of Camel 2.14</strong></p><p>The 
JAXB&#160;<a shape="rect" href="data-format.html">Data Format</a>&#160;supports 
to specify the SchemaLocation when marshaling the XML.&#160;</p><p>Using the 
Java DSL, you can configure it in the following way:</p><div class="code panel 
pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[JaxbDataFormat jaxbDataFormat = new 
JaxbDataFormat();
+</plain-text-body><h3 id="JAXB-SchemaLocation">Schema 
Location</h3><p><strong>Available as of Camel 2.14</strong></p><p>The 
JAXB&#160;<a shape="rect" href="data-format.html">Data Format</a>&#160;supports 
to specify the SchemaLocation when marshaling the XML.&#160;</p><p>Using the 
Java DSL, you can configure it in the following way:</p><parameter 
ac:name="">java</parameter><plain-text-body>JaxbDataFormat jaxbDataFormat = new 
JaxbDataFormat();
 jaxbDataFormat.setContextPath(Person.class.getPackage().getName());
-jaxbDataFormat.setSchemaLocation(&quot;schema/person.xsd&quot;);
-]]></script>
-</div></div><p>You can do the same using the XML DSL:</p><div class="code 
panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[&lt;marshal&gt;
-    &lt;jaxb id=&quot;jaxb&quot; 
schemaLocation=&quot;schema/person.xsd&quot;/&gt;
-&lt;/marshal&gt;]]></script>
-</div></div><h3 id="JAXB-MarshaldatathatisalreadyXML">Marshal data that is 
already XML</h3><p><strong>Available as of Camel 2.14.1</strong></p><div>The 
JAXB marshaller requires that the message body is JAXB compatible, eg its a 
JAXBElement, eg a java instance that has JAXB annotations, or extend 
JAXBElement. There can be situations where the message body is already in XML, 
eg from a String type. There is a new 
option&#160;<code>mustBeJAXBElement</code> you can set to false, to relax this 
check, so the JAXB marshaller only attempts to marshal JAXBElements 
(javax.xml.bind.JAXBIntrospector#isElement returns true). And in those 
situations the marshaller fallbacks to marshal the message body 
as-is.</div><div><h3 id="JAXB-XmlRootElementobjects"><span style="color: 
rgb(51,51,51);">XmlRootElement objects</span></h3><p><strong>Available as of 
Camel 2.17.2</strong></p><p>The JAXB <a shape="rect" 
href="data-format.html">Data Format</a> option objectFactory has a default 
value equals to false. 
 This is related to a performance degrading. For more information look at the 
issue <a shape="rect" class="external-link" 
href="https://issues.apache.org/jira/browse/CAMEL-10043";>CAMEL-10043</a></p><p>For
 the marshalling of <span style="color: rgb(51,51,51);">non-XmlRootElement JaxB 
objects</span> you'll need to <span style="color: rgb(51,51,51);">call 
JaxbDataFormat#setObjectFactory(true)</span></p></div><h3 
id="JAXB-Dependencies">Dependencies</h3><p>To use JAXB in your camel routes you 
need to add the a dependency on <strong>camel-jaxb</strong> which implements 
this data format.</p><p>If you use maven you could just add the following to 
your pom.xml, substituting the version number for the latest &amp; greatest 
release (see <a shape="rect" href="download.html">the download page for the 
latest versions</a>).</p><div class="code panel pdl" style="border-width: 
1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[&lt;dependency&gt;
+jaxbDataFormat.setSchemaLocation("schema/person.xsd");
+</plain-text-body><p>You can do the same using the XML DSL:</p><parameter 
ac:name="">xml</parameter><plain-text-body>&lt;marshal&gt;
+    &lt;jaxb id="jaxb" schemaLocation="schema/person.xsd"/&gt;
+&lt;/marshal&gt;</plain-text-body><h3 
id="JAXB-MarshaldatathatisalreadyXML">Marshal data that is already 
XML</h3><p><strong>Available as of Camel 2.14.1</strong></p><div>The JAXB 
marshaller requires that the message body is JAXB compatible, eg its a 
JAXBElement, eg a java instance that has JAXB annotations, or extend 
JAXBElement. There can be situations where the message body is already in XML, 
eg from a String type. There is a new 
option&#160;<code>mustBeJAXBElement</code> you can set to false, to relax this 
check, so the JAXB marshaller only attempts to marshal JAXBElements 
(javax.xml.bind.JAXBIntrospector#isElement returns true). And in those 
situations the marshaller fallbacks to marshal the message body 
as-is.</div><div><h3 id="JAXB-XmlRootElementobjects"><span style="color: 
rgb(51,51,51);">XmlRootElement objects</span></h3><p><strong>Available as of 
Camel 2.17.2</strong></p><p>The JAXB <a shape="rect" 
href="data-format.html">Data Format</a> option objectFactory has a default v
 alue equals to false. This is related to a performance degrading. For more 
information look at the issue <a shape="rect" class="external-link" 
href="https://issues.apache.org/jira/browse/CAMEL-10043";>CAMEL-10043</a></p><p>For
 the marshalling of <span style="color: rgb(51,51,51);">non-XmlRootElement JaxB 
objects</span> you'll need to <span style="color: rgb(51,51,51);">call 
JaxbDataFormat#setObjectFactory(true)</span></p></div><h3 
id="JAXB-Dependencies">Dependencies</h3><p>To use JAXB in your camel routes you 
need to add the a dependency on <strong>camel-jaxb</strong> which implements 
this data format.</p><p>If you use maven you could just add the following to 
your pom.xml, substituting the version number for the latest &amp; greatest 
release (see <a shape="rect" href="download.html">the download page for the 
latest versions</a>).</p><plain-text-body>&lt;dependency&gt;
   &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
   &lt;artifactId&gt;camel-jaxb&lt;/artifactId&gt;
   &lt;version&gt;x.x.x&lt;/version&gt;
 &lt;/dependency&gt;
-]]></script>
-</div></div></div>
+</plain-text-body></div>
         </td>
         <td valign="top">
           <div class="navigation">


Reply via email to