camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Camel > Creating a new Camel Component
Date Tue, 25 Oct 2011 09:15: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/Creating+a+new+Camel+Component">Creating
a new Camel Component</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~iocanel">Ioannis
Canellos</a>
    </h4>
        <div id="versionComment">
        <b>Comment:</b>
        Updated the documentation of the component archetype to describe the new archetype
properties.<br />
    </div>
        <br/>
                         <h4>Changes (2)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h2.
<br> <br> <br>h2. <br> <br> <br></td></tr>
            <tr><td class="diff-unchanged" >h2. Creating a new Camel Component
<br> <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >  -DarchetypeVersion=2.2.0  \ <br>
 -DgroupId=myGroupId                  \ <br></td></tr>
            <tr><td class="diff-unchanged" >  -DartifactId=myArtifactId <br></td></tr>
            <tr><td class="diff-unchanged" >{code} <br> <br>This will
create a maven project which contains a demo component, you need to implements your own component
by modifying it.You need to move the META-INF/services/direct file to META-INF/services/PACKAGE_NAME/FOO
where FOO is the URI scheme for your component and any related endpoints created on the fly
and PACKAGE_NAME is your component&#39;s package name which is replaced the &#39;.&#39;
with &#39;/&#39;. <br> <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h4.
Optional properties (available as of Camel 2.9.0) <br> <br>By default the camel
component archetype will generate a HelloWorldComponent that will use the URI scheme helloworld.
You can further customize the generated component by using some custom parameters passed to
the component. <br>|| Name || Default || Description || <br>| name | HelloWorld
| The name of the component. It will be used as a prefix for all generated classes. | <br>|
scheme | helloworld | The default URI scheme the component will use. | <br> <br>h4.
Usage Examples: <br> <br>{code} <br>mvn archetype:generate             
     \ <br>  -DarchetypeGroupId=org.apache.camel.archetypes  \ <br>  -DarchetypeArtifactId=camel-archetype-component
\ <br>  -DarchetypeVersion=2.2.0  \ <br>  -DgroupId=myGroupId                
 \ <br>  -DartifactId=myArtifactId  \ <br>  -Dname=Awesome             \ <br>
 -Dscheme=awsome            \ <br> <br>{code} <br> <br></td></tr>
            <tr><td class="diff-unchanged" >For more help see [Writing Components]
<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h2><a name="CreatinganewCamelComponent-"></a></h2>


<h2><a name="CreatinganewCamelComponent-"></a></h2>


<h2><a name="CreatinganewCamelComponent-CreatinganewCamelComponent"></a>Creating
a new Camel Component</h2>

<p>If you want to create your own version of the <a href="/confluence/pages/createpage.action?spaceKey=CAMEL&amp;title=Camel+Component&amp;linkCreation=true&amp;fromPageId=79286"
class="createlink">Camel Component</a> you can use the maven archetype.</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
mvn archetype:generate                   \
  -DarchetypeGroupId=org.apache.camel.archetypes  \
  -DarchetypeArtifactId=camel-archetype-component \
  -DarchetypeVersion=2.2.0  \
  -DgroupId=myGroupId                  \
  -DartifactId=myArtifactId
</pre>
</div></div>

<p>This will create a maven project which contains a demo component, you need to implements
your own component by modifying it.You need to move the META-INF/services/direct file to META-INF/services/PACKAGE_NAME/FOO
where FOO is the URI scheme for your component and any related endpoints created on the fly
and PACKAGE_NAME is your component's package name which is replaced the '.' with '/'.</p>

<h4><a name="CreatinganewCamelComponent-Optionalproperties%28availableasofCamel2.9.0%29"></a>Optional
properties (available as of Camel 2.9.0)</h4>

<p>By default the camel component archetype will generate a HelloWorldComponent that
will use the URI scheme helloworld. You can further customize the generated component by using
some custom parameters passed to the component.</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Name </th>
<th class='confluenceTh'> Default </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> name </td>
<td class='confluenceTd'> HelloWorld </td>
<td class='confluenceTd'> The name of the component. It will be used as a prefix for
all generated classes. </td>
</tr>
<tr>
<td class='confluenceTd'> scheme </td>
<td class='confluenceTd'> helloworld </td>
<td class='confluenceTd'> The default URI scheme the component will use. </td>
</tr>
</tbody></table>
</div>


<h4><a name="CreatinganewCamelComponent-UsageExamples%3A"></a>Usage Examples:</h4>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
mvn archetype:generate                   \
  -DarchetypeGroupId=org.apache.camel.archetypes  \
  -DarchetypeArtifactId=camel-archetype-component \
  -DarchetypeVersion=2.2.0  \
  -DgroupId=myGroupId                  \
  -DartifactId=myArtifactId  \
  -Dname=Awesome             \
  -Dscheme=awsome            \
  
</pre>
</div></div>

<p>For more help see <a href="/confluence/display/CAMEL/Writing+Components" title="Writing
Components">Writing Components</a></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/Creating+a+new+Camel+Component">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=79286&revisedVersion=5&originalVersion=4">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/CAMEL/Creating+a+new+Camel+Component?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message