camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ringe (Confluence)" <conflue...@apache.org>
Subject [CONF] Apache Camel > camel-jboss
Date Fri, 01 Nov 2013 16:48:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/de/2176/1/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/~caringe">Carsten
Ringe</a>
    </h4>
        <div id="versionComment">
        <b>Kommentar:</b>
        Fixed package names for JBossPackageScanClassResolver - my first edit on camel docs
<img class="emoticon" src="/confluence/images/icons/emoticons/smile.gif" height="20" width="20"
align="absmiddle" alt="" border="0"/><br />
    </div>
        <br/>
                         <h4>Changes (2)</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" >{info} <br> <br></td></tr>
            <tr><td class="diff-changed-lines" >The resolver is provided in the
class <span class="diff-changed-words">{{org.apache<span class="diff-added-chars"style="background-color:
#dfd;">extras</span>.camel.jboss.JBossPackageScanClassResolver}}</span> in
the {{camel-jboss}} jar file. <br></td></tr>
            <tr><td class="diff-unchanged" > <br>{info:title=Camel 2.8 onwards}
<br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" > <br>{code:xml} <br></td></tr>
            <tr><td class="diff-changed-lines" >&lt;bean id=&quot;jbossResolver&quot;
<span class="diff-changed-words">class=&quot;org.apache<span class="diff-added-chars"style="background-color:
#dfd;">e</span>xtra<span class="diff-added-chars"style="background-color: #dfd;">s</span>.camel.jboss.JBossPackageScanClassResolver&quot;/&gt;</span>
<br></td></tr>
            <tr><td class="diff-unchanged" > <br>  &lt;camelContext
id=&quot;camel&quot; xmlns=&quot;http://camel.apache.org/schema/spring&quot;&gt;
<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 4.x/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.apacheextras.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>.<br/>
One exception is if you are using <a href="/confluence/display/CAMEL/Bindy" title="Bindy">Bindy</a>
component as it still needs this JBoss resolver.</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="theme: Default; brush: java; gutter: false" style="font-size:12px; font-family:
ConfluenceInstalledFont,monospace;">
  PackageScanClassResolver jbossResolver = new JBossPackageScanClassResolver();

  CamelContext context = new 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="theme: Default; brush: xml; gutter: false" style="font-size:12px; font-family:
ConfluenceInstalledFont,monospace;">
   &lt;bean id="jbossResolver" class="org.apacheextras.camel.jboss.JBossPackageScanClassResolver"/&gt;

  &lt;camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"&gt;
    &lt;route&gt;
      &lt;from uri="seda:start"/&gt;
      &lt;to uri="mock:result"/&gt;
    &lt;/route&gt;
  &lt;/camelContext&gt;
</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="theme: Default; brush: xml; gutter: false" style="font-size:12px; font-family:
ConfluenceInstalledFont,monospace;">
   &lt;bean id="jbossResolver" class="org.apache.camel.jboss.JBossPackageScanClassResolver"/&gt;
</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;" class="grey">
                        <a href="https://cwiki.apache.org/confluence/users/removespacenotification.action?spaceKey=CAMEL">Stop
watching space</a>
            <span style="padding: 0px 5px;">|</span>
                <a href="https://cwiki.apache.org/confluence/users/editmyemailsettings.action">Change
email 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=8&originalVersion=7">View
Changes</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message