servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r430598 - in /incubator/servicemix/site: client-api.html deploying-lightweight-components-tutorial.html jbi-components.html servicemix-jms.html servicemix-jsr181.html
Date Fri, 11 Aug 2006 00:10:09 GMT
Author: chirino
Date: Thu Aug 10 17:10:08 2006
New Revision: 430598

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

Modified:
    incubator/servicemix/site/client-api.html
    incubator/servicemix/site/deploying-lightweight-components-tutorial.html
    incubator/servicemix/site/jbi-components.html
    incubator/servicemix/site/servicemix-jms.html
    incubator/servicemix/site/servicemix-jsr181.html

Modified: incubator/servicemix/site/client-api.html
URL: http://svn.apache.org/viewvc/incubator/servicemix/site/client-api.html?rev=430598&r1=430597&r2=430598&view=diff
==============================================================================
--- incubator/servicemix/site/client-api.html (original)
+++ incubator/servicemix/site/client-api.html Thu Aug 10 17:10:08 2006
@@ -279,7 +279,6 @@
 <P>ServiceMix has integrated support for <A href="uris.html" title="URIs">URIs</A>
to simplify the accessing of endpoints within the <A href="nmr.html" title="NMR">NMR</A>.
The ServiceMixClient (from 3.0-M3 or later) allows you to work with URIs easily via a Destination
interface. This interface acts as a factory of MessageExchange objects which are pre-wired
to specific endpoints specified via a URI.</P>
 
 <P>The following shows how to work with InOnly for one way messaging</P>
-
 <DIV class="code"><DIV class="codeContent">
 <PRE class="code-java">Destination destination = client.createDestination(<SPAN
class="code-quote">&quot;service:http:<SPAN class="code-comment">//servicemix.org/cheese/receiver&quot;</SPAN>);
 </SPAN>InOnly exchange = destination.createInOnlyExchange();
@@ -290,9 +289,7 @@
 
 client.send(exchange);</PRE>
 </DIV></DIV>
-
 <P>Or using InOut for request-response</P>
-
 <DIV class="code"><DIV class="codeContent">
 <PRE class="code-java">Destination destination = client.createDestination(<SPAN
class="code-quote">&quot;service:http:<SPAN class="code-comment">//servicemix.org/cheese/myService&quot;</SPAN>);
 </SPAN>InOut exchange = destination.createInOutExchange();
@@ -309,7 +306,6 @@
 <H3><A name="ClientAPI-SimpleronewaymessagingwithDestinations"></A>Simpler
one-way messaging with Destinations</H3>
 
 <P>For one-way messaging its sometimes simpler to just work with a Message instance
(you can always refer to the MessageExchange via the getExchange() method if need be). For
example</P>
-
 <DIV class="code"><DIV class="codeContent">
 <PRE class="code-java">Destination destination = client.createDestination(<SPAN
class="code-quote">&quot;service:http:<SPAN class="code-comment">//servicemix.org/cheese/receiver&quot;</SPAN>);
 </SPAN>Message message = destination.createInOnlyMessage();
@@ -318,7 +314,6 @@
 
 client.send(message);</PRE>
 </DIV></DIV>
-
 <P>For more detail see the <SPAN class="nobr"><A href="http://svn.apache.org/repos/asf/incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/client/ClientDestinationTest.java"
title="Visit page outside Confluence" rel="nofollow">unit 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></P>
 
 <H2><A name="ClientAPI-UsingthePOJOmethods"></A>Using the POJO methods</H2>
@@ -382,10 +377,22 @@
 <H3><A name="ClientAPI-IfyouhaveaccesstoaComponentContext"></A>If you have
access to a ComponentContext</H3>
 
 <P>If you are inside a JBI component you can create a ServiceMixClient as follows</P>
-
 <DIV class="code"><DIV class="codeContent">
 <PRE class="code-java">ServiceMixClient client = <SPAN class="code-keyword">new</SPAN>
ServiceMixClientFacade(context);</PRE>
-</DIV></DIV></DIV>
+</DIV></DIV>
+
+<H2><A name="ClientAPI-UsingClientFactory"></A>Using ClientFactory</H2>
+
+<P>Starting from 3.0-M3, you can retrieve a ClientFactory from JNDI.</P>
+
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java">ClientFactory factory = <SPAN class="code-keyword">new</SPAN>
InitialContext().lookup(ClientFactory.DEFAULT_JNDI_NAME);
+ServiceMixClient client = factory.createClient();
+...
+client.close();</PRE>
+</DIV></DIV>
+
+<P>Note that creating client is somewhat expensive, so it&apos;s best to create
a client once and reuse it.</P></DIV>
           
                   </DIV>
         </TD>
@@ -395,8 +402,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=jstrachan">James
Strachan</A> on Jul 03, 2006
-                  &nbsp;(<A href="http://goopen.org/confluence/pages/diffpages.action?pageId=1957&originalId=8927">view
change</A>)
+    last edited by     <A href="http://goopen.org/confluence/users/viewuserprofile.action?username=gnodet">Guillaume
Nodet</A> on Aug 08, 2006
+                  &nbsp;(<A href="http://goopen.org/confluence/pages/diffpages.action?pageId=1957&originalId=9596">view
change</A>)
               
       (<A href="http://goopen.org/confluence/pages/editpage.action?pageId=1957">edit
page</A>)
     </DIV>

Modified: incubator/servicemix/site/deploying-lightweight-components-tutorial.html
URL: http://svn.apache.org/viewvc/incubator/servicemix/site/deploying-lightweight-components-tutorial.html?rev=430598&r1=430597&r2=430598&view=diff
==============================================================================
--- incubator/servicemix/site/deploying-lightweight-components-tutorial.html (original)
+++ incubator/servicemix/site/deploying-lightweight-components-tutorial.html Thu Aug 10 17:10:08
2006
@@ -224,27 +224,25 @@
 <!--          
             <div class="pagetitle">Deploying Lightweight Components Tutorial</div>
 -->
-            <DIV class="wiki-content">
-<H2><A name="DeployingLightweightComponentsTutorial-Introduction"></A>Introduction</H2>
+            <DIV class="wiki-content"><H2><A name="DeployingLightweightComponentsTutorial-Introduction"></A>Introduction</H2>
 
 <P>This document discusses how to package and deploy a lightweight component to the
ServiceMix lightweight container (<TT>servicemix-lwcontainer</TT>). The ServiceMix
lightweight container is a service engine JBI component whose purpose is to allow lightweight
components (POJOs) to be deployed at runtime rather than only deploying them statically via
the <TT>servicemix.xml</TT> file. Please see <A href="what-is-a-lightweight-component.html"
title="What is a lightweight component">What is a Lightweight Component</A> for a
good explanation of the different types of JBI components.</P>
 
-<P>As explained in <EM>What is a Lightweight Component</EM> there are two
main use cases for ServiceMix: <BR>
+<P>As explained in <EM>What is a Lightweight Component</EM> there are two
main use cases for ServiceMix:<BR>
 1. As a full JBI container - using ServiceMix as a full JBI container in which you can deploy
Service Assemblies and standard JBI components. And you may also deploy lightweight components
in this mode - they must be deployed to the <TT>servicemix-lwcontainer</TT>.</P>
 
 <P>2. Embedded - this is a static configuration used mainly for testing or perhaps
for encapsulating ServiceMix into a web application. This uses the <TT>servicemix.xml</TT>
file to configure components thare are only deployed when ServiceMix is started, not at runtime.
You cannot deploy service units to this type of ServiceMix configuration at runtime. You would
have to shutdown, reconfigure and then restart.</P>
 
-<P>Just a brief background: A JBI component is either a service engine (SE) or a binding
component (BC). These terms are defined in <A href="introduction-to-esb.html" title="Introduction
to ESB">Introduction to ESB</A> and/or the <A href="glossary.html" title="Glossary">Glossary</A>.
A BC/SE is <B>installed</B> on ServiceMix by copying it into the <TT>install</TT>
directory which resides under the ServiceMix home directory. So what gets deployed? JBI components
can act as containers themselves. Artifacts can be <B>deployed</B> to an existing
BC or SE to add more functionality to that component. Adding artifacts to installed components
is called deployment. To deploy artifacts to a component the artifacts can be placed in the
<TT>deploy</TT> directory under the ServiceMix home directory. A term that is
important to know is <EM>service assembly</EM>. A service assembly is a collection
of deployment artifacts and metadata. A <EM>service unit</EM> is a single deployment
artifact
  which is deployed on a single component. For deployment to happen, the artifacts must be
in a very specific format, which is specified in the JSR 208 specification. Please see chapter
6 of the <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>
specification for more details. </P>
+<P>Just a brief background: A JBI component is either a service engine (SE) or a binding
component (BC). These terms are defined in <A href="introduction-to-esb.html" title="Introduction
to ESB">Introduction to ESB</A> and/or the <A href="glossary.html" title="Glossary">Glossary</A>.
A BC/SE is <B>installed</B> on ServiceMix by copying it into the <TT>install</TT>
directory which resides under the ServiceMix home directory. So what gets deployed? JBI components
can act as containers themselves. Artifacts can be <B>deployed</B> to an existing
BC or SE to add more functionality to that component. Adding artifacts to installed components
is called deployment. To deploy artifacts to a component the artifacts can be placed in the
<TT>deploy</TT> directory under the ServiceMix home directory. A term that is
important to know is <EM>service assembly</EM>. A service assembly is a collection
of deployment artifacts and metadata. A <EM>service unit</EM> is a single deployment
artifact
  which is deployed on a single component. For deployment to happen, the artifacts must be
in a very specific format, which is specified in the JSR 208 specification. Please see chapter
6 of the <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>
specification for more details.</P>
 
-<H2><A name="DeployingLightweightComponentsTutorial-ManuallyCreatingaServiceUnitandServiceAssembly"></A>Manually
Creating a Service Unit and Service Assembly </H2>
+<H2><A name="DeployingLightweightComponentsTutorial-ManuallyCreatingaServiceUnitandServiceAssembly"></A>Manually
Creating a Service Unit and Service Assembly</H2>
 
-<P>We are going to use the existing ServiceMix Loan Broker example, which can be found
<SPAN class="nobr"><A href="http://www.servicemix.org/Loan%20Broker%20example" title="Visit
page outside Confluence" rel="nofollow">Loan Broker Demo for ServiceMix<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>, as the
basis for this discussion. </P>
+<P>We are going to use the existing ServiceMix Loan Broker example, which can be found
<SPAN class="nobr"><A href="http://www.servicemix.org/Loan%20Broker%20example" title="Visit
page outside Confluence" rel="nofollow">Loan Broker Demo for ServiceMix<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>, as the
basis for this discussion.</P>
 
-<P>There are several things to note about this example. First of all it is meant to
be run stand-alone. Specifically, when running this example, ServiceMix will be started for
you, then the loan broker is deployed and run. Therefore, there is a <TT>servicemix.xml</TT>
file in the <TT>loan-broker</TT> directory. This <TT>servicemix.xml</TT>
file is used for configuring the ServiceMix JBI container upon ServiceMix starting up. This
is not to be confused with the <TT>servicemix.xml</TT> located in the <TT>loan-broker\src\su</TT>
directory. The SU <TT>servicemix.xml</TT> file is used to configure the <TT>servicemix-lwcontainer</TT>.
Every service unit must contain some kind of configuration file. For example, if we were creating
a service unit for the BPEL service engine there would also be a configuration file, but it
would not be a <TT>servicemix.xml</TT> file, such as the one used for configuring
the lightweight container. </P>
+<P>There are several things to note about this example. First of all it is meant to
be run stand-alone. Specifically, when running this example, ServiceMix will be started for
you, then the loan broker is deployed and run. Therefore, there is a <TT>servicemix.xml</TT>
file in the <TT>loan-broker</TT> directory. This <TT>servicemix.xml</TT>
file is used for configuring the ServiceMix JBI container upon ServiceMix starting up. This
is not to be confused with the <TT>servicemix.xml</TT> located in the <TT>loan-broker\src\su</TT>
directory. The SU <TT>servicemix.xml</TT> file is used to configure the <TT>servicemix-lwcontainer</TT>.
Every service unit must contain some kind of configuration file. For example, if we were creating
a service unit for the BPEL service engine there would also be a configuration file, but it
would not be a <TT>servicemix.xml</TT> file, such as the one used for configuring
the lightweight container.</P>
 
 <P><B>NOTE:</B> There are two major phases to creating a lightweight component
that is ready for deployment: one, is the development phase of the component, which includes
coding and compiling and building the code, the second phase is creating the packaging necessary
for the component to be installed onto the JBI container. This document will focus on the
second part. Any steps relating to compilation are simply performed here to get us to the
point that we can assemble the component into a JBI service assembly or service unit.</P>
 
-
 <P>In general, there are three steps to creating the SA and deploying it to the ServiceMix
container.</P>
 <OL>
 	<LI>Create the service units.</LI>
@@ -255,7 +253,7 @@
 
 <P>The following provides details on each step above using the loan-broker example
to illustrate.</P>
 
-<P>Although we are not covering the component development phase, in this case we do
need to perform a compile. We will use Apache Ant to compile the loan-broker demo components:
</P>
+<P>Although we are not covering the component development phase, in this case we do
need to perform a compile. We will use Apache Ant to compile the loan-broker demo components:</P>
 <DIV class="code"><DIV class="codeContent">
 <PRE class="code-java">cd [servicemix_dir]\examples\loan-broker
 ant build-components</PRE>
@@ -263,7 +261,6 @@
 <P>This will compile the Java code and put the Java class files into the <TT>[servicemix_dir]\examples\loan-broker\build\loanbroker\components</TT>
directory.</P>
 
 <P>Now we are ready to assemble the lightweight components together. The loan broker
demo supplies us with a <TT>build.xml</TT> file (which was used in the compile
step above). The <TT>build.xml</TT> contains targets for creating service units
and service assemblies. If you run &quot;ant setup&quot; a service unit and service
assembly will automatically be created. Ultimately, this is what you will want to do, however,
the following procedure gives the manual steps for creating a service unit and service assembly,
to facilitate in understanding the contents of a SUs and SAs.</P>
-
 <OL>
 	<LI>First create the service unit. The service unit is a ZIP file that will contain
your application&apos;s Java class files and the <TT>servicemix.xml</TT> configuration
file. The service unit can also contain a <TT>jbi.xml</TT> which provides information
about services statically provided and consumed. In ServiceMix it is optional to include this
file. In the case of our example, we have not included it.
 <BR clear="all">
@@ -293,7 +290,7 @@
 <DIV class="code"><DIV class="codeContent">
 <PRE class="code-java">&lt;?xml version=<SPAN class="code-quote">&quot;1.0&quot;</SPAN>
encoding=<SPAN class="code-quote">&quot;UTF-8&quot;</SPAN>?&gt;
 &lt;jbi xmlns=<SPAN class="code-quote">&quot;http:<SPAN class="code-comment">//java.sun.com/xml/ns/jbi&quot;</SPAN>
version=<SPAN class="code-quote">&quot;1.0&quot;</SPAN>&gt;
-</SPAN>     
+</SPAN>
    &lt;service-assembly&gt;
      &lt;identification&gt;
        &lt;name&gt;loanbroker&lt;/name&gt;
@@ -310,12 +307,12 @@
        &lt;/target&gt;
      &lt;/service-unit&gt;
     &lt;/service-assembly&gt;
-    
+
 &lt;/jbi&gt;</PRE>
 </DIV></DIV>
 <P><BR clear="all">
 <BR clear="all">
-The interesting thing to note is that the <TT>jbi.xml</TT> file tells the JBI
container what service units are in the service assembly and where to deploy them. There is
only one service unit in our example, which is &quot;loanbroker&quot; (see the <TT>artifacts-name</TT>
tag) and the component to which it will be deployed is <TT>servicemix-lwcontainer</TT>
(see the &lt;component-name&gt; tag). There could be multiple service units in a service
assembly and they would each be included in the <TT>jbi.xml</TT> file with the
same type of information for each. 
+The interesting thing to note is that the <TT>jbi.xml</TT> file tells the JBI
container what service units are in the service assembly and where to deploy them. There is
only one service unit in our example, which is &quot;loanbroker&quot; (see the <TT>artifacts-name</TT>
tag) and the component to which it will be deployed is <TT>servicemix-lwcontainer</TT>
(see the &lt;component-name&gt; tag). There could be multiple service units in a service
assembly and they would each be included in the <TT>jbi.xml</TT> file with the
same type of information for each.
 <BR clear="all">
 Create the service assembly ZIP file and include the <TT>loanbroker-su.zip</TT>
file and the <TT>META-INF\jbi.xml</TT> directory and file in it. To remain consistent
with our example, call the zip file <TT>loanbroker-sa.zip</TT>.
 <BR clear="all">
@@ -328,11 +325,45 @@
 </OL>
 
 
-
 <H2><A name="DeployingLightweightComponentsTutorial-RelatedDocumentation"></A>Related
Documentation</H2>
 
-
 <P>The JBI spec describes in detail how to create a valid JBI deployment unit. 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>.</P>
+
+<H2><A name="DeployingLightweightComponentsTutorial-SpringRelatedinformation"></A>Spring
Related information</H2>
+
+<P>Inside the servicemix.xml file, the ability to import the common beans using the
following:</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java">&lt;<SPAN class="code-keyword">import</SPAN>
resource=<SPAN class="code-quote">&quot;classpath:otherBeans.xml&quot;</SPAN>
/&gt;</PRE>
+</DIV></DIV>
+<P>The resource is a SpringResource so the following also works:</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java">&lt;<SPAN class="code-keyword">import</SPAN>
resource=<SPAN class="code-quote">&quot;file:path/to/file/jmx.xml&quot;</SPAN>
/&gt;</PRE>
+</DIV></DIV>
+<P>if you run ServiceMix (or JBoss) with a param:</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java">JAVA_OPTS=<SPAN class="code-quote">&quot;-DMYHOME=somepath/&quot;</SPAN>
+JAVA_OPTS=-DMYHOME=somepath/ # windows</PRE>
+</DIV></DIV>
+<P>then in the servicemix.xml and xbean.xml you can reference MYHOME.</P>
+
+<P>eg:</P>
+
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java">&lt;<SPAN class="code-keyword">import</SPAN>
resource=<SPAN class="code-quote">&quot;file:${MYHOME}/path/to/file/jmx.xml&quot;</SPAN>
/&gt;</PRE>
+</DIV></DIV>
+
+<P>Then you can also import a properties file from this same path to pull in other
config you may need. (that you want outside an SU/SA bundle).</P>
+
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java">&lt;bean id=<SPAN class="code-quote">&quot;propertyConfigurer&quot;</SPAN>
+  class=<SPAN class="code-quote">&quot;org.springframework.beans.factory.config.PropertyPlaceholderConfigurer&quot;</SPAN>&gt;
+  &lt;property name=<SPAN class="code-quote">&quot;locations&quot;</SPAN>&gt;
+    &lt;list&gt;
+      &lt;value&gt;${MYHOME}/conf/config.properties&quot;&lt;/value&gt;
+    &lt;/list&gt;
+  &lt;/property&gt;
+&lt;/bean&gt;</PRE>
+</DIV></DIV>
 </DIV>
           
                   </DIV>
@@ -343,8 +374,8 @@
     </DIV>
     <DIV id="site-footer">
           Added by     <A href="http://goopen.org/confluence/users/viewuserprofile.action?username=lmalgeri">Lisa
Malgeri</A>,
-    last edited by     <A href="http://goopen.org/confluence/users/viewuserprofile.action?username=gnodet">Guillaume
Nodet</A> on May 11, 2006
-                  &nbsp;(<A href="http://goopen.org/confluence/pages/diffpages.action?pageId=1992&originalId=5260">view
change</A>)
+    last edited by     <A href="http://goopen.org/confluence/users/viewuserprofile.action?username=bradtwurst">James
Bradt</A> on Aug 09, 2006
+                  &nbsp;(<A href="http://goopen.org/confluence/pages/diffpages.action?pageId=1992&originalId=9623">view
change</A>)
               
       (<A href="http://goopen.org/confluence/pages/editpage.action?pageId=1992">edit
page</A>)
     </DIV>

Modified: incubator/servicemix/site/jbi-components.html
URL: http://svn.apache.org/viewvc/incubator/servicemix/site/jbi-components.html?rev=430598&r1=430597&r2=430598&view=diff
==============================================================================
--- incubator/servicemix/site/jbi-components.html (original)
+++ incubator/servicemix/site/jbi-components.html Thu Aug 10 17:10:08 2006
@@ -238,16 +238,16 @@
               <a href="javascript:hideChildren()">Hide Children</a></span>
           </div>
           <div class="greybox" id="children" style="display: none;">
-                                      <a href="http://goopen.org/confluence/display/SM/servicemix-
jsr181" title="servicemix- jsr181">servicemix- jsr181</a>
+                                      <a href="http://goopen.org/confluence/display/SM/servicemix-
jms" title="servicemix- jms">servicemix- jms</a>
               <span class="smalltext">(ServiceMix)</span>
               <br>
-                          <a href="http://goopen.org/confluence/display/SM/servicemix-
http" title="servicemix- http">servicemix- http</a>
+                          <a href="http://goopen.org/confluence/display/SM/servicemix-
jsr181" title="servicemix- jsr181">servicemix- jsr181</a>
               <span class="smalltext">(ServiceMix)</span>
               <br>
-                          <a href="http://goopen.org/confluence/display/SM/servicemix-
bpe" title="servicemix- bpe">servicemix- bpe</a>
+                          <a href="http://goopen.org/confluence/display/SM/servicemix-
http" title="servicemix- http">servicemix- http</a>
               <span class="smalltext">(ServiceMix)</span>
               <br>
-                          <a href="http://goopen.org/confluence/display/SM/servicemix-
jms" title="servicemix- jms">servicemix- jms</a>
+                          <a href="http://goopen.org/confluence/display/SM/servicemix-
bpe" title="servicemix- bpe">servicemix- bpe</a>
               <span class="smalltext">(ServiceMix)</span>
               <br>
                           <a href="http://goopen.org/confluence/display/SM/servicemix-
lwcontainer" title="servicemix- lwcontainer">servicemix- lwcontainer</a>

Modified: incubator/servicemix/site/servicemix-jms.html
URL: http://svn.apache.org/viewvc/incubator/servicemix/site/servicemix-jms.html?rev=430598&r1=430597&r2=430598&view=diff
==============================================================================
--- incubator/servicemix/site/servicemix-jms.html (original)
+++ incubator/servicemix/site/servicemix-jms.html Thu Aug 10 17:10:08 2006
@@ -409,44 +409,50 @@
 <TR>
 <TD class="confluenceTd"> initialContextFactory </TD>
 <TD class="confluenceTd"> String </TD>
-<TD class="confluenceTd">&nbsp;</TD>
-<TD class="confluenceTd"> yes (unless a default one is provided on the jms component
configuration) </TD>
+<TD class="confluenceTd"> the JNDI context factory class name </TD>
+<TD class="confluenceTd"> no </TD>
 </TR>
 <TR>
 <TD class="confluenceTd"> jndiProviderURL </TD>
 <TD class="confluenceTd"> String </TD>
-<TD class="confluenceTd">&nbsp;</TD>
-<TD class="confluenceTd"> yes (unless a default one is provided on the jms component
configuration) </TD>
+<TD class="confluenceTd"> the JNDI provide url </TD>
+<TD class="confluenceTd"> no </TD>
 </TR>
 <TR>
-<TD class="confluenceTd"> destinationStyle </TD>
-<TD class="confluenceTd"> String </TD>
-<TD class="confluenceTd">&nbsp;</TD>
-<TD class="confluenceTd"> yes (unless a default one is provided on the jms component
configuration) </TD>
+<TD class="confluenceTd"> connectionFactory </TD>
+<TD class="confluenceTd"> javax.jms.ConnectionFactory </TD>
+<TD class="confluenceTd"> the connectionFactory to use.  This optional property can
be used instead of using JNDI configuration </TD>
+<TD class="confluenceTd"> no </TD>
 </TR>
 <TR>
 <TD class="confluenceTd"> jndiConnectionFactoryName </TD>
 <TD class="confluenceTd"> String </TD>
-<TD class="confluenceTd">&nbsp;</TD>
+<TD class="confluenceTd"> the JNDI name of the JMS ConnectionFactory to lookup </TD>
 <TD class="confluenceTd"> yes (unless a default one is provided on the jms component
configuration) </TD>
 </TR>
 <TR>
+<TD class="confluenceTd"> destination </TD>
+<TD class="confluenceTd"> javax.jms.Destination </TD>
+<TD class="confluenceTd"> the Destination to use. This optional property can be use
instead of jndiDestinationName or jmsProviderDestinationName </TD>
+<TD class="confluenceTd"> no (one of destination, jndiDestinationName or jmsProviderDestinationName)
</TD>
+</TR>
+<TR>
 <TD class="confluenceTd"> jndiDestinationName </TD>
 <TD class="confluenceTd"> String </TD>
-<TD class="confluenceTd">&nbsp;</TD>
-<TD class="confluenceTd"> yes (one of jndiDestinationName or jmsProviderDestinationName)
</TD>
+<TD class="confluenceTd"> the JNDI name of the destination to look up </TD>
+<TD class="confluenceTd"> yes (unless destination or jmsProviderDestinationName is
set) </TD>
 </TR>
 <TR>
 <TD class="confluenceTd"> jmsProviderDestinationName </TD>
 <TD class="confluenceTd"> String </TD>
-<TD class="confluenceTd">&nbsp;</TD>
-<TD class="confluenceTd"> yes (one of jndiDestinationName or jmsProviderDestinationName)
</TD>
+<TD class="confluenceTd"> if used, the target JMS destination will be created by the
JMS provider by calling Session.createQueue or Session.createTopic </TD>
+<TD class="confluenceTd"> no (one of destination, jndiDestinationName or jmsProviderDestinationName)
</TD>
 </TR>
 <TR>
-<TD class="confluenceTd"> connectionFactory </TD>
-<TD class="confluenceTd"> javax.jms.ConnectionFactory </TD>
-<TD class="confluenceTd"> the connectionFactory to use.  This optional property can
be used instead of using JNDI configuration </TD>
-<TD class="confluenceTd"> no </TD>
+<TD class="confluenceTd"> destinationStyle </TD>
+<TD class="confluenceTd"> String </TD>
+<TD class="confluenceTd"> used to select the destination type used with the jmsProviderDestinationName
</TD>
+<TD class="confluenceTd"> no (unless jmsProviderDestinationName is used) </TD>
 </TR>
 </TBODY></TABLE></TD></TR></TABLE>
 <P>The <B>targetService</B>, <B>targetEndpoint</B> and <B>targetInterfaceName</B>
attributes can be used to specify the routing method to use (routing by interface, service
or endpoint) and is also useful to allow several proxy endpoints to be created for the same
JBI endpoint.  For example to create an JMS only endpoint and an JMS+SOAP endpoint, both jms
endpoints will have the same targetEndpoint and targetService, but they must have different
endpoint names.</P>
@@ -518,47 +524,107 @@
 <TR>
 <TD class="confluenceTd"> initialContextFactory </TD>
 <TD class="confluenceTd"> String </TD>
-<TD class="confluenceTd">&nbsp;</TD>
-<TD class="confluenceTd"> yes (unless a default one is provided on the jms component
configuration) </TD>
+<TD class="confluenceTd"> the JNDI context factory class name </TD>
+<TD class="confluenceTd"> no </TD>
 </TR>
 <TR>
 <TD class="confluenceTd"> jndiProviderURL </TD>
 <TD class="confluenceTd"> String </TD>
-<TD class="confluenceTd">&nbsp;</TD>
-<TD class="confluenceTd"> yes (unless a default one is provided on the jms component
configuration) </TD>
+<TD class="confluenceTd"> the JNDI provide url </TD>
+<TD class="confluenceTd"> no </TD>
 </TR>
 <TR>
-<TD class="confluenceTd"> destinationStyle </TD>
-<TD class="confluenceTd"> String </TD>
-<TD class="confluenceTd">&nbsp;</TD>
-<TD class="confluenceTd"> yes (unless a default one is provided on the jms component
configuration) </TD>
+<TD class="confluenceTd"> connectionFactory </TD>
+<TD class="confluenceTd"> javax.jms.ConnectionFactory </TD>
+<TD class="confluenceTd"> the connectionFactory to use.  This optional property can
be used instead of using JNDI configuration </TD>
+<TD class="confluenceTd"> no </TD>
 </TR>
 <TR>
 <TD class="confluenceTd"> jndiConnectionFactoryName </TD>
 <TD class="confluenceTd"> String </TD>
-<TD class="confluenceTd">&nbsp;</TD>
+<TD class="confluenceTd"> the JNDI name of the JMS ConnectionFactory to lookup </TD>
 <TD class="confluenceTd"> yes (unless a default one is provided on the jms component
configuration) </TD>
 </TR>
 <TR>
+<TD class="confluenceTd"> destination </TD>
+<TD class="confluenceTd"> javax.jms.Destination </TD>
+<TD class="confluenceTd"> the Destination to use. This optional property can be use
instead of jndiDestinationName or jmsProviderDestinationName </TD>
+<TD class="confluenceTd"> no (one of destination, jndiDestinationName or jmsProviderDestinationName)
</TD>
+</TR>
+<TR>
 <TD class="confluenceTd"> jndiDestinationName </TD>
 <TD class="confluenceTd"> String </TD>
-<TD class="confluenceTd">&nbsp;</TD>
-<TD class="confluenceTd"> yes (one of jndiDestinationName or jmsProviderDestinationName)
</TD>
+<TD class="confluenceTd"> the JNDI name of the destination to look up </TD>
+<TD class="confluenceTd"> yes (unless destination or jmsProviderDestinationName is
set) </TD>
 </TR>
 <TR>
 <TD class="confluenceTd"> jmsProviderDestinationName </TD>
 <TD class="confluenceTd"> String </TD>
-<TD class="confluenceTd">&nbsp;</TD>
-<TD class="confluenceTd"> yes (one of jndiDestinationName or jmsProviderDestinationName)
</TD>
+<TD class="confluenceTd"> if used, the target JMS destination will be created by the
JMS provider by calling Session.createQueue or Session.createTopic </TD>
+<TD class="confluenceTd"> no (one of destination, jndiDestinationName or jmsProviderDestinationName)
</TD>
 </TR>
 <TR>
-<TD class="confluenceTd"> connectionFactory </TD>
-<TD class="confluenceTd"> javax.jms.ConnectionFactory </TD>
-<TD class="confluenceTd"> the connectionFactory to use.  This optional property can
be used instead of using JNDI configuration </TD>
-<TD class="confluenceTd"> no </TD>
+<TD class="confluenceTd"> destinationStyle </TD>
+<TD class="confluenceTd"> String </TD>
+<TD class="confluenceTd"> used to select the destination type used with the jmsProviderDestinationName
</TD>
+<TD class="confluenceTd"> no (unless jmsProviderDestinationName is used) </TD>
 </TR>
 </TBODY></TABLE></TD></TR></TABLE>
 
+<H2><A name="servicemix-jms-ConfiguringtheConnectionFactoryandDestination"></A>Configuring
the ConnectionFactory and Destination</H2>
+
+<H4><A name="servicemix-jms-JNDIconfiguration"></A>JNDI configuration</H4>
+
+<P>When the ConnectionFactory or the Destination is lookup in JNDI, the JNDI context
will be created in the following order:</P>
+<UL>
+	<LI>using the <B>initialContextFactory</B> and <B>jndiProviderURL</B></LI>
+	<LI>using the <B>initialContextFactory</B> and <B>jndiProviderURL</B>
configured on the component configuration</LI>
+	<LI>using the default context provided by the JBI container</LI>
+</UL>
+
+
+<H4><A name="servicemix-jms-ConnectionFactory"></A>ConnectionFactory</H4>
+
+<P>The JMS ConnectionFactory is retrieved using the properties defined on the endpoint
in the following order:</P>
+<UL>
+	<LI>using <B>connectionFactory</B></LI>
+	<LI>using <B>jndiConnectionFactoryName</B> to lookup the ConnectionFactory
in JNDI</LI>
+	<LI>using the <B>connectionFactory</B> configured on the component configuration</LI>
+	<LI>using the <B>jndiConnectionFactoryName</B> configured on the component
configuration to lookup the ConnectionFactory in JNDI</LI>
+</UL>
+
+
+<H4><A name="servicemix-jms-Destination"></A>Destination</H4>
+
+<P>The JMS Destination is retrieved in the following order:</P>
+<UL>
+	<LI>using <B>destination</B></LI>
+	<LI>using <B>jndiDestinationName</B></LI>
+	<LI>using <B>jmsProviderDestinationName</B> and <B>destinationStyle</B></LI>
+</UL>
+
+
+<H4><A name="servicemix-jms-Examples"></A>Examples</H4>
+
+<P>Using JNDI</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml">&lt;jms:endpoint ...
+    jndiConnectionFactoryName=<SPAN class="code-quote">&quot;java:comp/env/jms/ConnectionFactory&quot;</SPAN>
+    jndiDestinationName=<SPAN class="code-quote">&quot;java:comp/env/jms/MyQueue&quot;</SPAN>
/&gt;</PRE>
+</DIV></DIV>
+
+<P>If you use ActiveMQ, you can use the following definition:</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml">&lt;jms:endpoint ...
+    connectionFactory=<SPAN class="code-quote">&quot;#connectionFactory&quot;</SPAN>
+    destinationStyle=<SPAN class="code-quote">&quot;queue&quot;</SPAN>
+    jmsProviderDestinationName=<SPAN class="code-quote">&quot;MyQueue&quot;</SPAN>
/&gt;
+
+<SPAN class="code-tag">&lt;bean id=<SPAN class="code-quote">&quot;connectionFactory&quot;</SPAN>
class=<SPAN class="code-quote">&quot;org.apache.activemq.ActiveMQConnectionFactory&quot;</SPAN>&gt;</SPAN>
+    <SPAN class="code-tag">&lt;property name=<SPAN class="code-quote">&quot;brokerURL&quot;</SPAN>
value=<SPAN class="code-quote">&quot;tcp://localhost:61216&quot;</SPAN>
/&gt;</SPAN>
+<SPAN class="code-tag">&lt;/bean&gt;</SPAN></PRE>
+</DIV></DIV>
+
 <H2><A name="servicemix-jms-WSDLDeployment"></A>WSDL Deployment</H2>
 
 <P>In addition to xbean based deployment, the component accepts WSDL-based deployment.<BR>
@@ -707,8 +773,8 @@
     </DIV>
     <DIV id="site-footer">
           Added by     <A href="http://goopen.org/confluence/users/viewuserprofile.action?username=gnt">gnt</A>,
-    last edited by     <A href="http://goopen.org/confluence/users/viewuserprofile.action?username=gnodet">Guillaume
Nodet</A> on Jun 02, 2006
-                  &nbsp;(<A href="http://goopen.org/confluence/pages/diffpages.action?pageId=1954&originalId=8532">view
change</A>)
+    last edited by     <A href="http://goopen.org/confluence/users/viewuserprofile.action?username=gnodet">Guillaume
Nodet</A> on Aug 09, 2006
+                  &nbsp;(<A href="http://goopen.org/confluence/pages/diffpages.action?pageId=1954&originalId=9617">view
change</A>)
               
       (<A href="http://goopen.org/confluence/pages/editpage.action?pageId=1954">edit
page</A>)
     </DIV>

Modified: incubator/servicemix/site/servicemix-jsr181.html
URL: http://svn.apache.org/viewvc/incubator/servicemix/site/servicemix-jsr181.html?rev=430598&r1=430597&r2=430598&view=diff
==============================================================================
--- incubator/servicemix/site/servicemix-jsr181.html (original)
+++ incubator/servicemix/site/servicemix-jsr181.html Thu Aug 10 17:10:08 2006
@@ -391,6 +391,18 @@
 
 <H2><A name="servicemix-jsr181-AccessingtheJBIbus"></A>Accessing the JBI
bus</H2>
 
+<P>The prefered way to access the JBI bus is by retrieving a ComponentContext implementation.<BR>
+The spring BeanFactory has a parent factory which contains a bean named &quot;context&quot;
that you can refer to.</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag">&lt;jsr181:endpoint ...&gt;</SPAN>
+  <SPAN class="code-tag">&lt;jsr181:pojo&gt;</SPAN>
+    <SPAN class="code-tag">&lt;bean class=<SPAN class="code-quote">&quot;xxx&quot;</SPAN>&gt;</SPAN>
+      <SPAN class="code-tag">&lt;property name=<SPAN class="code-quote">&quot;context&quot;</SPAN>
ref=<SPAN class="code-quote">&quot;context&quot;</SPAN> /&gt;</SPAN>
+    <SPAN class="code-tag">&lt;/bean&gt;</SPAN>
+  <SPAN class="code-tag">&lt;/jsr181:pojo&gt;</SPAN>
+<SPAN class="code-tag">&lt;/jsr181:endpoint&gt;</SPAN></PRE>
+</DIV></DIV>
+
 <P>If you want to send a request to another service from your POJO, you can add the
following method on your POJO:</P>
 <DIV class="code"><DIV class="codeContent">
 <PRE class="code-java"><SPAN class="code-keyword">private</SPAN> javax.jbi.component.ComponentContext
context;
@@ -440,6 +452,8 @@
 <H2><A name="servicemix-jsr181-Proxies"></A>Proxies</H2>
 
 <P>You can create java proxies for JBI endpoints, provided that they expose a WSDL.</P>
+
+<P>The basic configuration is the following:</P>
 <DIV class="code"><DIV class="codeContent">
 <PRE class="code-xml">&lt;jsr181:proxy id=<SPAN class="code-quote">&quot;proxy&quot;</SPAN>
               container=<SPAN class="code-quote">&quot;#jbi&quot;</SPAN>

@@ -447,6 +461,21 @@
               type=<SPAN class="code-quote">&quot;test.Echo&quot;</SPAN>
/&gt;</PRE>
 </DIV></DIV>
 <P>You can use it from one of you client bean, or from inside another component, and
call the JBI endpoint as a plain Java object.</P>
+
+<P>From a jsr181 Service Unit, it could be used as following:</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag">&lt;jsr181:endpoint serviceInterface=<SPAN
class="code-quote">&quot;test.Echo&quot;</SPAN>&gt;</SPAN>
+  <SPAN class="code-tag">&lt;jsr181:pojo&gt;</SPAN>
+    <SPAN class="code-tag">&lt;bean class=<SPAN class="code-quote">&quot;test.EchoProxy&quot;</SPAN>&gt;</SPAN>
+      <SPAN class="code-tag">&lt;property name=<SPAN class="code-quote">&quot;echo&quot;</SPAN>&gt;</SPAN>
+        <SPAN class="code-tag">&lt;jsr181:proxy service=<SPAN class="code-quote">&quot;test:EchoService&quot;</SPAN>
context=<SPAN class="code-quote">&quot;#context&quot;</SPAN> type=<SPAN
class="code-quote">&quot;test.Echo&quot;</SPAN> /&gt;</SPAN>
+      <SPAN class="code-tag">&lt;/property&gt;</SPAN>
+    <SPAN class="code-tag">&lt;/bean&gt;</SPAN>
+  <SPAN class="code-tag">&lt;/jsr181:pojo&gt;</SPAN>
+<SPAN class="code-tag">&lt;/jsr181:endpoint&gt;</SPAN></PRE>
+</DIV></DIV>
+
+
 <DIV class="code"><DIV class="codeContent">
 <PRE class="code-java"><SPAN class="code-keyword">private</SPAN> Echo echo;
 
@@ -517,8 +546,8 @@
     </DIV>
     <DIV id="site-footer">
           Added by     <A href="http://goopen.org/confluence/users/viewuserprofile.action?username=gnt">gnt</A>,
-    last edited by     <A href="http://goopen.org/confluence/users/viewuserprofile.action?username=boneill42">Brian
ONeill</A> on Aug 07, 2006
-                  &nbsp;(<A href="http://goopen.org/confluence/pages/diffpages.action?pageId=2057&originalId=9586">view
change</A>)
+    last edited by     <A href="http://goopen.org/confluence/users/viewuserprofile.action?username=gnodet">Guillaume
Nodet</A> on Aug 10, 2006
+                  &nbsp;(<A href="http://goopen.org/confluence/pages/diffpages.action?pageId=2057&originalId=9634">view
change</A>)
               
       (<A href="http://goopen.org/confluence/pages/editpage.action?pageId=2057">edit
page</A>)
     </DIV>



Mime
View raw message