You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by bu...@apache.org on 2016/03/28 15:18:50 UTC

svn commit: r984035 - in /websites/production/camel/content: cache/main.pageCache spring-java-config.html

Author: buildbot
Date: Mon Mar 28 13:18:50 2016
New Revision: 984035

Log:
Production update by buildbot for camel

Modified:
    websites/production/camel/content/cache/main.pageCache
    websites/production/camel/content/spring-java-config.html

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

Modified: websites/production/camel/content/spring-java-config.html
==============================================================================
--- websites/production/camel/content/spring-java-config.html (original)
+++ websites/production/camel/content/spring-java-config.html Mon Mar 28 13:18:50 2016
@@ -86,39 +86,15 @@
 	<tbody>
         <tr>
         <td valign="top" width="100%">
-<div class="wiki-content maincontent"><h2 id="SpringJavaConfig-SpringJavaConfig">Spring Java Config</h2>
-
-<p><a shape="rect" href="spring.html">Spring</a> started life using XML Config to wire beans together. However some folks don't like using XML and would rather use Java code which led to the creation of <a shape="rect" href="guice.html">Guice</a> along with the <a shape="rect" class="external-link" href="http://www.springsource.org/javaconfig" rel="nofollow">Spring JavaConfig</a> project.</p>
-
-<p>You can use either the XML or Java config approachs with Camel; its your choice really on which you prefer.</p>
-
-<p><strong>NOTE:</strong> From Camel 2.2.0 camel-spring-javaconfig is moved to Spring 3.x, which means you can't run it with spring 2.x.</p>
-
-<h3 id="SpringJavaConfig-UsingSpringJavaConfig">Using Spring Java Config</h3>
-
-<p>To use Spring Java Config in your Camel project the easiest thing to do is add the following to your pom.xml</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="SpringJavaConfig-SpringJavaConfig">Spring Java Config</h2><p><a shape="rect" href="spring.html">Spring</a> started life using XML Config to wire beans together. However some folks don't like using XML and would rather use Java code which led to the creation of Guice along with the Spring JavaConfig project.</p><p>You can use either the XML or Java config approaches with Camel; its your choice really on which you prefer.</p><h3 id="SpringJavaConfig-UsingSpringJavaConfig">Using Spring Java Config</h3><p>To use Spring Java Config in your Camel project the easiest thing to do is add the following to your pom.xml</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;
   &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
   &lt;artifactId&gt;camel-spring-javaconfig&lt;/artifactId&gt;
   &lt;version&gt;${camel-version}&lt;/version&gt;
 &lt;/dependency&gt;
 ]]></script>
-</div></div>
-
-<p>This will then add the dependencies on the Spring JavaConfig library along with some helper classes for configuring Camel inside Spring.</p>
-
-<p>Note that this library is totally optional; you could just wire Camel together yourself with Java Config.</p>
-
-<h3 id="SpringJavaConfig-Configuration">Configuration</h3>
-
-<p>The most common case of using JavaConfig with Camel would be to create configuration with defined list of routes to be used by router.</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[
-@Configuration
+</div></div><p>This will then add the dependencies on the Spring JavaConfig library along with some helper classes for configuring Camel inside Spring.</p><p>Note that this library is totally optional; you could just wire Camel together yourself with Java Config.</p><h3 id="SpringJavaConfig-Configuration">Configuration</h3><p>The most common case of using JavaConfig with Camel would be to create configuration with defined list of routes to be used by router.</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[@Configuration
 public class MyRouteConfiguration extends CamelConfiguration {
 
     @Autowire
@@ -134,24 +110,13 @@ public class MyRouteConfiguration extend
 
 }
 ]]></script>
-</div></div>
-
-<p>Starting from Camel 2.13.0 you can skip the <strong>routes()</strong> definition, and fall back to the <strong>RouteBuilder</strong> instances located in the Spring context.</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[
-@Configuration
+</div></div><p>Starting from Camel 2.13.0 you can skip the <strong>routes()</strong> definition, and fall back to the <strong>RouteBuilder</strong> instances located in the Spring context.</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[@Configuration
 @ComponentScan(&quot;com.example.routes&quot;)
 public class MyRouteConfiguration extends CamelConfiguration {
 }
 ]]></script>
-</div></div>
-
-<h3 id="SpringJavaConfig-Testing">Testing</h3>
-
-<p>Since <strong>Camel 2.11.0</strong> you can use the <code>CamelSpringJUnit4ClassRunner</code> with <code>CamelSpringDelegatingTestContextLoader</code>. This is the recommended way to test Java Config and Camel integration.</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="SpringJavaConfig-Testing">Testing</h3><p>Since <strong>Camel 2.11.0</strong> you can use the <code>CamelSpringJUnit4ClassRunner</code> with <code>CamelSpringDelegatingTestContextLoader</code>. This is the recommended way to test Java Config and Camel integration.</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[
 // tag::example[]
 @RunWith(CamelSpringJUnit4ClassRunner.class)
@@ -202,13 +167,7 @@ public class CamelSpringDelegatingTestCo
 }
 // end::example[]
 ]]></script>
-</div></div>
-
-<p>If you wish to create a collection of <strong>RouteBuilder</strong> instances then derive from the <strong>CamelConfiguration</strong> helper class and implement the <strong>routes()</strong> method. Keep in mind that (starting from the Camel 2.13.0) if you don't override <strong>routes()</strong> method, then <strong>CamelConfiguration</strong> will use all <strong>RouteBuilder</strong> instances available in the Spring context.</p>
-
-<p>The following <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-spring-javaconfig/src/test/java/org/apache/camel/spring/javaconfig/patterns/FilterTest.java">example using Java Config</a> demonstrates how to test Java Config integration with Camel 2.10 and lower. Keep in mind that <code>JavaConfigContextLoader</code> is deprecated and could be removed in the future versions of Camel on the behalf of the <code>CamelSpringDelegatingTestContextLoader</code>.</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div>If you wish to create a collection of <strong>RouteBuilder</strong> instances then derive from the <strong>CamelConfiguration</strong> helper class and implement the <strong>routes()</strong> method. Keep in mind that (starting from the Camel 2.13.0) if you don't override <strong>routes()</strong> method, then <strong>CamelConfiguration</strong> will use all <strong>RouteBuilder</strong> instances available in the Spring context.<p>The following <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-spring-javaconfig/src/test/java/org/apache/camel/spring/javaconfig/patterns/FilterTest.java">example using Java Config</a> demonstrates how to test Java Config integration with Camel 2.10 and lower. Keep in mind that <code>JavaConfigContextLoader</code> is deprecated and could be removed in the future versions of Camel on the behalf of the <code>CamelSpringDelegatingTestContextLoader</code>.</p><div class="code panel pdl" styl
 e="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
 // tag::example[]
 @RunWith(CamelSpringJUnit4ClassRunner.class)
@@ -257,9 +216,7 @@ public class FilterTest extends Abstract
 }
 // end::example[]
 ]]></script>
-</div></div>
-
-<p>The <strong>@ContextConfiguration</strong> annotation tells the <a shape="rect" href="spring-testing.html">Spring Testing</a> framework to load the <strong>ContextConfig</strong> class as the configuration to use. This class derives from <strong>SingleRouteCamelConfiguration</strong> which is a helper Spring Java Config class which will configure the CamelContext for us and then register the RouteBuilder we create.</p></div>
+</div></div>The <strong>@ContextConfiguration</strong> annotation tells the <a shape="rect" href="spring-testing.html">Spring Testing</a> framework to load the <strong>ContextConfig</strong> class as the configuration to use. This class derives from <strong>SingleRouteCamelConfiguration</strong> which is a helper Spring Java Config class which will configure the CamelContext for us and then register the RouteBuilder we create.</div>
         </td>
         <td valign="top">
           <div class="navigation">