summaryrefslogtreecommitdiffstats
path: root/sca-java-1.x/branches/sca-java-M2/samples/standalone/helloworldRMIReference/readme.html
diff options
context:
space:
mode:
Diffstat (limited to 'sca-java-1.x/branches/sca-java-M2/samples/standalone/helloworldRMIReference/readme.html')
-rw-r--r--sca-java-1.x/branches/sca-java-M2/samples/standalone/helloworldRMIReference/readme.html215
1 files changed, 215 insertions, 0 deletions
diff --git a/sca-java-1.x/branches/sca-java-M2/samples/standalone/helloworldRMIReference/readme.html b/sca-java-1.x/branches/sca-java-M2/samples/standalone/helloworldRMIReference/readme.html
new file mode 100644
index 0000000000..c6dae4784c
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-M2/samples/standalone/helloworldRMIReference/readme.html
@@ -0,0 +1,215 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><!-- * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><meta http-equiv="Content-Style-Type" content="text/css"><title>Tuscany
+Hello World RMI Reference Sample</title><!-- LINK rel="stylesheet" href="ait.css" type="text/css" --><!-- maven -->
+<style type="text/css" media="all">
+@import url("../../../../css/maven-base.css");
+@import url("../../../../css/maven-theme.css");
+@import url("../../../../css/site.css");
+</style><link rel="stylesheet" href="./css/print.css" type="text/css" media="print"><!-- end maven --></head>
+<body>
+<H3>Tuscany HelloWorld - RMI Reference Sample</H3>
+<H3>Overview</H3>
+<TABLE border="0">
+ <TBODY>
+ <TR>
+ <TD width="100%" valign="top" align="left">The RMI Reference sample demonstrates how the Tuscany Runtime provides RMI client bindings for service components that would like to refer RMI Servcies.</TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<H3>Location</H3>
+<P>The source for this sample is located &nbsp;in the paths - <I>samples\standalone\helloworldRMIReference</I> <I></I>
+ of the source
+distribution.<BR>
+<BR>If there is binary distribution available for these samples, then you may find these samples packaged as <I></I><I>sample-helloworld-rmiReference.jar.</I>
+</P>
+<H3>Building &amp; Running the HelloWorldRMIReference Sample Source</H3>
+<P>If you are working with a source distribution, then you must first build the source of this sample. <BR>- Ensure that you have Java 5 installed on your system.<BR>- Next, you must have Maven 2.0.4 installed on your system. Look up
+http://maven.apache.org/download.html for downloading and installing
+Maven.</P>
+<H4>Building the HelloWorldRMIReference Sample</H4>
+<TABLE border="0">
+ <TBODY>
+ <TR>
+ <TD valign="top"></TD>
+ <TD valign="top">Having installed Maven, , open a command line console and switch over to the directory on your local
+system, where you have extracted the source.<BR>-
+ Now switch futher into
+the subdirectory <I>samples\standalone\helloworldRMIReference. </I>In this directory execute the following command<TABLE border="0">
+ <TBODY>
+ <TR>
+ <TD><FONT color="purple">&gt;</FONT></TD>
+ <TD><FONT color="purple" face="Courier New">mvn</FONT></TD>
+ </TR>
+ </TBODY>
+ </TABLE>This will build the <I>helloworldRMIReference</I> sample, package a JAR file for the composite and make this available in sub-directory <I>samples\standalone\helloworldRMIReference\target</I></TD>
+ <TD></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<H4>Setting up Tuscany Standalone Runtime </H4>
+<P>To run these samples you need the Tuscany Standalone Runtime. This is
+available as a distribution that can be conveniently unpacked and setup
+in the samples directory itself. For this, do the following: -</P>
+<TABLE border="0">
+ <TBODY>
+ <TR>
+ <TD valign="top" align="right">i) </TD>
+ <TD>From the directory <I>samples\standalone\helloworldRMIReference</I>
+ execute the following command<TABLE border="0">
+ <TBODY>
+ <TR>
+ <TD><FONT color="purple">&gt;</FONT></TD>
+ <TD><FONT color="purple" face="Courier New">mvn dependency:unpack</FONT></TD>
+ </TR>
+ </TBODY>
+ </TABLE>
+ This will unpack the Tuscany Standalone Runtime Distribution to the <I>target\distribution </I>sub-directory within the present working directory - <I>samples\standalone\helloworldRMIReference</I></TD>
+ </TR>
+ <TR>
+ <TD valign="top">ii)</TD>
+ <TD>Since this sample would require the RMI Binding Extension of Tuscany you must copy the RMI Extension JAR from the <I>contrib </I>sub-directory into the <I>extensions </I>directory of the distribution. ie. execute the following from the
+ <I>samples\standalone\helloworldRMIReference </I>sub-directory: -
+ <TABLE>
+ <TBODY>
+ <TR>
+ <TD valign="top"><FONT color="purple">&gt;</FONT></TD>
+ <TD><FONT color="purple" face="Courier New">copy target\distribution\contrib\rmi-1.0-incubator-M2.jar <FONT
+ color="purple" face="Courier New">target\distribution\extensions\rmi-1.0-incubator-M2.jar</FONT></FONT></TD>
+ </TR>
+ </TBODY>
+ </TABLE>
+ <I>Note</I> : <I>If you are working with SNAPSHOTs versions of
+ Tuscany Extensions then the file <B>rmi-1.0-incubator-M2.jar</B> in
+ the above command must be substituted with <B>rmi-1.0-incubator-M2-SNAPSHOT.jar</B></I></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<H4><BR>
+Running the HelloWorldRMIReference Sample</H4>
+<P>Now that the sample source has been built and the Tuscany Standalone Runtime setup, you may run the HelloWorldRMIReference sample as follows: -</P>
+<TABLE border="0">
+ <TBODY>
+ <TR>
+ <TD valign="top">i) </TD>
+ <TD>First ensure that the HelloWorldRMIService Sample is up and running. </TD>
+ </TR>
+ <TR>
+ <TD valign="top">ii)</TD>
+ <TD>Switch to the <I>samples\standalone\helloworldRMIReference\target\distribution
+ </I>sub-directory and execute the following command: <TABLE>
+ <TBODY>
+ <TR>
+ <TD><FONT color="purple">&gt;</FONT></TD>
+ <TD><FONT color="purple" face="Courier New">java -jar
+ bin\launcher.jar ..\sample-helloworld-rmiReference.jar</FONT></TD>
+ </TR>
+ </TBODY>
+ </TABLE>
+ </TD>
+ </TR>
+ <TR>
+ <TD valign="top">iii)</TD>
+ <TD>Running this sample will send a <I>'sayHello'</I> request to the HelloWorldRMIService (that must be running) with the argument '<I>name</I>' set to the string <I>&quot;SCA
+ RMI Client&quot;</I></TD>
+ </TR>
+ <TR>
+ <TD valign="top">iii)</TD>
+ <TD>You will initially observe messages that relate to resolution of dependencies required to run this sample and finlly see the following message on your console<BR>
+ <FONT face="Courier New" color="green"></FONT><FONT color="green" face="Courier New">***********************************************************<BR>
+ Hello SCA RMI Client - from the SCA RMI Service<BR>
+ ***********************************************************</FONT></TD>
+ </TR>
+ <TR>
+ <TD valign="top">iv)</TD>
+ <TD>This message indicates that the HelloWorldRMIReference sample has successfuly invoked the HelloWorldRMIService and obtained the string value <FONT
+ color="green" face="Courier New">&quot;Hello SCA RMI Client - from the SCA
+ RMI Service&quot;</FONT></TD>
+ </TR>
+ <TR>
+ <TD valign="top">v)</TD>
+ <TD>Meanwhile, on the console where you have started the HelloworldRMIService sample you will see a message <FONT
+ color="green">&quot;Saying Hello to - SCA RMI Client&quot;</FONT> that is displayed (implying that its service method was invoked)</TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<H3><B><I><FONT color="maroon" size="+1">Note : You may also try the
+HelloWorldRMIReference Sample by creating your own RMI Server with the following attributes </FONT></I></B></H3><TABLE border="0">
+ <TBODY>
+ <TR>
+ <TD align="right"><FONT color="maroon">host =</FONT></TD>
+ <TD><FONT color="maroon">&quot;localhost&quot;</FONT></TD>
+ </TR>
+ <TR>
+ <TD align="right"><FONT color="maroon">port =</FONT></TD>
+ <TD><FONT color="maroon">&quot;1099&quot;</FONT></TD>
+ </TR>
+ <TR>
+ <TD align="right"><FONT color="maroon">server name =</FONT></TD>
+ <TD><FONT color="maroon">&quot;HelloWorldRemoteService&quot;</FONT></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P><I><FONT color="maroon">Note: You are free to modify any of the above
+(host, port, server name) by making corresponding modifications to the
+default.scdl file of the HelloWorldRMIReference sample and then running this
+sample.</FONT></I></P>
+<P><B><I><FONT color="maroon" size="+1"></FONT></I></B>
+</P><H3>Code Overview</H3>
+The source files are physically organized as shown below:<br>
+<table style="text-align: left; width: 100%;" border="1" cellpadding="2" cellspacing="2"><tbody><tr><td>
+<pre>
+<U><B></B></U><B><U>RMI Reference Sample</U></B>
++---main<BR> +---java<BR> | +---helloworld
+ HelloWorldService.java
+ HelloWorldImpl.java
+ HelloWorldRmiClient.java
+ +---resources
+ +----META-INF
+ +----sca
+ default.scdl</pre></td></tr></tbody></table>
+<H4><BR>
+<B>RMI Reference Sample</B></H4>
+<TABLE border="1">
+ <TBODY>
+ <TR>
+ <TD width="230" valign="top">default.scdl</TD>
+ <TD width="396" valign="top">Defines the assembly of the Helloworld
+ Application with the HelloWorldImpl component referring the a
+ HelloWorld RMI Service</TD>
+ </TR>
+ <TR>
+ <TD width="230">HelloWorldService.java</TD>
+ <TD width="396">Defines a HelloWorld service interface</TD>
+ </TR>
+ <TR>
+ <TD width="230">HelloWorldImpl.java</TD>
+ <TD width="396">Implements the HelloWorldService interface. This
+ implementation inturn calls out to the RMI Service under the covers
+ of the SCA Runtime - i.e. you will never notice any APIs in
+ java.rmi.* used in this application</TD>
+ </TR>
+ <TR>
+ <TD width="230">HelloWorldRmiClient.java</TD>
+ <TD width="396">Launches the Standalone Tuscany Runtime with the RMI
+ Client SCA Application loaded and run.</TD>
+ </TR>
+ </TBODY>
+</TABLE>
+</p></body></html>