You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by js...@apache.org on 2006/06/14 16:04:42 UTC

svn commit: r414260 - /incubator/servicemix/site/groovy.html

Author: jstrachan
Date: Wed Jun 14 07:04:42 2006
New Revision: 414260

URL: http://svn.apache.org/viewvc?rev=414260&view=rev
Log:
Latest export from confluence

Modified:
    incubator/servicemix/site/groovy.html

Modified: incubator/servicemix/site/groovy.html
URL: http://svn.apache.org/viewvc/incubator/servicemix/site/groovy.html?rev=414260&r1=414259&r2=414260&view=diff
==============================================================================
--- incubator/servicemix/site/groovy.html (original)
+++ incubator/servicemix/site/groovy.html Wed Jun 14 07:04:42 2006
@@ -80,9 +80,10 @@
 <H3><A name="Navigation-Community"></A>Community</H3>
 
 <UL class="alternate" type="square">
-	<LI><SPAN class="nobr"><A href="navigation.html" title="Visit page outside Confluence" rel="nofollow">Wiki<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></LI>
+	<LI><A href="support.html" title="Support">Support</A></LI>
 	<LI><A href="discussion-forums.html" title="Discussion Forums">Discussion Forums</A></LI>
 	<LI><A href="mailing-lists.html" title="Mailing Lists">Mailing Lists</A></LI>
+	<LI><SPAN class="nobr"><A href="navigation.html" title="Visit page outside Confluence" rel="nofollow">Wiki<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></LI>
 	<LI><A href="contributing.html" title="Contributing">Contributing</A></LI>
 	<LI><A href="team.html" title="Team">Team</A></LI>
 	<LI><A href="users.html" title="Users">Users</A></LI>
@@ -180,7 +181,7 @@
 <H3><A name="Navigation-RelatedProjects"></A>Related Projects</H3>
 
 <UL class="alternate" type="square">
-	<LI><SPAN class="nobr"><A href="http://activemq.codehaus.org/" title="High Performance Message Bus" rel="nofollow">Apache ActiveMQ<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></LI>
+	<LI><SPAN class="nobr"><A href="http://incubator.apache.org/activemq/" title="High Performance Message Bus" rel="nofollow">Apache ActiveMQ<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></LI>
 	<LI><SPAN class="nobr"><A href="http://lingo.codehaus.org/" title="POJO Remoting using JMS" rel="nofollow">Lingo<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></LI>
 	<LI><SPAN class="nobr"><A href="http://jencks.org/" title="Message Driven POJOs and pooling for JMS and JDBC" rel="nofollow">Jencks<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></LI>
 	<LI><SPAN class="nobr"><A href="http://stomp.codehaus.org/" title="Simple cross language protocol for messaging" rel="nofollow">Stomp<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></LI>
@@ -233,31 +234,7 @@
 <H2><A name="Groovy-Example"></A>Example</H2>
 
 <P>Before we go into detail of how you can work with JBI and Groovy in ServiceMix, lets show a simple hello world kinda example.</P>
-<DIV class="code"><DIV class="codeContent">
-<PRE class="code-xml">&lt;sm:activationSpec componentName=<SPAN class="code-quote">&quot;myServiceUsingXMLText&quot;</SPAN>
-        service=<SPAN class="code-quote">&quot;foo:myServiceUsingXMLText&quot;</SPAN>&gt;
-        <SPAN class="code-tag">&lt;sm:component&gt;</SPAN>
-          <SPAN class="code-tag">&lt;bean class=<SPAN class="code-quote">&quot;org.apache.servicemix.components.groovy.GroovyComponent&quot;</SPAN>&gt;</SPAN>
-            <SPAN class="code-tag">&lt;property name=<SPAN class="code-quote">&quot;scriptText&quot;</SPAN>&gt;</SPAN>
-              <SPAN class="code-tag">&lt;value&gt;</SPAN>
-                &lt;![CDATA[
-
-// lets output some message properties
-outMessage.properties = [foo:<SPAN class="code-quote">&quot;hello&quot;</SPAN>, someList:[1, 2, 3]]
-
-// lets output some non-xml body
-outMessage.bodyText = &quot;&quot;&quot;
-<SPAN class="code-tag">&lt;hello&gt;</SPAN>
-  <SPAN class="code-tag">&lt;world person=<SPAN class="code-quote">&quot;$inMessage.properties.name&quot;</SPAN> location=<SPAN class="code-quote">&quot;London&quot;</SPAN>/&gt;</SPAN>
-<SPAN class="code-tag">&lt;/hello&gt;</SPAN>
-&quot;&quot;&quot;
-                ]]&gt;
-              <SPAN class="code-tag">&lt;/value&gt;</SPAN>
-            <SPAN class="code-tag">&lt;/property&gt;</SPAN>
-          <SPAN class="code-tag">&lt;/bean&gt;</SPAN>
-        <SPAN class="code-tag">&lt;/sm:component&gt;</SPAN>
-      <SPAN class="code-tag">&lt;/sm:activationSpec&gt;</SPAN></PRE>
-</DIV></DIV>
+
 <P>As you can see the component is configured with a piece of Groovy to execute when the service is invoked. (BTW if you wanna see this script in action try the <SPAN class="nobr"><A href="http://servicemix.codehaus.org/maven/xref-test/org/servicemix/client/ServiceMixClientTest.html" title="Visit page outside Confluence" rel="nofollow">test case<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> and <SPAN class="nobr"><A href="http://svn.servicemix.codehaus.org/*checkout*/branches/servicemix-1.1/base/src/test/resources/org/servicemix/client/example.xml" title="Visit page outside Confluence" rel="nofollow">XML config file<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>Now we&apos;ll go through the various options which are available when working with JBI and Groovy in ServiceMix</P>
@@ -265,28 +242,7 @@
 <H2><A name="Groovy-Maintainingstateacrossrequests"></A>Maintaining state across requests</H2>
 
 <P>Its often handy to keep track of state across requests. There is a variable called &apos;bindings&apos; which you can use to maintain state...</P>
-<DIV class="code"><DIV class="codeContent">
-<PRE class="code-xml"><SPAN class="code-tag">&lt;activationSpec componentName=<SPAN class="code-quote">&quot;myServiceImpl&quot;</SPAN> service=<SPAN class="code-quote">&quot;foo:myServiceImpl&quot;</SPAN>&gt;</SPAN>
-      <SPAN class="code-tag">&lt;component&gt;</SPAN>
-       <SPAN class="code-tag">&lt;bean xmlns=<SPAN class="code-quote">&quot;&quot; class=&quot;</SPAN>org.apache.servicemix.components.groovy.GroovyComponent&quot;&gt;</SPAN>
-        <SPAN class="code-tag">&lt;property name=<SPAN class="code-quote">&quot;scriptText&quot;</SPAN>&gt;</SPAN>
-          <SPAN class="code-tag">&lt;value&gt;</SPAN>
-            &lt;![CDATA[
-if (bindings.counter == null) {
-    bindings.counter = 1
-}
-else {
-    ++bindings.counter
-}
-
-def date = new Date()
-
-outMessage.bodyText = <SPAN class="code-quote">&quot;<SPAN class="code-tag">&lt;response counter=&apos;$bindings.counter&apos; date=&apos;$date&apos;&gt;</SPAN><SPAN class="code-tag">&lt;/response&gt;</SPAN>&quot;</SPAN>
-            ]]&gt;
-          <SPAN class="code-tag">&lt;/value&gt;</SPAN>
-        <SPAN class="code-tag">&lt;/property&gt;</SPAN>
-      <SPAN class="code-tag">&lt;/bean&gt;</SPAN><SPAN class="code-tag">&lt;/component&gt;</SPAN><SPAN class="code-tag">&lt;/activationSpec&gt;</SPAN></PRE>
-</DIV></DIV>
+
 
 <H2><A name="Groovy-WorkingwithJBIproperties"></A>Working with JBI properties</H2>