Author: chirino
Date: Wed Jan 17 11:08:28 2007
New Revision: 497127
URL: http://svn.apache.org/viewvc?view=rev&rev=497127
Log:
Latest export from confluence
Modified:
incubator/servicemix/site/hello-world-bc.html
Modified: incubator/servicemix/site/hello-world-bc.html
URL:
http://svn.apache.org/viewvc/incubator/servicemix/site/hello-world-bc.html?view=diff&rev=497127&r1=497126&r2=497127
==============================================================================
--- incubator/servicemix/site/hello-world-bc.html (original)
+++ incubator/servicemix/site/hello-world-bc.html Wed Jan 17 11:08:28 2007
@@ -371,83 +371,7 @@
<P>This command should produce the following output: </P>
<DIV class="preformatted"><DIV class="preformattedContent">
-<PRE>[INFO] Scanning for projects...
-[INFO] artifact org.apache.servicemix.tooling:jbi-maven-plugin: checking for
updates from apache.incubating
-[INFO]
----------------------------------------------------------------------------
-[INFO] Building A custom project
-[INFO] task-segment: [install]
-[INFO]
----------------------------------------------------------------------------
-[INFO] artifact org.apache.maven.plugins:maven-install-plugin: checking for
updates from apache.incubating
-Downloading:
http://people.apache.org/repo/m2-incubating-repository/xml-security/xmlsec/1.3.0/xmlsec-1.3.0.pom
-[WARNING] Unable to get resource from repository apache.incubating
(http://people.apache.org/repo/m2-incubating-repository)
-Downloading:
http://repo.mergere.com/maven2/xml-security/xmlsec/1.3.0/xmlsec-1.3.0.pom
-[WARNING] Unable to get resource from repository central
(http://repo1.maven.org/maven2)
-Downloading:
http://people.apache.org/repo/m2-incubating-repository/wss4j/wss4j/1.5.0/wss4j-1.5.0.pom
-[WARNING] Unable to get resource from repository apache.incubating
(http://people.apache.org/repo/m2-incubating-repository)
-Downloading: http://repo.mergere.com/maven2/wss4j/wss4j/1.5.0/wss4j-1.5.0.pom
-[WARNING] Unable to get resource from repository central
(http://repo1.maven.org/maven2)
-[INFO] [xbean:mapping {execution: default}]
-Checking: org.apache.servicemix.samples.helloworld.MyComponent
-Checking: org.apache.servicemix.samples.helloworld.MyConsumerEndpoint
-Checking: org.apache.servicemix.samples.helloworld.MyProviderEndpoint
-[INFO] Generating META-INF properties file:
/Users/bsnyder/src/hello-world-smx/hello-world-bc-su/target/xbean/META-INF/services/org/apache/xbean/spring/http/
-org.apache.servicemix.samples.helloworld/1.0 for namespace:
http://org.apache.servicemix.samples.helloworld/1.0
-[INFO] Generating Spring 2.0 handler mapping:
/Users/bsnyder/src/hello-world-smx/hello-world-bc-su/target/xbean/META-INF/spring.handlers
-for namespace: http://org.apache.servicemix.samples.helloworld/1.0
-[INFO] Generating Spring 2.0 schema mapping:
/Users/bsnyder/src/hello-world-smx/hello-world-bc-su/target/xbean/META-INF/spring.schemas
-for namespace: http://org.apache.servicemix.samples.helloworld/1.0
-[INFO] Generating HTML documentation file:
/Users/bsnyder/src/hello-world-smx/hello-world-bc-su/target/xbean/hello-world-bc-su.xsd.html
-for namespace: http://org.apache.servicemix.samples.helloworld/1.0[INFO]
Generating XSD file:
-/Users/bsnyder/src/hello-world-smx/hello-world-bc-su/target/xbean/hello-world-bc-su.xsd
-for namespace: http://org.apache.servicemix.samples.helloworld/1.0
-[INFO] Generating WIKI documentation file:
/Users/bsnyder/src/hello-world-smx/hello-world-bc-su/target/xbean/hello-world-bc-su.xsd.wiki
-for namespace: http://org.apache.servicemix.samples.helloworld/1.0Warning,
could not load class: org.apache.servicemix.samples.helloworld.MyEndpointType:
java.lang.ClassNotFoundException:
org.apache.servicemix.samples.helloworld.MyEndpointType
-[INFO] ...done.
-[INFO] [jbi:generate-jbi-component-descriptor]
-[INFO] Generating jbi.xml
-[INFO] [resources:resources]
-[INFO] Using default encoding to copy filtered resources.
-[INFO] [compiler:compile]
-Compiling 5 source files to
/Users/bsnyder/src/hello-world-smx/hello-world-bc-su/target/classes
-[INFO] [resources:testResources]
-[INFO] Using default encoding to copy filtered resources.
-[INFO] [compiler:testCompile]
-Compiling 1 source file to
/Users/bsnyder/src/hello-world-smx/hello-world-bc-su/target/test-classes
-[INFO] [surefire:test]
-[INFO] Surefire report directory:
/Users/bsnyder/src/hello-world-smx/hello-world-bc-su/target/surefire-reports
-
--------------------------------------------------------
- T E S T S
--------------------------------------------------------
-Running org.apache.servicemix.samples.helloworld.MySpringComponentTest
-log4j:WARN No appenders could be found for logger
(org.springframework.core.CollectionFactory).
-log4j:WARN Please initialize the log4j system properly.
-Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.52 sec
-
-Results :
-Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
-
-[INFO] [jar:jar]
-[INFO] Building jar:
/Users/bsnyder/src/hello-world-smx/hello-world-bc-su/target/hello-world-bc-su-1.0-SNAPSHOT.jar
-[INFO] [jbi:jbi-component]
-[INFO] Generating installer
/Users/bsnyder/src/hello-world-smx/hello-world-bc-su/target/hello-world-bc-su-1.0-SNAPSHOT-installer.zip
-[INFO] Building jar:
/Users/bsnyder/src/hello-world-smx/hello-world-bc-su/target/hello-world-bc-su-1.0-SNAPSHOT-installer.zip
-[INFO] [install:install]
-[INFO] Installing
/Users/bsnyder/src/hello-world-smx/hello-world-bc-su/target/hello-world-bc-su-1.0-SNAPSHOT.jar
to
-/Users/bsnyder/.m2/repository/org/apache/servicemix/samples/helloworld/hello-world-bc-su/1.0-SNAPSHOT/hello-world-bc-su-1.0-SNAPSHOT.jar
-[INFO] Installing
/Users/bsnyder/src/hello-world-smx/hello-world-bc-su/target/xbean/hello-world-bc-su.xsd
to
-/Users/bsnyder/.m2/repository/org/apache/servicemix/samples/helloworld/hello-world-bc-su/1.0-SNAPSHOT/hello-world-bc-su-1.0-SNAPSHOT.xsd
-[INFO] Installing
/Users/bsnyder/src/hello-world-smx/hello-world-bc-su/target/xbean/hello-world-bc-su.xsd.html
to
-/Users/bsnyder/.m2/repository/org/apache/servicemix/samples/helloworld/hello-world-bc-su/1.0-SNAPSHOT/hello-world-bc-su-1.0-SNAPSHOT-schema.html
-[INFO] Installing
/Users/bsnyder/src/hello-world-smx/hello-world-bc-su/target/hello-world-bc-su-1.0-SNAPSHOT-installer.zip
to
-/Users/bsnyder/.m2/repository/org/apache/servicemix/samples/helloworld/hello-world-bc-su/1.0-SNAPSHOT/hello-world-bc-su-1.0-SNAPSHOT-installer.zip
-[INFO] ------------------------------------------------------------------------
-[INFO] BUILD SUCCESSFUL
-[INFO] ------------------------------------------------------------------------
-[INFO] Total time: 16 seconds
-[INFO] Finished at: Mon Jan 15 21:47:51 MST 2007
-[INFO] Final Memory: 13M/31M
-[INFO] ------------------------------------------------------------------------
+<PRE>
</PRE>
</DIV></DIV>
@@ -533,105 +457,158 @@
<P>This method is just a stub that needs to be filled in with our custom
functionality. Take note of the comment in that method stub stating that this
method will send JBI message exchanges and will receive responses or status
messages in this method. Based on these comments, we know that we have a few
tasks to handle in the implementation of this method. So let's get
started. </P>
-<P>Below is the method body that can be copied and pasted into the method
stub. Following the display of this method, we will pick apart this method a
bit to explain the various pieces of logic: </P>
+<P>Below is the method body that can be copied and pasted into the method stub
to being adding some custom functionality. Following the display of this
method, we will pick apart this method a bit to explain the various pieces of
logic: </P>
-<P>{code:title=The <TT>MyConsumerEndpoint.process()</TT> Method}<BR>
-public void process(MessageExchange exchange) throws Exception {<BR>
- // TODO: As we act as a consumer (we just send JBI exchanges)<BR>
- // we will receive responses or DONE / ERROR status here</P>
-
-<P> // The component acts as a consumer, this means this exchange is
received because<BR>
- // we sent it to another component. As it is active, this is either an
out or a fault<BR>
- // If this component does not create / send exchanges, you may just throw
an UnsupportedOperationException<BR>
- if (exchange.getRole() == MessageExchange.Role.CONSUMER) {<BR>
- // Exchange is finished<BR>
- if (exchange.getStatus() == ExchangeStatus.DONE) <DIV
class="error"><SPAN class="error">Unknown macro: {
- return;
- // Exchange has been aborted with an exception
- }</SPAN> </DIV> else if (exchange.getStatus() == ExchangeStatus.ERROR)
<DIV class="error"><SPAN class="error">Unknown macro: {
- return;
- // Exchange is active
- }</SPAN> </DIV> else {<BR>
- // Out message<BR>
- if (exchange.getMessage("out") != null) <DIV
class="error"><SPAN class="error">Unknown macro: {
- // TODO ... handle the response
- exchange.setStatus(ExchangeStatus.DONE);
+<DIV class="code"><DIV class="codeHeader"><B>The MyConsumerEndpoint.process()
Method</B></DIV><DIV class="codeContent">
+<PRE class="code-java"><SPAN class="code-keyword">public</SPAN> void
process(MessageExchange exchange) <SPAN class="code-keyword">throws</SPAN>
Exception {
+ <SPAN class="code-comment">// TODO: As we act as a consumer (we just send
JBI exchanges)
+</SPAN> <SPAN class="code-comment">// we will receive responses or DONE /
ERROR status here
+</SPAN>
+ <SPAN class="code-comment">// The component acts as a consumer, <SPAN
class="code-keyword">this</SPAN> means <SPAN class="code-keyword">this</SPAN>
exchange is received because
+</SPAN> <SPAN class="code-comment">// we sent it to another component. As
it is active, <SPAN class="code-keyword">this</SPAN> is either an out or a fault
+</SPAN> <SPAN class="code-comment">// If <SPAN
class="code-keyword">this</SPAN> component does not create / send exchanges,
you may just <SPAN class="code-keyword">throw</SPAN> an
UnsupportedOperationException
+</SPAN> <SPAN class="code-keyword">if</SPAN> (exchange.getRole() ==
MessageExchange.Role.CONSUMER) {
+ <SPAN class="code-comment">// Exchange is finished
+</SPAN> <SPAN class="code-keyword">if</SPAN> (exchange.getStatus() ==
ExchangeStatus.DONE) {
+ <SPAN class="code-keyword">return</SPAN>;
+ <SPAN class="code-comment">// Exchange has been aborted with an
exception
+</SPAN> } <SPAN class="code-keyword">else</SPAN> <SPAN
class="code-keyword">if</SPAN> (exchange.getStatus() == ExchangeStatus.ERROR) {
+ <SPAN class="code-keyword">return</SPAN>;
+ <SPAN class="code-comment">// Exchange is active
+</SPAN> } <SPAN class="code-keyword">else</SPAN> {
+ <SPAN class="code-comment">// Out message
+</SPAN> <SPAN class="code-keyword">if</SPAN>
(exchange.getMessage(<SPAN class="code-quote">"out"</SPAN>) != <SPAN
class="code-keyword">null</SPAN>) {
+ <SPAN class="code-comment">// TODO ... handle the response
+</SPAN> exchange.setStatus(ExchangeStatus.DONE);
getChannel().send(exchange);
- // Fault message
- }</SPAN> </DIV> else if (exchange.getFault() != null) <DIV
class="error"><SPAN class="error">Unknown macro: {
- // TODO ... handle the fault
- exchange.setStatus(ExchangeStatus.DONE);
+ <SPAN class="code-comment">// Fault message
+</SPAN> } <SPAN class="code-keyword">else</SPAN> <SPAN
class="code-keyword">if</SPAN> (exchange.getFault() != <SPAN
class="code-keyword">null</SPAN>) {
+ <SPAN class="code-comment">// TODO ... handle the fault
+</SPAN> exchange.setStatus(ExchangeStatus.DONE);
getChannel().send(exchange);
- // This is not compliant with the default MEPs
- }</SPAN> </DIV> else <DIV class="error"><SPAN
class="error">Unknown macro: {
- throw new IllegalStateException("Consumer exchange is
ACTIVE, but no out or fault is provided");
- }</SPAN> </DIV><BR>
- }<BR>
- // Unknown role<BR>
- } else <DIV class="error"><SPAN class="error">Unknown macro: {
- throw new IllegalStateException("Unkown role}</SPAN> </DIV><BR>
-}</P>
-<DIV class="code"><DIV class="codeContent">
-<PRE class="code-java">{note:title=Important Information!}
-This tutorial will not be accessing any services external to the JBI
container. Instead, we will just simulate such functionality by hard-coding
some text to be returned.
-{note}
+ <SPAN class="code-comment">// This is not compliant with the <SPAN
class="code-keyword">default</SPAN> MEPs
+</SPAN> } <SPAN class="code-keyword">else</SPAN> {
+ <SPAN class="code-keyword">throw</SPAN> <SPAN
class="code-keyword">new</SPAN> IllegalStateException(<SPAN
class="code-quote">"Consumer exchange is ACTIVE, but no out or fault is
provided"</SPAN>);
+ }
+ }
+ <SPAN class="code-comment">// Unknown role
+</SPAN> } <SPAN class="code-keyword">else</SPAN> {
+ <SPAN class="code-keyword">throw</SPAN> <SPAN
class="code-keyword">new</SPAN> IllegalStateException(<SPAN
class="code-quote">"Unkown role: "</SPAN> + exchange.getRole());
+ }
+}</PRE>
+</DIV></DIV>
+
+<P>The method above takes into account a number of conditions, so let's
go through it all. The first thing to note is that this method will only handle
the consumer role. This can be seen the outermost condition as displayed below:
</P>
-imports
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java"><SPAN class="code-keyword">if</SPAN>
(exchange.getRole() == MessageExchange.Role.CONSUMER) {
+...
+} <SPAN class="code-keyword">else</SPAN> {
+ <SPAN class="code-keyword">throw</SPAN> <SPAN
class="code-keyword">new</SPAN> IllegalStateException(<SPAN
class="code-quote">"Unkown role: "</SPAN> + exchange.getRole());
+}</PRE>
+</DIV></DIV>
-* {{javax.jbi.messaging.ExchangeStatus}}
-*
+<P>If a request comes through for the provider role, an exception will be
thrown. Next, the status of the message exchange is checked to make sure it is
not an error or a completed situation: </P>
-_This is a work in progress. I will finish <SPAN
class="code-keyword">this</SPAN> up very soon._
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java"><SPAN class="code-keyword">if</SPAN>
(exchange.getStatus() == ExchangeStatus.DONE) {
+ <SPAN class="code-keyword">return</SPAN>;
+<SPAN class="code-comment">// Exchange has been aborted with an exception
+</SPAN>} <SPAN class="code-keyword">else</SPAN> <SPAN
class="code-keyword">if</SPAN> (exchange.getStatus() == ExchangeStatus.ERROR) {
+ <SPAN class="code-keyword">return</SPAN>;</PRE>
+</DIV></DIV>
-h2. Testing the Hello World Binding Component
+<P>The exchange status comes directly from the JBI spec and can one of either
ACTIVE, DONE or ERROR. As long a the status is ACTIVE the method proceeds on
with the custom functionality. This is shown below but we have not implemented
any custom logic yet: </P>
-Thanks to the archetype, testing the component is very easy because it already
created a test. The only change we'll make is to the string being sent by
the client code. In the {{src/test/java}} directory is the
{{org.apache.servicemix.samples.helloworld.bc.MySpringComponentTest}} test.
Simply open <SPAN class="code-keyword">this</SPAN> test and change line #36
from <SPAN class="code-keyword">this</SPAN>:</PRE>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java">} <SPAN class="code-keyword">else</SPAN> {
+ <SPAN class="code-comment">// Out message
+</SPAN> <SPAN class="code-keyword">if</SPAN> (exchange.getMessage(<SPAN
class="code-quote">"out"</SPAN>) != <SPAN
class="code-keyword">null</SPAN>) {
+ <SPAN class="code-comment">// TODO ... handle the response
+</SPAN> exchange.setStatus(ExchangeStatus.DONE);
+ getChannel().send(exchange);
+ <SPAN class="code-comment">// Fault message
+</SPAN> } <SPAN class="code-keyword">else</SPAN> <SPAN
class="code-keyword">if</SPAN> (exchange.getFault() != <SPAN
class="code-keyword">null</SPAN>) {
+ <SPAN class="code-comment">// TODO ... handle the fault
+</SPAN> exchange.setStatus(ExchangeStatus.DONE);
+ getChannel().send(exchange);
+ <SPAN class="code-comment">// This is not compliant with the <SPAN
class="code-keyword">default</SPAN> MEPs
+</SPAN> } <SPAN class="code-keyword">else</SPAN> {
+ <SPAN class="code-keyword">throw</SPAN> <SPAN
class="code-keyword">new</SPAN> IllegalStateException(<SPAN
class="code-quote">"Consumer exchange is ACTIVE, but no out or fault is
provided"</SPAN>);
+ }
+}</PRE>
</DIV></DIV>
-<P>me.getInMessage().setContent(new
StringSource("<hello>world</hello>"));</P>
+<TABLE cellpadding="5" width="85%" cellspacing="8px" class="noteMacro"
border="0" align="center"><COLGROUP><COL width="24"><COL></COLGROUP><TR><TD
valign="top"><IMG
src="http://goopen.org/confluence/images/icons/emoticons/warning.gif"
width="16" height="16" align="absmiddle" alt="" border="0"></TD><TD><B
class="strong">Important Information!</B><BR>
+<P>This tutorial will not be accessing any services external to the JBI
container. Instead, we will just simulate such functionality by hard-coding
some text to be returned. </P></TD></TR></TABLE>
+
+<P>imports</P>
+
+<UL>
+ <LI><TT>javax.jbi.messaging.ExchangeStatus</TT></LI>
+ <LI></LI>
+</UL>
+
+
+<P><EM>This is a work in progress. I will finish this up very soon.</EM></P>
+
+<H2><A name="HelloWorld-BC-TestingtheHelloWorldBindingComponent"></A>Testing
the Hello World Binding Component</H2>
+
+<P>Thanks to the archetype, testing the component is very easy because it
already created a test. The only change we'll make is to the string being
sent by the client code. In the <TT>src/test/java</TT> directory is the
<TT>org.apache.servicemix.samples.helloworld.bc.MySpringComponentTest</TT>
test. Simply open this test and change line #36 from this: </P>
+
<DIV class="code"><DIV class="codeContent">
-<PRE class="code-java">to something more meaningful, like <SPAN
class="code-keyword">this</SPAN>:</PRE>
+<PRE class="code-java">me.getInMessage().setContent(<SPAN
class="code-keyword">new</SPAN> StringSource(<SPAN
class="code-quote">"<hello>world</hello>"</SPAN>));</PRE>
</DIV></DIV>
-<P>me.getInMessage().setContent(new StringSource("<hello>Ski
Colorado!</hello>"));</P>
+
+<P>to something more meaningful, like this: </P>
+
<DIV class="code"><DIV class="codeContent">
-<PRE class="code-java">To execute the test, simply run the Maven {{install}}
goal from within the {{hello-world-bc-su}} directory like so:</PRE>
+<PRE class="code-java">me.getInMessage().setContent(<SPAN
class="code-keyword">new</SPAN> StringSource(<SPAN
class="code-quote">"<hello>Ski
Colorado!</hello>"</SPAN>));</PRE>
</DIV></DIV>
-<P>$ mvn install </P>
+
+<P>To execute the test, simply run the Maven <TT>install</TT> goal from within
the <TT>hello-world-bc-su</TT> directory like so: </P>
+
<DIV class="code"><DIV class="codeContent">
-<PRE class="code-java">Below is the output that will print to the console:
+<PRE class="code-java">$ mvn install</PRE>
+</DIV></DIV>
-{noformat}
+<P>Below is the output that will print to the console: </P>
-{noformat}
+<DIV class="preformatted"><DIV class="preformattedContent">
+<PRE>
+</PRE>
+</DIV></DIV>
-Notice that not only <SPAN class="code-keyword">do</SPAN> we see that the
build was successful, but also note the text in the output above that was
printed by the test (*<hello>Hello World! Message \[<hello>Ski
Colorado!</hello>\] contains \[28\] bytes.</hello>*). This is the
message we were expecting to be output from the test. So <SPAN
class="code-keyword">if</SPAN> you see <SPAN class="code-keyword">this</SPAN>,
you just wrote a JBI component and tested it successfully. Now <SPAN
class="code-keyword">this</SPAN> SU needs to be wrapped in a SA so it can be
deployed to the JBI container.
+<P>Notice that not only do we see that the build was successful, but also note
the text in the output above that was printed by the test
(<B><hello>Hello World! Message [<hello>Ski
Colorado!</hello>] contains [28] bytes.</hello></B>). This is the
message we were expecting to be output from the test. So if you see this, you
just wrote a JBI component and tested it successfully. Now this SU needs to be
wrapped in a SA so it can be deployed to the JBI container. </P>
-h2. Wrapping the Service Unit in a Service Assembly
+<H2><A
name="HelloWorld-BC-WrappingtheServiceUnitinaServiceAssembly"></A>Wrapping the
Service Unit in a Service Assembly </H2>
+
+<P>The component we created above and packaged as a SU cannot be directly
deployed to a JBI container until it's wrapped in a SA. This can be done
by creating a SA with a dependency on the SA. From within the
<TT>hello-world-smx</TT> directory, execute the following commands to create
the project for the SA: </P>
-The component we created above and packaged as a SU cannot be directly
deployed to a JBI container until it's wrapped in a SA. This can be done
by creating a SA with a dependency on the SA. From within the
{{hello-world-smx}} directory, execute the following commands to create the
project <SPAN class="code-keyword">for</SPAN> the SA:</PRE>
-</DIV></DIV>
-<P>$ pwd<BR>
-/Users/bsnyder/src/hello-world-smx/hello-world-bc-su<BR>
-$ cd .. <BR>
-$ mvn archetype:create \<BR>
- -DarchetypeGroupId=org.apache.servicemix.tooling \<BR>
- -DarchetypeArtifactId=servicemix-service-assembly \<BR>
- -DarchetypeVersion=3.1-incubating-SNAPSHOT \<BR>
- -DgroupId=org.apache.servicemix.samples.helloworld \<BR>
- -DartifactId=hello-world-sa</P>
<DIV class="code"><DIV class="codeContent">
-<PRE class="code-java">Upon successful execution of the {{archetype:create}}
goal, look <SPAN class="code-keyword">for</SPAN> the BUILD SUCCESSFUL output as
displayed below:
+<PRE class="code-java">$ pwd
+/Users/bsnyder/src/hello-world-smx/hello-world-bc-su
+$ cd ..
+$ mvn archetype:create \
+ -DarchetypeGroupId=org.apache.servicemix.tooling \
+ -DarchetypeArtifactId=servicemix-service-assembly \
+ -DarchetypeVersion=3.1-incubating-SNAPSHOT \
+ -DgroupId=org.apache.servicemix.samples.helloworld \
+ -DartifactId=hello-world-sa</PRE>
+</DIV></DIV>
-{noformat}
-[INFO] Scanning <SPAN class="code-keyword">for</SPAN> projects...
-[INFO] Searching repository <SPAN class="code-keyword">for</SPAN> plugin with
prefix: 'archetype'.
+<P>Upon successful execution of the <TT>archetype:create</TT> goal, look for
the BUILD SUCCESSFUL output as displayed below: </P>
+
+<DIV class="preformatted"><DIV class="preformattedContent">
+<PRE>[INFO] Scanning for projects...
+[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO]
----------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO] task-segment: [archetype:create] (aggregator-style)
[INFO]
----------------------------------------------------------------------------
[INFO] Setting property: classpath.resource.loader.class =>
'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
-[INFO] Setting property: velocimacro.messages.on => '<SPAN
class="code-keyword">false</SPAN>'.
+[INFO] Setting property: velocimacro.messages.on => 'false'.
[INFO] Setting property: resource.loader => 'classpath'.
-[INFO] Setting property: resource.manager.logwhenfound => '<SPAN
class="code-keyword">false</SPAN>'.
+[INFO] Setting property: resource.manager.logwhenfound => 'false'.
[INFO] **************************************************************
[INFO] Starting Jakarta Velocity v1.4
[INFO] RuntimeInstance initializing.
@@ -642,11 +619,11 @@
[INFO] ClasspathResourceLoader : initialization complete.
[INFO] ResourceCache : initialized. (class
org.apache.velocity.runtime.resource.ResourceCacheImpl)
[INFO] Default ResourceManager initialization complete.
-[INFO] Loaded <SPAN class="code-object">System</SPAN> Directive:
org.apache.velocity.runtime.directive.Literal
-[INFO] Loaded <SPAN class="code-object">System</SPAN> Directive:
org.apache.velocity.runtime.directive.Macro
-[INFO] Loaded <SPAN class="code-object">System</SPAN> Directive:
org.apache.velocity.runtime.directive.Parse
-[INFO] Loaded <SPAN class="code-object">System</SPAN> Directive:
org.apache.velocity.runtime.directive.Include
-[INFO] Loaded <SPAN class="code-object">System</SPAN> Directive:
org.apache.velocity.runtime.directive.Foreach
+[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Literal
+[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Macro
+[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Parse
+[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Include
+[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Foreach
[INFO] Created: 20 parsers.
[INFO] Velocimacro : initialization starting.
[INFO] Velocimacro : adding VMs from VM library template : VM_global_library.vm
@@ -654,20 +631,20 @@
[INFO] Velocimacro : error using VM library template VM_global_library.vm :
org.apache.velocity.exception.ResourceNotFoundException:
Unable to find resource 'VM_global_library.vm'
[INFO] Velocimacro : VM library template macro registration complete.
-[INFO] Velocimacro : allowInline = <SPAN class="code-keyword">true</SPAN> :
VMs can be defined inline in templates
-[INFO] Velocimacro : allowInlineToOverride = <SPAN
class="code-keyword">false</SPAN> : VMs defined inline may NOT replace previous
VM definitions
-[INFO] Velocimacro : allowInlineLocal = <SPAN
class="code-keyword">false</SPAN> : VMs defined inline will be global in scope
<SPAN class="code-keyword">if</SPAN> allowed.
+[INFO] Velocimacro : allowInline = true : VMs can be defined inline in
templates
+[INFO] Velocimacro : allowInlineToOverride = false : VMs defined inline may
NOT replace previous VM definitions
+[INFO] Velocimacro : allowInlineLocal = false : VMs defined inline will be
global in scope if allowed.
[INFO] Velocimacro : initialization complete.
[INFO] Velocity successfully started.
[INFO] [archetype:create]
-[INFO] Defaulting <SPAN class="code-keyword">package</SPAN> to group ID:
org.apache.servicemix.samples.helloworld
+[INFO] Defaulting package to group ID: org.apache.servicemix.samples.helloworld
[INFO]
----------------------------------------------------------------------------
-[INFO] Using following parameters <SPAN class="code-keyword">for</SPAN>
creating Archetype: servicemix-service-assembly:3.1-incubating-SNAPSHOT
+[INFO] Using following parameters for creating Archetype:
servicemix-service-assembly:3.1-incubating-SNAPSHOT
[INFO]
----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: org.apache.servicemix.samples.helloworld
[INFO] Parameter: packageName, Value: org.apache.servicemix.samples.helloworld
[INFO] Parameter: basedir, Value: /Users/bsnyder/src/hello-world-smx
-[INFO] Parameter: <SPAN class="code-keyword">package</SPAN>, Value:
org.apache.servicemix.samples.helloworld
+[INFO] Parameter: package, Value: org.apache.servicemix.samples.helloworld
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: artifactId, Value: hello-world-sa
[WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference
: template = archetype-resources/pom.xml [line 71,column 18] :
@@ -681,114 +658,129 @@
[INFO] Finished at: Fri Jan 05 23:40:32 MST 2007
[INFO] Final Memory: 4M/8M
[INFO] ------------------------------------------------------------------------
-{noformat}
-
-The {{hello-world-smx}} directory should now contain the following two
directories:</PRE>
+</PRE>
</DIV></DIV>
-<P>$ ls <BR>
-hello-world-sa hello-world-bc-su</P>
-<DIV class="code"><DIV class="codeContent">
-<PRE class="code-java">If you see the above directories, proceed to the next
step below. If instead you see the BUILD FAILED output, you'll need to
analyze the <SPAN class="code-keyword">rest</SPAN> of the output to
troubleshoot the issue. Assistance with any issue you might experience is
available from the ServiceMix community via the [ServiceMix mailing lists
archive|Mailing Lists].
-Now that we have a project <SPAN class="code-keyword">for</SPAN> the SA, we
need to edit the POM so that the project depends upon the JBI component we
created above. This can be done by editing the POM <SPAN
class="code-keyword">for</SPAN> the SA to add a dependency upon the
{{hello-world-bc-su}} as listed below:</PRE>
-</DIV></DIV>
-<P><dependency><BR>
-
<groupId>org.apache.servicemix.samples.helloworld.bc</groupId><BR>
- <artifactId>hello-world-bc-su</artifactId><BR>
- <version>1.0-SNAPSHOT</version><BR>
-</dependency></P>
+<P>The <TT>hello-world-smx</TT> directory should now contain the following two
directories: </P>
+
<DIV class="code"><DIV class="codeContent">
-<PRE class="code-java">Upon adding <SPAN class="code-keyword">this</SPAN>
dependency to the POM, build the project using the command below:</PRE>
+<PRE class="code-java">$ ls
+hello-world-sa hello-world-bc-su</PRE>
</DIV></DIV>
-<P>$ cd hello-world-sa<BR>
-$ mvn install </P>
-<DIV class="code"><DIV class="codeContent">
-<PRE class="code-java">{noformat}
-{noformat}
+<P>If you see the above directories, proceed to the next step below. If
instead you see the BUILD FAILED output, you'll need to analyze the rest
of the output to troubleshoot the issue. Assistance with any issue you might
experience is available from the ServiceMix community via the <A
href="mailing-lists.html" title="Mailing Lists">ServiceMix mailing lists
archive</A>. </P>
-h2. Incorporating the Projects Into a Top Level POM
+<P>Now that we have a project for the SA, we need to edit the POM so that the
project depends upon the JBI component we created above. This can be done by
editing the POM for the SA to add a dependency upon the
<TT>hello-world-bc-su</TT> as listed below: </P>
-Now that we have created the SU and SA projects, a top level {{pom.xml}} must
be manually created and made aware of each subproject. This will allow all the
projects to be built automatically without having to build each project in
order manually. Maven will discover all the projects and build them in the
proper order. In the {{hello-world-bc-su}} directory, create a file named
{{pom.xml}} containing the following content:</PRE>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java"><dependency>
+ <groupId>org.apache.servicemix.samples.helloworld.bc</groupId>
+ <artifactId>hello-world-bc-su</artifactId>
+ <version>1.0-SNAPSHOT</version>
+</dependency></PRE>
</DIV></DIV>
-<P><?xml version="1.0" encoding="UTF-8"?><BR>
-<project xmlns="http://maven.apache.org/POM/4.0.0" <BR>
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<BR>
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 <SPAN
class="nobr"><A href="http://maven.apache.org/maven-v4_0_0.xsd" title="Visit
page outside Confluence"
rel="nofollow">http://maven.apache.org/maven-v4_0_0.xsd<SUP><IMG
class="rendericon" src="http://goopen.org/confluence/images/icons/linkext7.gif"
height="0" width="0" align="absmiddle" alt=""
border="0"></SUP></A></SPAN>"></P>
-<P> <modelVersion>4.0.0</modelVersion></P>
+<P>Upon adding this dependency to the POM, build the project using the command
below: </P>
+
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java">$ cd hello-world-sa
+$ mvn install</PRE>
+</DIV></DIV>
-<P>
<groupId>org.apache.servicemix.samples.helloworld</groupId><BR>
- <artifactId>hello-world-smx</artifactId><BR>
- <packaging>pom</packaging><BR>
- <version>1.0-SNAPSHOT</version><BR>
- <name>Hello World JBI Component</name></P>
+<DIV class="preformatted"><DIV class="preformattedContent">
+<PRE>
+</PRE>
+</DIV></DIV>
-<P> <modules><BR>
- <module>hello-world-sa</module><BR>
- <module>hello-world-bc-su</module><BR>
- </modules></P>
+<H2><A
name="HelloWorld-BC-IncorporatingtheProjectsIntoaTopLevelPOM"></A>Incorporating
the Projects Into a Top Level POM</H2>
-<P></project></P>
+<P>Now that we have created the SU and SA projects, a top level
<TT>pom.xml</TT> must be manually created and made aware of each subproject.
This will allow all the projects to be built automatically without having to
build each project in order manually. Maven will discover all the projects and
build them in the proper order. In the <TT>hello-world-bc-su</TT> directory,
create a file named <TT>pom.xml</TT> containing the following content:</P>
<DIV class="code"><DIV class="codeContent">
-<PRE class="code-java">This POM will allow the example to be easily folded in
to the ServiceMix samples. The {{<modules>}} element denotes the other
projects that were created above using the Maven archetypes. Once the
{{pom.xml}} file from above is saved into the {{hello-world-smx}} directory,
you should now see the following:</PRE>
+<PRE class="code-java"><?xml version=<SPAN
class="code-quote">"1.0"</SPAN> encoding=<SPAN
class="code-quote">"UTF-8"</SPAN>?>
+<project xmlns=<SPAN class="code-quote">"http:<SPAN
class="code-comment">//maven.apache.org/POM/4.0.0"</SPAN>
+</SPAN> xmlns:xsi=<SPAN class="code-quote">"http:<SPAN
class="code-comment">//www.w3.org/2001/XMLSchema-instance"</SPAN>
+</SPAN> xsi:schemaLocation=<SPAN class="code-quote">"http:<SPAN
class="code-comment">//maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd"</SPAN>>
+</SPAN>
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.servicemix.samples.helloworld</groupId>
+ <artifactId>hello-world-smx</artifactId>
+ <packaging>pom</packaging>
+ <version>1.0-SNAPSHOT</version>
+ <name>Hello World JBI Component</name>
+
+ <modules>
+ <module>hello-world-sa</module>
+ <module>hello-world-bc-su</module>
+ </modules>
+
+</project></PRE>
</DIV></DIV>
-<P>$ ls <BR>
-hello-world-sa hello-world-bc-su pom.xml</P>
+
+<P>This POM will allow the example to be easily folded in to the ServiceMix
samples. The <TT><modules></TT> element denotes the other projects that
were created above using the Maven archetypes. Once the <TT>pom.xml</TT> file
from above is saved into the <TT>hello-world-smx</TT> directory, you should now
see the following: </P>
+
<DIV class="code"><DIV class="codeContent">
-<PRE class="code-java">All projects can now be built using the following
command on the command-line from the top level {{hello-world-smx}}
directory:</PRE>
+<PRE class="code-java">$ ls
+hello-world-sa hello-world-bc-su pom.xml</PRE>
</DIV></DIV>
-<P>$ mvn clean install </P>
+
+<P>All projects can now be built using the following command on the
command-line from the top level <TT>hello-world-smx</TT> directory: </P>
+
<DIV class="code"><DIV class="codeContent">
-<PRE class="code-java">The command above should display the output below:
+<PRE class="code-java">$ mvn clean install</PRE>
+</DIV></DIV>
+
+<P>The command above should display the output below: </P>
+
+<DIV class="preformatted"><DIV class="preformattedContent">
+<PRE>
+</PRE>
+</DIV></DIV>
-{noformat}
+<P>As long as you see the BUILD SUCCESSFUL message in the output continue to
the next section to give each project a unique name. </P>
-{noformat}
+<H2><A name="HelloWorld-BC-GiveEachoftheMavenSubprojectsaName"></A>Give Each
of the Maven Subprojects a Name </H2>
-As <SPAN class="code-object">long</SPAN> as you see the BUILD SUCCESSFUL
message in the output <SPAN class="code-keyword">continue</SPAN> to the next
section to give each project a unique name.
+<P>Notice in the output above that there are a two projects named <EM>A custom
project</EM>. This is because the archetypes create projects with this generic
name. Let's give each project a unique name via each component's
<TT>pom.xml</TT> file. This name will allow Maven's output to denote a
component's name in its output making our development work a bit easier.
To name each project, simply edit each <TT>pom.xml</TT> and replace
<TT><name>A custom project</name></TT> with an appropriate name.
Below are the instructions for naming each component's project: </P>
-h2. Give Each of the Maven Subprojects a Name
+<UL>
+ <LI>Edit <TT>hello-world-sa/pom.xml</TT> and replace <TT><name>A
custom project</name></TT> with <TT><name>Hello World Service
Assembly</name></TT></LI>
+ <LI>Edit <TT>hello-world-bc-su/pom.xml</TT> and replace
<TT><name>A custom project</name></TT> with <TT><name>Hello
World BC Service Unit</name></TT></LI>
+</UL>
-Notice in the output above that there are a two projects named _A custom
project_. This is because the archetypes create projects with <SPAN
class="code-keyword">this</SPAN> <SPAN class="code-keyword">generic</SPAN>
name. Let's give each project a unique name via each component's
{{pom.xml}} file. This name will allow Maven's output to denote a
component's name in its output making our development work a bit easier.
To name each project, simply edit each {{pom.xml}} and replace {{<name>A
custom project</name>}} with an appropriate name. Below are the
instructions <SPAN class="code-keyword">for</SPAN> naming each component's
project:
-* Edit {{hello-world-sa/pom.xml}} and replace {{<name>A custom
project</name>}} with {{<name>Hello World Service
Assembly</name>}}
-* Edit {{hello-world-bc-su/pom.xml}} and replace {{<name>A custom
project</name>}} with {{<name>Hello World BC Service
Unit</name>}}
+<P>Now when the projects are built you will no longer see a project named
<EM>A custom project</EM>. Instead you'll now see <EM>Hello World SE
Service Unit</EM> and <EM>Hello World Service Assembly</EM>. Rebuild the
projects again using the <TT>mvn clean install</TT> command on the command-line
to see the change. </P>
-Now when the projects are built you will no longer see a project named _A
custom project_. Instead you'll now see _Hello World SE Service Unit_ and
_Hello World Service Assembly_. Rebuild the projects again using the {{mvn
clean install}} command on the command-line to see the change.
+<H3><A name="HelloWorld-BC-DeployingtheComponent"></A>Deploying the Component
</H3>
-h3. Deploying the Component
+<P>Now that the SA is built, we're ready to deploy it to the JBI
container. </P>
-Now that the SA is built, we're ready to deploy it to the JBI container.
+<P><EM>This is a work in progress. I will finish this up very soon.</EM></P>
-_This is a work in progress. I will finish <SPAN
class="code-keyword">this</SPAN> up very soon._
+<HR>
-----
+<TABLE cellpadding="5" width="85%" cellspacing="8px" class="noteMacro"
border="0" align="center"><COLGROUP><COL width="24"><COL></COLGROUP><TR><TD
valign="top"><IMG
src="http://goopen.org/confluence/images/icons/emoticons/warning.gif"
width="16" height="16" align="absmiddle" alt="" border="0"></TD><TD><B
class="strong">Deploying Component Dependencies</B><BR>
+<P>When working with the <TT>jbi:projectDeploy</TT> you may want to disable
dependency deployment. When deploying to a server which has other components
sharing these dependencies, they can cause problems during deployment. To stop
the Maven JBI plugin from undeploying and redeploying dependencies each time,
alter its configuration by disabling the deployment of dependencies using the
following: </P>
-{note:title=Deploying Component Dependencies}
-When working with the {{jbi:projectDeploy}} you may want to disable dependency
deployment. When deploying to a server which has other components sharing these
dependencies, they can cause problems during deployment. To stop the Maven JBI
plugin from undeploying and redeploying dependencies each time, alter its
configuration by disabling the deployment of dependencies using the
following:</PRE>
-</DIV></DIV>
-<P><build><BR>
-<plugins><BR>
- <plugin><BR>
- <artifactId>jbi-maven-plugin</artifactId><BR>
- <configuration><BR>
- <deployDependencies>false</deployDependencies><BR>
- </configuration><BR>
- </plugin><BR>
-</plugins><BR>
-</build></P>
<DIV class="code"><DIV class="codeContent">
-<PRE class="code-java"></PRE>
+<PRE class="code-java"><build>
+<plugins>
+ <plugin>
+ <artifactId>jbi-maven-plugin</artifactId>
+ <configuration>
+ <deployDependencies><SPAN
class="code-keyword">false</SPAN></deployDependencies>
+ </configuration>
+ </plugin>
+</plugins>
+</build></PRE>
</DIV></DIV>
<P>The configuration above introduces the <TT>deployDependencies</TT> element
to the Maven JBI plugin and sets it to false. </P>
-<P>For a few more configurable options on the Maven JBI plugin, see also <SPAN
class="nobr"><A href="https://issues.apache.org/activemq/browse/SM-605"
title="Visit page outside Confluence" rel="nofollow">Ability to configure
jbi:projectDeploy goal to exclude updating dependencies<SUP><IMG
class="rendericon" src="http://goopen.org/confluence/images/icons/linkext7.gif"
height="0" width="0" align="absmiddle" alt="" border="0"></SUP></A></SPAN>.</P>
-<TABLE cellpadding="5" width="85%" cellspacing="8px" class="noteMacro"
border="0" align="center"><COLGROUP><COL width="24"><COL></COLGROUP><TR><TD
valign="top"><IMG
src="http://goopen.org/confluence/images/icons/emoticons/warning.gif"
width="16" height="16" align="absmiddle" alt="" border="0"></TD><TD>
+<P>For a few more configurable options on the Maven JBI plugin, see also <SPAN
class="nobr"><A href="https://issues.apache.org/activemq/browse/SM-605"
title="Visit page outside Confluence" rel="nofollow">Ability to configure
jbi:projectDeploy goal to exclude updating dependencies<SUP><IMG
class="rendericon" src="http://goopen.org/confluence/images/icons/linkext7.gif"
height="0" width="0" align="absmiddle" alt=""
border="0"></SUP></A></SPAN>.</P></TD></TR></TABLE>
-<TABLE cellpadding="5" width="85%" cellspacing="8px" class="noteMacro"
border="0" align="center"><COLGROUP><COL width="24"><COL></COLGROUP><TR><TD
valign="top"><IMG
src="http://goopen.org/confluence/images/icons/emoticons/warning.gif"
width="16" height="16" align="absmiddle" alt="" border="0"></TD><TD><B
class="strong">TODO</B><BR></TD></TR></TABLE>
+<TABLE cellpadding="5" width="85%" cellspacing="8px" class="noteMacro"
border="0" align="center"><COLGROUP><COL width="24"><COL></COLGROUP><TR><TD
valign="top"><IMG
src="http://goopen.org/confluence/images/icons/emoticons/warning.gif"
width="16" height="16" align="absmiddle" alt="" border="0"></TD><TD><B
class="strong">TODO</B><BR>
<P>The default implementation of the component accepts InOut MEPs (ADD<BR>
LINK TO FURTHER READING CONCERNING MEPs) and return the input content<BR>
as the out message. This is already nearly what we want.</P>
@@ -854,8 +846,8 @@
</DIV>
<DIV id="site-footer">
Added by <A
href="http://goopen.org/confluence/users/viewuserprofile.action?username=bsnyder">Bruce
Snyder</A>,
- last edited by <A
href="http://goopen.org/confluence/users/viewuserprofile.action?username=bsnyder">Bruce
Snyder</A> on Jan 17, 2007
- (<A
href="http://goopen.org/confluence/pages/diffpages.action?pageId=15306&originalId=15325">view
change</A>)
+ last edited by <A
href="http://goopen.org/confluence/users/viewuserprofile.action?username=bsnyder">Bruce
Snyder</A> on Jan 18, 2007
+ (<A
href="http://goopen.org/confluence/pages/diffpages.action?pageId=15306&originalId=15328">view
change</A>)
(<A
href="http://goopen.org/confluence/pages/editpage.action?pageId=15306">edit
page</A>)
</DIV>