camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Camel > camel-jboss
Date Sun, 17 Jul 2011 07:57:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2042/9/1/_/styles/combined.css?spaceKey=CAMEL&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/CAMEL/camel-jboss">camel-jboss</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~davsclaus">Claus
Ibsen</a>
    </h4>
        <br/>
                         <h4>Changes (1)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >The resolver is provided in the class
{{org.apache.camel.jboss.JBossPackageScanClassResolver}} in the {{camel-jboss}} jar file.
<br> <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">{info:title=Camel
2.8 onwards} <br>From *Camel 2.8* onwards there is no longer the need for using this
[camel-jboss] component as Camel is now capable of loading type converters without package
scanning. This requires though that all 3rd party components with type converter must define
the name of the converter classes as FQN in the {{META-INF/org/apache/camel/TypeConverter}}
file. See more details at [Type Converter]. <br>{info} <br> <br></td></tr>
            <tr><td class="diff-unchanged" >h3. Using with Java DSL <br>
<br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h2><a name="camel-jboss-cameljboss"></a>camel-jboss</h2>
<p><b>Available as of Camel 2.1</b></p>

<p>The <a href="/confluence/display/CAMEL/camel-jboss" title="camel-jboss">camel&#45;jboss</a>
is a component which allows you to run Camel inside JBoss Application Server. This component
is needed due JBoss classloading challenges.<br/>
The component is a specialized Camel <a href="/confluence/display/CAMEL/Pluggable+Class+Resolvers"
title="Pluggable Class Resolvers">Pluggable Class Resolvers</a> to remedy this.</p>

<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td
valign='top'><img src="/confluence/images/icons/emoticons/information.gif" width="16"
height="16" align="absmiddle" alt="" border="0"></td><td><b>JBoss version</b><br
/>If you are using JBoss 5.x then you need to use <tt>camel-jboss</tt> JAR.
If you are using JBoss 6.x then you need to use <tt>camel-jboss6</tt> JAR.</td></tr></table></div>

<p>The resolver is provided in the class <tt>org.apache.camel.jboss.JBossPackageScanClassResolver</tt>
in the <tt>camel-jboss</tt> jar file.</p>

<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td
valign='top'><img src="/confluence/images/icons/emoticons/information.gif" width="16"
height="16" align="absmiddle" alt="" border="0"></td><td><b>Camel 2.8
onwards</b><br />From <b>Camel 2.8</b> onwards there is no longer
the need for using this <a href="/confluence/display/CAMEL/camel-jboss" title="camel-jboss">camel&#45;jboss</a>
component as Camel is now capable of loading type converters without package scanning. This
requires though that all 3rd party components with type converter must define the name of
the converter classes as FQN in the <tt>META-INF/org/apache/camel/TypeConverter</tt>
file. See more details at <a href="/confluence/display/CAMEL/Type+Converter" title="Type
Converter">Type Converter</a>.</td></tr></table></div>

<h3><a name="camel-jboss-UsingwithJavaDSL"></a>Using with Java DSL</h3>

<p>You need to configure the resolver on the <a href="/confluence/display/CAMEL/CamelContext"
title="CamelContext">CamelContext</a> which is done like this:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
  PackageScanClassResolver jbossResolver = <span class="code-keyword">new</span>
JBossPackageScanClassResolver();

  CamelContext context = <span class="code-keyword">new</span> DefaultCamelContext();
  context.setPackageScanClassResolver(jbossResolver);
</pre>
</div></div> 

<h3><a name="camel-jboss-UsingwithSpringXML"></a>Using with Spring XML</h3>

<p>When using Spring XML its just a matter of defining a spring bean with the JBoss
class resolver as shown:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
   <span class="code-tag">&lt;bean id=<span class="code-quote">"jbossResolver"</span>
class=<span class="code-quote">"org.apachextra.camel.jboss.JBossPackageScanClassResolver"</span>/&gt;</span>

  <span class="code-tag">&lt;camelContext id=<span class="code-quote">"camel"</span>
xmlns=<span class="code-quote">"http://camel.apache.org/schema/spring"</span>&gt;</span>
    <span class="code-tag">&lt;route&gt;</span>
      <span class="code-tag">&lt;from uri=<span class="code-quote">"seda:start"</span>/&gt;</span>
      <span class="code-tag">&lt;to uri=<span class="code-quote">"mock:result"</span>/&gt;</span>
    <span class="code-tag">&lt;/route&gt;</span>
  <span class="code-tag">&lt;/camelContext&gt;</span>
</pre>
</div></div>

<p>The <a href="http://camel-extra.googlecode.com/" class="external-link" rel="nofollow">Camel
Extra</a> project was moved to an official associated Apache site and as part of the
migration the package names in the source code must not use <tt>org.apache</tt>
so we renamed the packages as shown above. But if you are using the older versions of the
JAR files then you need to use as shown below:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
   <span class="code-tag">&lt;bean id=<span class="code-quote">"jbossResolver"</span>
class=<span class="code-quote">"org.apache.camel.jboss.JBossPackageScanClassResolver"</span>/&gt;</span>
</pre>
</div></div>

<h3><a name="camel-jboss-Dependencies"></a>Dependencies</h3>

<p>You need to get the component from the <a href="http://camel-extra.googlecode.com/"
class="external-link" rel="nofollow">Camel Extra</a> project as JBoss uses <b>LPGL</b>
license which cannot be hosted at Apache.</p>
    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/CAMEL/camel-jboss">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=11469386&revisedVersion=5&originalVersion=4">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/CAMEL/camel-jboss?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message