You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by ch...@apache.org on 2006/11/05 22:49:10 UTC
svn commit: r471540 - in /incubator/servicemix/site/main: pojo-support.html
quartz.html reflection.html rss.html saaj.html
Author: chirino
Date: Sun Nov 5 13:49:09 2006
New Revision: 471540
URL: http://svn.apache.org/viewvc?view=rev&rev=471540
Log:
Latest export from confluence
Modified:
incubator/servicemix/site/main/pojo-support.html
incubator/servicemix/site/main/quartz.html
incubator/servicemix/site/main/reflection.html
incubator/servicemix/site/main/rss.html
incubator/servicemix/site/main/saaj.html
Modified: incubator/servicemix/site/main/pojo-support.html
URL: http://svn.apache.org/viewvc/incubator/servicemix/site/main/pojo-support.html?view=diff&rev=471540&r1=471539&r2=471540
==============================================================================
--- incubator/servicemix/site/main/pojo-support.html (original)
+++ incubator/servicemix/site/main/pojo-support.html Sun Nov 5 13:49:09 2006
@@ -36,7 +36,7 @@
<TR>
<TD align="left" valign="middle" nowrap="">
<DIV id="site-breadcrumbs">
-<A href="home.html" title="ServiceMix">ServiceMix</A> > <A href="home.html" title="Home">Home</A> > <A href="documentation.html" title="Documentation">Documentation</A> > <A href="components.html" title="Components">Components</A> > <A href="lightweight-components.html" title="Lightweight components">Lightweight components</A> > <A href="" title="POJO support">POJO support</A>
+<A href="home.html" title="ServiceMix">ServiceMix</A> > <A href="home.html" title="Home">Home</A> > <A href="documentation.html" title="Documentation">Documentation</A> > <A href="components-list.html" title="Components list">Components list</A> > <A href="lightweight-components.html" title="Lightweight components">Lightweight components</A> > <A href="" title="POJO support">POJO support</A>
</DIV>
</TD>
<TD align="right" valign="middle" nowrap="">
@@ -113,27 +113,151 @@
<!--
<div class="pagetitle">POJO support</div>
-->
- <DIV class="wiki-content">
-<P>ServiceMix provides support for <EM>JBI POJOs</EM> in addition to the usual JBI Components. JBI Components are maybe not as lightweight as they could be; there's a bunch of methods on there for dealing with metadata, management and capabilities along with a lifecycle object.</P>
+ <DIV class="wiki-content"><P>ServiceMix provides support for <EM>JBI POJOs</EM> in addition to the usual JBI Components. JBI Components are maybe not as lightweight as they could be; there's a bunch of methods on there for dealing with metadata, management and capabilities along with a lifecycle object.</P>
-<P>ServiceMix introduces the idea of a JBI POJO which is any Java object which implements the <SPAN class="nobr"><A href="http://servicemix.org/maven/apidocs/javax/jbi/component/ComponentLifeCycle.html" title="Visit page outside Confluence" rel="nofollow">ComponentLifeCycle<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> interface and uses dependency injection to configure itself.</P>
+<P>ServiceMix introduces the idea of a JBI POJO which is any Java object which implements the <SPAN class="nobr"><A href="http://incubator.apache.org/servicemix/dist/servicemix-3.0-incubating/site/servicemix-jbi/apidocs/javax/jbi/component/ComponentLifeCycle.html" title="Visit page outside Confluence" rel="nofollow">ComponentLifeCycle<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> interface and uses dependency injection to configure itself.</P>
-<P>Adding an instance of ComponentLifeCycle to the SpringJBIContainer will automatically wrap the POJO in a JBI <SPAN class="nobr"><A href="http://servicemix.org/maven/apidocs/org/servicemix/jbi/component/ComponentAdaptor.html" title="Visit page outside Confluence" rel="nofollow">ComponentAdaptor<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> so that it faithfully obeys the JBI Component contract.</P>
+<P>Adding an instance of ComponentLifeCycle to the SpringJBIContainer will automatically wrap the POJO in a JBI <SPAN class="nobr"><A href="http://incubator.apache.org/servicemix/dist/servicemix-3.0-incubating/site/servicemix-core/apidocs/org/apache/servicemix/components/util/ComponentAdaptor.html" title="Visit page outside Confluence" rel="nofollow">ComponentAdaptor<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> so that it faithfully obeys the JBI Component contract.</P>
-<P>This means you can write JBI POJOs to be deployed by Spring without deriving from some helper base class like ServiceMix's <SPAN class="nobr"><A href="http://servicemix.org/maven/apidocs/org/servicemix/jbi/component/ComponentSupport.html" title="Visit page outside Confluence" rel="nofollow">ComponentSupport<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> so that your POJO has no dependency other than on the JBI APIs and then let ServiceMix take care of more of the plumbing for you.</P>
+<P>This means you can write JBI POJOs to be deployed by Spring without deriving from some helper base class like ServiceMix's <SPAN class="nobr"><A href="http://incubator.apache.org/servicemix/dist/servicemix-3.0-incubating/site/servicemix-core/apidocs/org/apache/servicemix/components/util/ComponentSupport.html" title="Visit page outside Confluence" rel="nofollow">ComponentSupport<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> so that your POJO has no dependency other than on the JBI APIs and then let ServiceMix take care of more of the plumbing for you.</P>
<H2><A name="POJOsupport-ExamplePOJOComponents"></A>Example POJO Components</H2>
<P>First here's how we configure the two components in ServiceMix. Notice that ServiceMix is doing the routing here using <B>destinationService</B>.</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><beans <SPAN class="code-keyword">xmlns:sm</SPAN>=<SPAN class="code-quote">"http://servicemix.apache.org/config/1.0"</SPAN>
+ <SPAN class="code-keyword">xmlns:foo</SPAN>=<SPAN class="code-quote">"http://servicemix.org/cheese/"</SPAN>>
+
+ <SPAN class="code-tag"><sm:container id=<SPAN class="code-quote">"jbi"</SPAN> embedded=<SPAN class="code-quote">"true"</SPAN>></SPAN>
+ <SPAN class="code-tag"><sm:activationSpecs></SPAN>
+
+ <SPAN class="code-tag"><sm:activationSpec componentName=<SPAN class="code-quote">"sender"</SPAN> service=<SPAN class="code-quote">"foo:sender"</SPAN> destinationService=<SPAN class="code-quote">"foo:receiver"</SPAN>></SPAN>
+ <SPAN class="code-tag"><sm:component></SPAN><SPAN class="code-tag"><bean class=<SPAN class="code-quote">"org.apache.servicemix.components.pojo.MySender"</SPAN> /></SPAN><SPAN class="code-tag"></sm:component></SPAN>
+ <SPAN class="code-tag"></sm:activationSpec></SPAN>
+
+ <SPAN class="code-tag"><sm:activationSpec id=<SPAN class="code-quote">"receiver"</SPAN> service=<SPAN class="code-quote">"foo:receiver"</SPAN>></SPAN>
+ <SPAN class="code-tag"><sm:component></SPAN><SPAN class="code-tag"><bean class=<SPAN class="code-quote">"org.apache.servicemix.components.pojo.MyReceiver"</SPAN>/></SPAN><SPAN class="code-tag"></sm:component></SPAN>
+ <SPAN class="code-tag"></sm:activationSpec></SPAN>
+ <SPAN class="code-tag"></sm:activationSpecs></SPAN>
+ <SPAN class="code-tag"></sm:container></SPAN>
+
+<SPAN class="code-tag"></beans></SPAN></PRE>
+</DIV></DIV>
<P> </P>
<P>Now lets look at the sender POJO. The sendMessages() method will send messages onto the JBI bus to the destination service specified in the above XML.</P>
-
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java"><SPAN class="code-keyword">public</SPAN> class MySender <SPAN class="code-keyword">implements</SPAN> ComponentLifeCycle {
+ <SPAN class="code-keyword">private</SPAN> ComponentContext context;
+ <SPAN class="code-keyword">private</SPAN> ObjectName extensionMBeanName;
+
+
+ /**
+ * Sends a number of messages
+ */
+ <SPAN class="code-keyword">public</SPAN> void sendMessages(<SPAN class="code-object">int</SPAN> count) <SPAN class="code-keyword">throws</SPAN> MessagingException {
+ DeliveryChannel deliveryChannel = context.getDeliveryChannel();
+ MessageExchangeFactory factory = deliveryChannel.createExchangeFactory();
+
+ <SPAN class="code-keyword">for</SPAN> (<SPAN class="code-object">int</SPAN> i = 0; i < count; i++) {
+ InOnly exchange = factory.createInOnlyExchange();
+ NormalizedMessage message = exchange.createMessage();
+ exchange.setInMessage(message);
+
+ message.setProperty(<SPAN class="code-quote">"id"</SPAN>, <SPAN class="code-keyword">new</SPAN> <SPAN class="code-object">Integer</SPAN>(i));
+ message.setContent(<SPAN class="code-keyword">new</SPAN> StringSource(<SPAN class="code-quote">"<example id='"</SPAN> + i + <SPAN class="code-quote">"'/>"</SPAN>));
+
+ deliveryChannel.send(exchange);
+ }
+ }
+
+ <SPAN class="code-comment">// ComponentLifeCycle <SPAN class="code-keyword">interface</SPAN>
+</SPAN> <SPAN class="code-comment">//-------------------------------------------------------------------------
+</SPAN> <SPAN class="code-keyword">public</SPAN> ObjectName getExtensionMBeanName() {
+ <SPAN class="code-keyword">return</SPAN> extensionMBeanName;
+ }
+
+ <SPAN class="code-keyword">public</SPAN> void init(ComponentContext context) <SPAN class="code-keyword">throws</SPAN> JBIException {
+ <SPAN class="code-keyword">this</SPAN>.context = context;
+ }
+
+ <SPAN class="code-keyword">public</SPAN> void shutDown() <SPAN class="code-keyword">throws</SPAN> JBIException {
+ }
+
+ <SPAN class="code-keyword">public</SPAN> void start() <SPAN class="code-keyword">throws</SPAN> JBIException {
+ }
+
+ <SPAN class="code-keyword">public</SPAN> void stop() <SPAN class="code-keyword">throws</SPAN> JBIException {
+ }
+
+
+ <SPAN class="code-comment">// Properties
+</SPAN> <SPAN class="code-comment">//-------------------------------------------------------------------------
+</SPAN> <SPAN class="code-keyword">public</SPAN> void setExtensionMBeanName(ObjectName extensionMBeanName) {
+ <SPAN class="code-keyword">this</SPAN>.extensionMBeanName = extensionMBeanName;
+ }
+}</PRE>
+</DIV></DIV>
<P> </P>
<P>Then the receiver processes inbound messages as follows.</P>
-
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java"><SPAN class="code-keyword">public</SPAN> class MyReceiver <SPAN class="code-keyword">implements</SPAN> ComponentLifeCycle, MessageExchangeListener {
+ <SPAN class="code-keyword">private</SPAN> <SPAN class="code-keyword">static</SPAN> <SPAN class="code-keyword">final</SPAN> Log log = LogFactory.getLog(MyReceiver.class);
+
+ <SPAN class="code-keyword">private</SPAN> ComponentContext context;
+ <SPAN class="code-keyword">private</SPAN> ObjectName extensionMBeanName;
+ <SPAN class="code-keyword">private</SPAN> MessageList messageList = <SPAN class="code-keyword">new</SPAN> MessageList();
+
+
+ <SPAN class="code-comment">// ComponentLifeCycle <SPAN class="code-keyword">interface</SPAN>
+</SPAN> <SPAN class="code-comment">//-------------------------------------------------------------------------
+</SPAN> <SPAN class="code-keyword">public</SPAN> ObjectName getExtensionMBeanName() {
+ <SPAN class="code-keyword">return</SPAN> extensionMBeanName;
+ }
+
+ <SPAN class="code-keyword">public</SPAN> void init(ComponentContext context) <SPAN class="code-keyword">throws</SPAN> JBIException {
+ <SPAN class="code-keyword">this</SPAN>.context = context;
+
+ <SPAN class="code-comment">// Lets activate myself
+</SPAN> context.activateEndpoint(<SPAN class="code-keyword">new</SPAN> QName(<SPAN class="code-quote">"http:<SPAN class="code-comment">//servicemix.org/cheese/"</SPAN>, <SPAN class="code-quote">"receiver"</SPAN>), <SPAN class="code-quote">"receiver"</SPAN>);
+</SPAN> }
+
+ <SPAN class="code-keyword">public</SPAN> void shutDown() <SPAN class="code-keyword">throws</SPAN> JBIException {
+ }
+
+ <SPAN class="code-keyword">public</SPAN> void start() <SPAN class="code-keyword">throws</SPAN> JBIException {
+ }
+
+ <SPAN class="code-keyword">public</SPAN> void stop() <SPAN class="code-keyword">throws</SPAN> JBIException {
+ }
+
+ <SPAN class="code-comment">// MessageExchangeListener <SPAN class="code-keyword">interface</SPAN>
+</SPAN> <SPAN class="code-comment">//-------------------------------------------------------------------------
+</SPAN> <SPAN class="code-keyword">public</SPAN> void onMessageExchange(MessageExchange exchange) <SPAN class="code-keyword">throws</SPAN> MessagingException {
+ log.info(<SPAN class="code-quote">"Received message "</SPAN> + exchange);
+ NormalizedMessage message = exchange.getMessage(<SPAN class="code-quote">"in"</SPAN>);
+ getMessageList().addMessage(message);
+ exchange.setStatus(ExchangeStatus.DONE);
+ context.getDeliveryChannel().send(exchange);
+ }
+
+ <SPAN class="code-comment">// Properties
+</SPAN> <SPAN class="code-comment">//-------------------------------------------------------------------------
+</SPAN> <SPAN class="code-keyword">public</SPAN> void setExtensionMBeanName(ObjectName extensionMBeanName) {
+ <SPAN class="code-keyword">this</SPAN>.extensionMBeanName = extensionMBeanName;
+ }
+
+ <SPAN class="code-keyword">public</SPAN> MessageList getMessageList() {
+ <SPAN class="code-keyword">return</SPAN> messageList;
+ }
+
+ <SPAN class="code-keyword">public</SPAN> void setMessageList(MessageList messageList) {
+ <SPAN class="code-keyword">this</SPAN>.messageList = messageList;
+ }
+}</PRE>
+</DIV></DIV>
<P> </P>
<H2><A name="POJOsupport-BeingevenmorePOJO"></A>Being even more POJO</H2>
@@ -143,11 +267,48 @@
<P>Another option is to be even more POJO-like. If you just want to invoke operations on the JBI bus then there's no need for you to implement the JBI component or lifecycle contract - you can just reuse the <A href="client-api.html" title="Client API">Client API</A>.</P>
<P>For example this POJO sends messages into the JBI bus.</P>
-
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java"><SPAN class="code-keyword">public</SPAN> class PojoSender {
+ <SPAN class="code-keyword">private</SPAN> ServiceMixClient client;
+
+ <SPAN class="code-keyword">public</SPAN> void sendMessages(<SPAN class="code-object">int</SPAN> count) <SPAN class="code-keyword">throws</SPAN> MessagingException {
+ <SPAN class="code-keyword">for</SPAN> (<SPAN class="code-object">int</SPAN> i = 0; i < count; i++) {
+ InOnly exchange = client.createInOnlyExchange();
+ NormalizedMessage message = exchange.getInMessage();
+
+ message.setProperty(<SPAN class="code-quote">"id"</SPAN>, <SPAN class="code-keyword">new</SPAN> <SPAN class="code-object">Integer</SPAN>(i));
+ message.setContent(<SPAN class="code-keyword">new</SPAN> StringSource(<SPAN class="code-quote">"<example id='"</SPAN> + i + <SPAN class="code-quote">"'/>"</SPAN>));
+
+ client.send(exchange);
+ }
+ }
+
+ <SPAN class="code-keyword">public</SPAN> ServiceMixClient getClient() {
+ <SPAN class="code-keyword">return</SPAN> client;
+ }
+
+ <SPAN class="code-keyword">public</SPAN> void setClient(ServiceMixClient client) {
+ <SPAN class="code-keyword">this</SPAN>.client = client;
+ }
+}</PRE>
+</DIV></DIV>
<P> </P>
<P>And this is a POJO receiver which just consumes the messages its given, without explicitly implementing the component or lifecycle interfaces</P>
-
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java"><SPAN class="code-keyword">public</SPAN> class PojoReceiver <SPAN class="code-keyword">implements</SPAN> MessageExchangeListener {
+ <SPAN class="code-keyword">private</SPAN> MessageList messageList = <SPAN class="code-keyword">new</SPAN> MessageList();
+
+ <SPAN class="code-keyword">public</SPAN> void onMessageExchange(MessageExchange exchange) <SPAN class="code-keyword">throws</SPAN> MessagingException {
+ NormalizedMessage message = exchange.getMessage(<SPAN class="code-quote">"in"</SPAN>);
+ getMessageList().addMessage(message);
+ }
+
+ <SPAN class="code-keyword">public</SPAN> MessageList getMessageList() {
+ <SPAN class="code-keyword">return</SPAN> messageList;
+ }
+}</PRE>
+</DIV></DIV>
<P> </P></DIV>
</DIV>
@@ -158,8 +319,8 @@
</DIV>
<DIV id="site-footer">
Added by <A href="http://goopen.org/confluence/users/viewuserprofile.action?username=jstrachan">James Strachan</A>,
- last edited by <A href="http://goopen.org/confluence/users/viewuserprofile.action?username=gnodet">Guillaume Nodet</A> on May 11, 2006
- (<A href="http://goopen.org/confluence/pages/diffpages.action?pageId=1936&originalId=5192">view change</A>)
+ last edited by <A href="http://goopen.org/confluence/users/viewuserprofile.action?username=gnodet">Guillaume Nodet</A> on Nov 08, 2006
+ (<A href="http://goopen.org/confluence/pages/diffpages.action?pageId=1936&originalId=14803">view change</A>)
(<A href="http://goopen.org/confluence/pages/editpage.action?pageId=1936">edit page</A>)
</DIV>
Modified: incubator/servicemix/site/main/quartz.html
URL: http://svn.apache.org/viewvc/incubator/servicemix/site/main/quartz.html?view=diff&rev=471540&r1=471539&r2=471540
==============================================================================
--- incubator/servicemix/site/main/quartz.html (original)
+++ incubator/servicemix/site/main/quartz.html Sun Nov 5 13:49:09 2006
@@ -36,7 +36,7 @@
<TR>
<TD align="left" valign="middle" nowrap="">
<DIV id="site-breadcrumbs">
-<A href="home.html" title="ServiceMix">ServiceMix</A> > <A href="home.html" title="Home">Home</A> > <A href="documentation.html" title="Documentation">Documentation</A> > <A href="components.html" title="Components">Components</A> > <A href="lightweight-components.html" title="Lightweight components">Lightweight components</A> > <A href="" title="Quartz">Quartz</A>
+<A href="home.html" title="ServiceMix">ServiceMix</A> > <A href="home.html" title="Home">Home</A> > <A href="documentation.html" title="Documentation">Documentation</A> > <A href="components-list.html" title="Components list">Components list</A> > <A href="lightweight-components.html" title="Lightweight components">Lightweight components</A> > <A href="" title="Quartz">Quartz</A>
</DIV>
</TD>
<TD align="right" valign="middle" nowrap="">
@@ -118,7 +118,28 @@
<BR clear="all">
<BR clear="all">
Here's an example of configuring a quartz component. You can add as many triggers as you wish to the component, at different timing intervals.</P>
-
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><sm:activationSpec componentName=<SPAN class="code-quote">"timer"</SPAN> service=<SPAN class="code-quote">"my:timer"</SPAN> destinationService=<SPAN class="code-quote">"my:receiver"</SPAN>></SPAN>
+ <SPAN class="code-tag"><sm:component></SPAN><SPAN class="code-tag"><bean class=<SPAN class="code-quote">"org.apache.servicemix.components.quartz.QuartzComponent"</SPAN>></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"triggers"</SPAN>></SPAN>
+ <SPAN class="code-tag"><map></SPAN>
+ <SPAN class="code-tag"><entry></SPAN>
+ <SPAN class="code-tag"><key></SPAN>
+ <SPAN class="code-tag"><bean class=<SPAN class="code-quote">"org.quartz.SimpleTrigger"</SPAN>></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"repeatInterval"</SPAN> value=<SPAN class="code-quote">"200"</SPAN>/></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"repeatCount"</SPAN> value=<SPAN class="code-quote">"20"</SPAN>/></SPAN>
+ <SPAN class="code-tag"></bean></SPAN>
+ <SPAN class="code-tag"></key></SPAN>
+ <SPAN class="code-tag"><bean class=<SPAN class="code-quote">"org.quartz.JobDetail"</SPAN>></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"name"</SPAN> value=<SPAN class="code-quote">"My Example Job"</SPAN>/></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"group"</SPAN> value=<SPAN class="code-quote">"ServiceMix"</SPAN>/></SPAN>
+ <SPAN class="code-tag"></bean></SPAN>
+ <SPAN class="code-tag"></entry></SPAN>
+ <SPAN class="code-tag"></map></SPAN>
+ <SPAN class="code-tag"></property></SPAN>
+ <SPAN class="code-tag"></bean></SPAN><SPAN class="code-tag"></sm:component></SPAN>
+<SPAN class="code-tag"></sm:activationSpec></SPAN></PRE>
+</DIV></DIV>
<P><B>Notes:</B></P>
<UL>
<LI>The <SPAN class="nobr"><A href="http://www.opensymphony.com/quartz/api/org/quartz/SimpleTrigger.html" title="Visit page outside Confluence" rel="nofollow">SimpleTrigger<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> repeatCount value count is starting at zero, meaning repeatCount=0 triggers once, <B>repeatCount=1 triggers twice</B> etc. (Quartz v1.5)</LI>
@@ -163,35 +184,9 @@
</DIV>
<DIV id="site-footer">
Added by <A href="http://goopen.org/confluence/users/viewuserprofile.action?username=jstrachan">James Strachan</A>,
- last edited by <A href="http://goopen.org/confluence/users/viewuserprofile.action?username=georg_dembowski">Georg Dembowski</A> on Oct 07, 2006
- (<A href="http://goopen.org/confluence/pages/diffpages.action?pageId=1982&originalId=14012">view change</A>)
- <SPAN id="show" class="inline-control-link"><A href="" onclick="showComment(); return false;">show comment</A></SPAN>
- <SPAN id="hide" class="inline-control-link" style="display:none;"><A href="" onclick="hideComment(); return false;">hide comment</A></SPAN>
- <DIV id="versionComment" class="noteMacro" style="display:none; padding: 5px;">
- <B>Comment:</B>
- INS further explanation/help<BR>
- <SPAN class="smalltext"><A href="http://goopen.org/confluence/pages/viewpreviouspageversions.action?pageId=1982">View page history</A></SPAN>
- </DIV>
-
- <SCRIPT>
- var show = document.getElementById('show');
- var hide = document.getElementById('hide');
- var versionComment = document.getElementById('versionComment');
-
- function showComment(){
- show.style.display = 'none';
- hide.style.display = 'inline';
- versionComment.style.display = 'block';
- }
-
- function hideComment(){
- show.style.display = 'inline';
- hide.style.display = 'none';
- versionComment.style.display = 'none';
- }
-
- </SCRIPT>
-
+ last edited by <A href="http://goopen.org/confluence/users/viewuserprofile.action?username=gnodet">Guillaume Nodet</A> on Nov 08, 2006
+ (<A href="http://goopen.org/confluence/pages/diffpages.action?pageId=1982&originalId=14804">view change</A>)
+
(<A href="http://goopen.org/confluence/pages/editpage.action?pageId=1982">edit page</A>)
</DIV>
Modified: incubator/servicemix/site/main/reflection.html
URL: http://svn.apache.org/viewvc/incubator/servicemix/site/main/reflection.html?view=diff&rev=471540&r1=471539&r2=471540
==============================================================================
--- incubator/servicemix/site/main/reflection.html (original)
+++ incubator/servicemix/site/main/reflection.html Sun Nov 5 13:49:09 2006
@@ -36,7 +36,7 @@
<TR>
<TD align="left" valign="middle" nowrap="">
<DIV id="site-breadcrumbs">
-<A href="home.html" title="ServiceMix">ServiceMix</A> > <A href="home.html" title="Home">Home</A> > <A href="documentation.html" title="Documentation">Documentation</A> > <A href="components.html" title="Components">Components</A> > <A href="lightweight-components.html" title="Lightweight components">Lightweight components</A> > <A href="" title="Reflection">Reflection</A>
+<A href="home.html" title="ServiceMix">ServiceMix</A> > <A href="home.html" title="Home">Home</A> > <A href="documentation.html" title="Documentation">Documentation</A> > <A href="components-list.html" title="Components list">Components list</A> > <A href="lightweight-components.html" title="Lightweight components">Lightweight components</A> > <A href="" title="Reflection">Reflection</A>
</DIV>
</TD>
<TD align="right" valign="middle" nowrap="">
@@ -113,21 +113,37 @@
<!--
<div class="pagetitle">Reflection</div>
-->
- <DIV class="wiki-content">
-<P>There are two JBI components for InOnly and InOut which create dynamic proxies which when methods are invoked they are dispatched into the JBI container.</P>
+ <DIV class="wiki-content"><P>There are two JBI components for InOnly and InOut which create dynamic proxies which when methods are invoked they are dispatched into the JBI container.</P>
-<P>For input the JBI components attach the reflection method invocation proxy, method name and arguments to the inbound MessageExchange for the JBI container to route. For output, the attached <SPAN class="nobr"><A href="http://servicemix.codehaus.org/maven/apidocs/org/servicemix/client/Marshaler.html" title="Visit page outside Confluence" rel="nofollow">Marshaler<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> is used to turn the response into a POJO.</P>
+<P>For input the JBI components attach the reflection method invocation proxy, method name and arguments to the inbound MessageExchange for the JBI container to route. For output, the attached <SPAN class="nobr"><A href="http://incubator.apache.org/servicemix/dist/servicemix-3.0-incubating/site/servicemix-core/apidocs/org/apache/servicemix/jbi/messaging/PojoMarshaler.html" title="Visit page outside Confluence" rel="nofollow">Marshaler<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> is used to turn the response into a POJO.</P>
<H3><A name="Reflection-InOnly"></A>InOnly</H3>
<P>This example shows an InOnly reflection component being configured. This component then creates a dynamic proxy which when a method is invoked it will be passed into the JBI container.</P>
-
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><sm:activationSpec componentName=<SPAN class="code-quote">"proxyCounter"</SPAN>
+ endpoint=<SPAN class="code-quote">"proxyCounter"</SPAN>
+ service=<SPAN class="code-quote">"foo:proxyCounter"</SPAN>
+ destinationService=<SPAN class="code-quote">"foo:reflectionCounter"</SPAN>>
+ <SPAN class="code-tag"><sm:component></SPAN><SPAN class="code-tag"><bean class=<SPAN class="code-quote">"org.apache.servicemix.components.reflection.ProxyInOnlyBinding"</SPAN>></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"target"</SPAN> ref=<SPAN class="code-quote">"counter"</SPAN>/></SPAN>
+ <SPAN class="code-tag"></bean></SPAN><SPAN class="code-tag"></sm:component></SPAN>
+<SPAN class="code-tag"></sm:activationSpec></SPAN></PRE>
+</DIV></DIV>
<P> </P>
<H3><A name="Reflection-InOut"></A>InOut</H3>
<P>This example performs an InOut. So the dynamic proxy will call into the JBI container, block until a response is available and then return the unmarshalled value to the caller of the dynamic proxy's method.</P>
-
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><sm:activationSpec componentName=<SPAN class="code-quote">"reflectionCounter"</SPAN>
+ service=<SPAN class="code-quote">"foo:reflectionCounter"</SPAN>
+ endpoint=<SPAN class="code-quote">"reflectionCounter"</SPAN>>
+ <SPAN class="code-tag"><sm:component></SPAN><SPAN class="code-tag"><bean class=<SPAN class="code-quote">"org.apache.servicemix.components.reflection.ReflectionOutBinding"</SPAN>></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"target"</SPAN> ref=<SPAN class="code-quote">"counter"</SPAN>/></SPAN>
+ <SPAN class="code-tag"></bean></SPAN><SPAN class="code-tag"></sm:component></SPAN>
+<SPAN class="code-tag"></sm:activationSpec></SPAN></PRE>
+</DIV></DIV>
<P> </P></DIV>
</DIV>
@@ -138,8 +154,8 @@
</DIV>
<DIV id="site-footer">
Added by <A href="http://goopen.org/confluence/users/viewuserprofile.action?username=jstrachan">James Strachan</A>,
- last edited by <A href="http://goopen.org/confluence/users/viewuserprofile.action?username=gnodet">Guillaume Nodet</A> on May 11, 2006
- (<A href="http://goopen.org/confluence/pages/diffpages.action?pageId=2008&originalId=5194">view change</A>)
+ last edited by <A href="http://goopen.org/confluence/users/viewuserprofile.action?username=gnodet">Guillaume Nodet</A> on Nov 08, 2006
+ (<A href="http://goopen.org/confluence/pages/diffpages.action?pageId=2008&originalId=14805">view change</A>)
(<A href="http://goopen.org/confluence/pages/editpage.action?pageId=2008">edit page</A>)
</DIV>
Modified: incubator/servicemix/site/main/rss.html
URL: http://svn.apache.org/viewvc/incubator/servicemix/site/main/rss.html?view=diff&rev=471540&r1=471539&r2=471540
==============================================================================
--- incubator/servicemix/site/main/rss.html (original)
+++ incubator/servicemix/site/main/rss.html Sun Nov 5 13:49:09 2006
@@ -113,15 +113,35 @@
<!--
<div class="pagetitle">RSS</div>
-->
- <DIV class="wiki-content">
-<P>We support working with RSS and Atom via the <SPAN class="nobr"><A href="http://wiki.java.net/bin/view/Javawsxml/Rome" title="Visit page outside Confluence" rel="nofollow">Rome<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>library. We support both the polling of existing RSS feeds to generate JBI messages and the generation of RSS feeds from JBI messages.</P>
+ <DIV class="wiki-content"><P>We support working with RSS and Atom via the <SPAN class="nobr"><A href="http://wiki.java.net/bin/view/Javawsxml/Rome" title="Visit page outside Confluence" rel="nofollow">Rome<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>library. We support both the polling of existing RSS feeds to generate JBI messages and the generation of RSS feeds from JBI messages.</P>
<H2><A name="RSS-PollingRSS%2FAtomfeeds"></A>Polling RSS/Atom feeds</H2>
-<P>To see this component in action see the <SPAN class="nobr"><A href="http://goopen.org/confluence/pages/createpage.action?spaceKey=SM&title=RSS-binding&linkCreation=true&fromPageId=1899" title="Create Page: RSS-binding" class="createlink">Example<SUP><IMG class="rendericon" src="http://goopen.org/confluence/images/icons/plus.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN> in the <A href="download.html" title="Download">binary distribution</A>.</P>
+<P>To see this component in action see the <A href="rss-binding.html" title="RSS-binding">Example</A> in the <A href="download.html" title="Download">binary distribution</A>.</P>
<P>You can configure the RSS component as follows in your servicemix.xml</P>
-
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><SPAN class="code-comment"><!-- lets poll for updates to news sites --></SPAN></SPAN>
+<SPAN class="code-tag"><sm:activationSpec componentName=<SPAN class="code-quote">"rss"</SPAN> service=<SPAN class="code-quote">"my:rss"</SPAN> destinationService=<SPAN class="code-quote">"my:trace"</SPAN>></SPAN>
+ <SPAN class="code-tag"><sm:component></SPAN>
+ <SPAN class="code-tag"><bean class=<SPAN class="code-quote">"org.apache.servicemix.components.rss.RssPollingComponent"</SPAN>></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"outputType"</SPAN> value=<SPAN class="code-quote">"rss_2.0"</SPAN>/></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"period"</SPAN> value=<SPAN class="code-quote">"5000"</SPAN>/></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"lastPolledDate"</SPAN>></SPAN>
+ <SPAN class="code-tag"><value></SPAN>2005/08/10<SPAN class="code-tag"></value></SPAN>
+ <SPAN class="code-tag"></property></SPAN>
+
+
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"urlStrings"</SPAN>></SPAN>
+ <SPAN class="code-tag"><list></SPAN>
+ <SPAN class="code-tag"><value></SPAN>http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss.xml<SPAN class="code-tag"></value></SPAN>
+ <SPAN class="code-tag"><value></SPAN>http://rss.cnn.com/rss/cnn_topstories.rss<SPAN class="code-tag"></value></SPAN>
+ <SPAN class="code-tag"></list></SPAN>
+ <SPAN class="code-tag"></property></SPAN>
+ <SPAN class="code-tag"></bean></SPAN>
+ <SPAN class="code-tag"></sm:component></SPAN>
+<SPAN class="code-tag"></sm:activationSpec></SPAN></PRE>
+</DIV></DIV>
<P> </P>
<H2><A name="RSS-GeneratingRSS%2FAtomfeeds"></A>Generating RSS/Atom feeds</H2>
@@ -129,7 +149,27 @@
<P>This component is used to consume inbound JBI messages and write them to an RSS/Atom feed. You can then use expressions to extract the title and entry content for the items.</P>
<P>The following example shows using XPath expression</P>
-
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><sm:activationSpec componentName=<SPAN class="code-quote">"feedWriter"</SPAN>
+ service=<SPAN class="code-quote">"foo:feedWriter"</SPAN>>
+ <SPAN class="code-tag"><sm:component></SPAN><SPAN class="code-tag"><bean class=<SPAN class="code-quote">"org.apache.servicemix.components.rss.FeedWriter"</SPAN>></SPAN>
+
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"feedFile"</SPAN> value=<SPAN class="code-quote">"file:target/serviceMixFeed.xml"</SPAN> /></SPAN>
+
+ <SPAN class="code-tag"><SPAN class="code-comment"><!-- define expressions for the entry title and value --></SPAN></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"entryTitle"</SPAN>></SPAN>
+ <SPAN class="code-tag"><bean class=<SPAN class="code-quote">"org.apache.servicemix.expression.JaxenStringXPathExpression"</SPAN>></SPAN>
+ <SPAN class="code-tag"><constructor-arg value=<SPAN class="code-quote">"concat('Message ', /sample/@id, ' - ', /sample/@sent)"</SPAN> /></SPAN>
+ <SPAN class="code-tag"></bean></SPAN>
+ <SPAN class="code-tag"></property></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"entryValue"</SPAN>></SPAN>
+ <SPAN class="code-tag"><bean class=<SPAN class="code-quote">"org.apache.servicemix.expression.JaxenStringXPathExpression"</SPAN>></SPAN>
+ <SPAN class="code-tag"><constructor-arg value=<SPAN class="code-quote">"concat('This is an entry with ID ', /sample/@id, ' sent: ', /sample/@sent, '. There is not much else in the message to tell :)')"</SPAN> /></SPAN>
+ <SPAN class="code-tag"></bean></SPAN>
+ <SPAN class="code-tag"></property></SPAN>
+ <SPAN class="code-tag"></bean></SPAN><SPAN class="code-tag"></sm:component></SPAN>
+<SPAN class="code-tag"></sm:activationSpec></SPAN></PRE>
+</DIV></DIV>
<P> </P></DIV>
</DIV>
@@ -141,7 +181,7 @@
<DIV id="site-footer">
Added by <A href="http://goopen.org/confluence/users/viewuserprofile.action?username=rajdavies">Rob Davies</A>,
last edited by <A href="http://goopen.org/confluence/users/viewuserprofile.action?username=gnodet">Guillaume Nodet</A> on Nov 08, 2006
- (<A href="http://goopen.org/confluence/pages/diffpages.action?pageId=1899&originalId=14785">view change</A>)
+ (<A href="http://goopen.org/confluence/pages/diffpages.action?pageId=1899&originalId=14806">view change</A>)
(<A href="http://goopen.org/confluence/pages/editpage.action?pageId=1899">edit page</A>)
</DIV>
Modified: incubator/servicemix/site/main/saaj.html
URL: http://svn.apache.org/viewvc/incubator/servicemix/site/main/saaj.html?view=diff&rev=471540&r1=471539&r2=471540
==============================================================================
--- incubator/servicemix/site/main/saaj.html (original)
+++ incubator/servicemix/site/main/saaj.html Sun Nov 5 13:49:09 2006
@@ -36,7 +36,7 @@
<TR>
<TD align="left" valign="middle" nowrap="">
<DIV id="site-breadcrumbs">
-<A href="home.html" title="ServiceMix">ServiceMix</A> > <A href="home.html" title="Home">Home</A> > <A href="documentation.html" title="Documentation">Documentation</A> > <A href="components.html" title="Components">Components</A> > <A href="lightweight-components.html" title="Lightweight components">Lightweight components</A> > <A href="" title="SAAJ">SAAJ</A>
+<A href="home.html" title="ServiceMix">ServiceMix</A> > <A href="home.html" title="Home">Home</A> > <A href="documentation.html" title="Documentation">Documentation</A> > <A href="components-list.html" title="Components list">Components list</A> > <A href="lightweight-components.html" title="Lightweight components">Lightweight components</A> > <A href="" title="SAAJ">SAAJ</A>
</DIV>
</TD>
<TD align="right" valign="middle" nowrap="">
@@ -123,11 +123,31 @@
<H3><A name="SAAJ-InvokingWebServicesUsingSAAJ"></A>Invoking Web Services Using SAAJ</H3>
<P>ServiceMix includes a component for invoking web services using SAAJ and Axis via JBI, as an InOut message exchange. The InOut message exchange pattern (MEP) is a request response pattern where the output message is replaced by a fault, if the message is not successful. For more details on the InOut MEP please see <SPAN class="nobr"><A href="http://www.jcp.org/en/jsr/detail?id=208" title="Visit page outside Confluence" rel="nofollow">JSR 208<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>. The following example invokes a web service to ask for a <SPAN class="nobr"><A href="http://xmethods.net/ve2/ViewListing.po?key=uuid:889A05A5-5C03-AD9B-D456-0E54A527EDEE" title="Visit page outside Confluence" rel="nofollow">stock price<SUP><IMG class="rendericon" src="http://goopen.org/confluence/images/icons/linkext7.gif" height="0" width="0" align="absmiddle" alt="" bord
er="0"></SUP></A></SPAN>:</P>
-
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><sm:activationSpec componentName=<SPAN class="code-quote">"stockQuote"</SPAN> service=<SPAN class="code-quote">"foo:stockQuote"</SPAN> endpoint=<SPAN class="code-quote">"stockQuote"</SPAN>></SPAN>
+ <SPAN class="code-tag"><sm:component></SPAN><SPAN class="code-tag"><bean class=<SPAN class="code-quote">"org.apache.servicemix.components.saaj.SaajBinding"</SPAN>></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"soapEndpoint"</SPAN>></SPAN>
+ <SPAN class="code-tag"><bean class=<SPAN class="code-quote">"javax.xml.messaging.URLEndpoint"</SPAN>></SPAN>
+ <SPAN class="code-tag"><constructor-arg value=<SPAN class="code-quote">"http://64.124.140.30:9090/soap"</SPAN>/></SPAN>
+ <SPAN class="code-tag"></bean></SPAN>
+ <SPAN class="code-tag"></property></SPAN>
+ <SPAN class="code-tag"></bean></SPAN><SPAN class="code-tag"></sm:component></SPAN>
+ <SPAN class="code-tag"></sm:activationSpec></SPAN></PRE>
+</DIV></DIV>
<P>To invoke this function, pass the following request body:</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><ns1:getQuote <SPAN class="code-keyword">xmlns:ns1</SPAN>=<SPAN class="code-quote">"urn:xmethods-delayed-quotes"</SPAN> <SPAN class="code-keyword">xmlns:xsi</SPAN>=<SPAN class="code-quote">"http://www.w3.org/1999/XMLSchema-instance"</SPAN> <SPAN class="code-keyword">xmlns:se</SPAN>=<SPAN class="code-quote">"http://schemas.xmlsoap.org/soap/envelope/"</SPAN> se:encodingStyle=<SPAN class="code-quote">"http://schemas.xmlsoap.org/soap/encoding/"</SPAN>></SPAN>
-<P>Below is the expected response:</P>
+ <SPAN class="code-tag"><symbol xsi:type=<SPAN class="code-quote">"xsd:string"</SPAN>></SPAN>SUNW<SPAN class="code-tag"></symbol></SPAN>
+<SPAN class="code-tag"></ns1:getQuote></SPAN></PRE>
+</DIV></DIV>
+<P>Below is the expected response:</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><n:getQuoteResponse <SPAN class="code-keyword">xmlns:n</SPAN>=<SPAN class="code-quote">"urn:xmethods-delayed-quotes"</SPAN> <SPAN class="code-keyword">xmlns:xsd</SPAN>=<SPAN class="code-quote">"http://www.w3.org/2001/XMLSchema"</SPAN> <SPAN class="code-keyword">xmlns:xsi</SPAN>=<SPAN class="code-quote">"http://www.w3.org/2001/XMLSchema-instance"</SPAN>></SPAN>
+ <SPAN class="code-tag"><Result xsi:type=<SPAN class="code-quote">"xsd:float"</SPAN>></SPAN>3.67<SPAN class="code-tag"></Result></SPAN>
+<SPAN class="code-tag"></n:getQuoteResponse></SPAN></PRE>
+</DIV></DIV>
<H3><A name="SAAJ-AdditionalResources"></A>Additional Resources</H3>
@@ -143,8 +163,8 @@
</DIV>
<DIV id="site-footer">
Added by <A href="http://goopen.org/confluence/users/viewuserprofile.action?username=jstrachan">James Strachan</A>,
- last edited by <A href="http://goopen.org/confluence/users/viewuserprofile.action?username=gnodet">Guillaume Nodet</A> on Aug 08, 2006
- (<A href="http://goopen.org/confluence/pages/diffpages.action?pageId=2006&originalId=9590">view change</A>)
+ last edited by <A href="http://goopen.org/confluence/users/viewuserprofile.action?username=gnodet">Guillaume Nodet</A> on Nov 08, 2006
+ (<A href="http://goopen.org/confluence/pages/diffpages.action?pageId=2006&originalId=14807">view change</A>)
(<A href="http://goopen.org/confluence/pages/editpage.action?pageId=2006">edit page</A>)
</DIV>