Author: svkrish
Date: Sat Oct 21 11:58:08 2006
New Revision: 466436
URL: http://svn.apache.org/viewvc?view=rev&rev=466436
Log:
Adding the Calculator RMI Service Sample (to work with the Calculator Combo
Sample)
Added:
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/Calculator-RMI-Service-Readme.htm
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/pom.xml
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/AddService.java
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/AddServiceImpl.java
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/CalculatorService.java
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/CalculatorServiceImpl.java
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/DivideService.java
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/DivideServiceImpl.java
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/MathService.java
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/MathServiceImpl.java
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/MultiplyService.java
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/MultiplyServiceImpl.java
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/SubtractService.java
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/SubtractServiceImpl.java
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/server/
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/server/CalculatorRMIServer.java
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/resources/
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/resources/META-INF/
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/resources/META-INF/LICENSE.txt
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/resources/META-INF/NOTICE
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/resources/META-INF/README.txt
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/resources/META-INF/sca/
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/resources/META-INF/sca/default.scdl
Added:
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/Calculator-RMI-Service-Readme.htm
URL:
http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/Calculator-RMI-Service-Readme.htm?view=auto&rev=466436
==============================================================================
---
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/Calculator-RMI-Service-Readme.htm
(added)
+++
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/Calculator-RMI-Service-Readme.htm
Sat Oct 21 11:58:08 2006
@@ -0,0 +1,104 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><!-- Copyright (c) 2005 The Apache Software Foundation or its
licensors, as applicable. Licensed 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 Web Service Sample</title><!-- LINK rel="stylesheet"
href="ait.css" type="text/css" --><!-- maven -->
+<style type="text/css" media="all">
[EMAIL PROTECTED] url("../../../../css/maven-base.css");
[EMAIL PROTECTED] url("../../../../css/maven-theme.css");
[EMAIL PROTECTED] url("../../../../css/site.css");
+</style><link rel="stylesheet" href="./css/print.css" type="text/css"
media="print"><!-- end maven --></head>
+<body>
+<H1>Tuscany Calculator-RMI Service - A Simple SCA Assembly that hosts
calculator functions as RMI Services</H1>
+<H2>Overview</H2>
+<TABLE border="0">
+ <TBODY>
+ <TR>
+ <TD width="100%" valign="top" align="left"> This sample
is an assembly of Calculator functions implemented in Java and exposed as RMI
Services. The primary objective of developing this sample is to support the
Calculator-Combo sample.<BR>
+ <BR>To test this sample you might have to either run
the Calculator-Combo sample after running this sample or you might right your
won SCA Application that refereences the services of this sample</TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<H2>Location</H2>
+<P>This sample is located in the following path of the samples source
distribution: -<BR>
+<source disb>/samples/standalone/calculatorRMIService<BR>
+<BR>After you build the sample source the deployable 'jar' can be found in the
'<I>target' </I>directory of the the project as:: <BR> <source
disb>/samples/standalone/calculatorRMIService/target/sample-calculator-rmiService.jar<BR>
+<BR>
+If there is a binary distribution of the samples available then you may just
about lookup for the deployable unit (jar) in the distribution.<BR>
+</P><H2>Setup</H2>
+<P>1) Download the Tuscany SCA Standalone Host distribution. The standalone
distribution comes in two forms: -<I>distribution-1.0-incubator-M2-bin.zip </I>
and <I>distribution-1.0-incubator-M2-bin.tar.gz. </I>Choose the one that best
suits your platform.<BR>
+<BR>2) Extract the contents of this archive file into a local directory say
<I><tuscany
+samples></I>. This will create the following subdirectories with contents
in each: -<BR>
+<I><BR>
+<tuscany samples></I>/boot<I> <BR><tuscany samples></I>/bin<BR>
+<I><tuscany samples></I>/lib
+<BR><I><tuscany samples></I>/extensions<BR><I><tuscany
samples></I>/contrib<BR>
+<BR>3) Create a sub-directory called 'calcRmi' under <I><tuscany
+samples></I> and copy the <I>sample-calculator-rmiService.jar</I> into this
directory.
+</P>
+<P>3) Since this sample uses the RMI extension, copy the binary archive (jar)
of this extesion into the "<I>extensions" </I>subdirectory. The
binaries for these extensions are provided in the "<I>contrib"
</I>sub-directory. Alternatively, if you have built the Tuscany Java SCA from a
source distribution, then this binary can be found in the "<I>target"
</I>directories of the RMI Binding Extension project and also in the Local
Maven Repository in the path <I>org/apache/tuscany/sca/services/bindings/* and
<I>org/apache/tuscany/sca/services/containers/*.</I></I><BR></P><H2>Running</H2><P>1)
Open up a commandline window and go to the
+directory <I><tuscany samples></I>. Run the Calculator RMI Service
Sample as follows : -<BR>
+<BR>
+<FONT color="purple"><I><tuscany samples></I></FONT><FONT
color="navy">java -jar
+bin/launcher.jar
+calcRmi/sample-calculator-rmiService.jar</FONT><BR>
+<BR>
+This command starts an SCA Standalone Runtime deploying the component assembly
specified in the default.scdl. It then invokes the main method of the
CalculatorRMIServer class that holds the runtime running, until the 'Enter' key
is pressed. <BR>
+<BR>
+On running the Calculator RMI Service sample the console will display ....<BR>
+<BR>
+<FONT color="green"> </FONT><FONT color="green" face="Courier
New">**********************************************<BR>
+Calculator Rmi Service
+Started and Running...<BR>
+***********************************************<BR>
+Hit ENTER to exit</FONT><BR>
+<BR>In addition to this, whenever a client invokes this RMI Service, the
console displays a message about the service method invoked.
+<BR><BR>To test this sample completely, run the Calculator-Combo sample after
running this sample. For details on setting up and running the Calculator-Combo
sample look at the Calculator-Combo-Readme.htm
+there.</P><H2>Code Overview</H2>
+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>
+<B><U>Calculator RMI Service</U></B>
++---main<br> +---java<br> | +---calculator
+<I> <Interfaces and Implementations for Calculator
Functions>
+
+</I> +---server
+ CalculatorRMIServer.java
+ +---resources
+ +---META-INF
+ +---sca
+ default.scdl<B></B></pre></td></tr></tbody></table>
+<B> <BR>
+<BR>
+Calculator RMI Service Sample (Standalone Deployment)</B>
+<TABLE border="1">
+ <TBODY>
+ <TR>
+ <TD width="230" valign="top">default.scdl</TD>
+ <TD width="396" valign="top">Defines an assembly of
calculator funtions implemented in Java and exposed as an RMI Service.</TD>
+ </TR>
+ <TR>
+ <TD width="230">AddService.java<BR>
+ AddServiceImpl.java<BR>DivideService.java<BR>
+ DivideServiceImpl.java<BR>
+ MathService.java<BR>
+ MathServiceImpl.java<BR>
+ MultiplyService.java<BR>
+ MultiplyServiceImpl.java<BR>
+ SubtractService.java<BR>
+ SubtractServiceImpl.java</TD>
+ <TD width="396">Java Interfaces and Java
Implementations for various calculator
+ functions..</TD>
+ </TR>
+ <TR>
+ <TD
width="230">CalculatorService.java<BR>CalculatorServiceImpl.java</TD>
+ <TD width="396">Defines the coarse grained Calculator
Interface and Implementation. This calculator implementation delegates function
requests to other granular implemenations listed above.</TD>
+ </TR>
+ <TR>
+ <TD width="230">CalculatorRMIServer</TD>
+ <TD width="396">The main method of the RMI Server
sample that keeps the runtime up and exits the appplication after the user
presses 'Enter' key.</TD>
+ </TR>
+ </TBODY>
+</TABLE>
+
+<P></P><P></P>
+</body></html>
Added:
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/pom.xml?view=auto&rev=466436
==============================================================================
---
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/pom.xml
(added)
+++
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/pom.xml
Sat Oct 21 11:58:08 2006
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<project>
+ <parent>
+ <groupId>org.apache.tuscany.sca.samples</groupId>
+ <artifactId>parent</artifactId>
+ <version>1.0-incubator-M2-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>sample-calculator-rmiService</artifactId>
+ <packaging>jar</packaging>
+ <name>Tuscany Calculator RMI Service Sample</name>
+ <description>A sample Calculator RMI Service.</description>
+
+ <dependencies>
+
+ <!-- SCA API dependencies -->
+ <dependency>
+ <groupId>org.osoa</groupId>
+ <artifactId>sca-api-r0.95</artifactId>
+ <version>${scaVersion}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <!-- Tuscany RMI Binding -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca.services.bindings</groupId>
+ <artifactId>rmi</artifactId>
+ <version>${scaVersion}</version>
+ <scope>provided</scope>
+ </dependency>
+
+
+ <!-- Tuscany API dependencies -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca.kernel</groupId>
+ <artifactId>tuscany-api</artifactId>
+ <version>${scaVersion}</version>
+ <scope>compile</scope>
+ </dependency>
+ <!-- Unit testing -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <defaultGoal>install</defaultGoal>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+
<mainClass>calculator.server.CalculatorRMIServer</mainClass>
+ <addClasspath>true</addClasspath>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
+
Added:
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/AddService.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/AddService.java?view=auto&rev=466436
==============================================================================
---
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/AddService.java
(added)
+++
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/AddService.java
Sat Oct 21 11:58:08 2006
@@ -0,0 +1,25 @@
+/*
+ * 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.
+ */
+package calculator;
+
+public interface AddService {
+
+ double add(double n1, double n2);
+
+}
Added:
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/AddServiceImpl.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/AddServiceImpl.java?view=auto&rev=466436
==============================================================================
---
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/AddServiceImpl.java
(added)
+++
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/AddServiceImpl.java
Sat Oct 21 11:58:08 2006
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+package calculator;
+
+import org.osoa.sca.annotations.Scope;
+
+/**
+ * An implementation of the Add service
+ */
[EMAIL PROTECTED]("MODULE")
+public class AddServiceImpl implements AddService {
+
+ public double add(double n1, double n2) {
+ return n1 + n2;
+ }
+
+}
Added:
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/CalculatorService.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/CalculatorService.java?view=auto&rev=466436
==============================================================================
---
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/CalculatorService.java
(added)
+++
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/CalculatorService.java
Sat Oct 21 11:58:08 2006
@@ -0,0 +1,42 @@
+/*
+ * 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.
+ */
+package calculator;
+
+import org.osoa.sca.annotations.Remotable;
+import org.osoa.sca.annotations.Service;
+
+
+/**
+ * The Calculator service interface.
+ */
[EMAIL PROTECTED]
[EMAIL PROTECTED]
+public interface CalculatorService {
+
+ double add(double n1, double n2);
+
+ double subtract(double n1, double n2);
+
+ double multiply(double n1, double n2);
+
+ double divide(double n1, double n2);
+
+ double sqrt (double n);
+
+}
Added:
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/CalculatorServiceImpl.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/CalculatorServiceImpl.java?view=auto&rev=466436
==============================================================================
---
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/CalculatorServiceImpl.java
(added)
+++
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/CalculatorServiceImpl.java
Sat Oct 21 11:58:08 2006
@@ -0,0 +1,67 @@
+/*
+ * 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.
+ */
+package calculator;
+
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Scope;
+
+
+/**
+ * An implementation of the Calculator service.
+ */
[EMAIL PROTECTED]("MODULE")
+public class CalculatorServiceImpl implements CalculatorService {
+
+ @Reference
+ protected AddService addService;
+
+ @Reference
+ protected SubtractService subtractService;
+
+ @Reference
+ protected MultiplyService multiplyService;
+
+ @Reference
+ protected DivideService divideService;
+
+ @Reference
+ protected MathService mathService;
+
+ public double add(double n1, double n2) {
+ return addService.add(n1, n2);
+ }
+
+ public double subtract(double n1, double n2) {
+ return subtractService.subtract(n1, n2);
+ }
+
+ public double multiply(double n1, double n2) {
+ return multiplyService.multiply(n1, n2);
+ }
+
+ public double divide(double n1, double n2) {
+ return divideService.divide(n1, n2);
+ }
+
+ public double sqrt(double n) {
+ // TODO Auto-generated method stub
+ return mathService.sqrt(n);
+ }
+
+}
Added:
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/DivideService.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/DivideService.java?view=auto&rev=466436
==============================================================================
---
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/DivideService.java
(added)
+++
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/DivideService.java
Sat Oct 21 11:58:08 2006
@@ -0,0 +1,25 @@
+/*
+ * 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.
+ */
+package calculator;
+
+public interface DivideService {
+
+ double divide(double n1, double n2);
+
+}
Added:
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/DivideServiceImpl.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/DivideServiceImpl.java?view=auto&rev=466436
==============================================================================
---
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/DivideServiceImpl.java
(added)
+++
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/DivideServiceImpl.java
Sat Oct 21 11:58:08 2006
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+package calculator;
+
+import org.osoa.sca.annotations.Scope;
+
+/**
+ * An implementation of the Divide service.
+ */
[EMAIL PROTECTED]("MODULE")
+public class DivideServiceImpl implements DivideService {
+
+ public double divide(double n1, double n2) {
+ return n1 / n2;
+ }
+
+}
Added:
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/MathService.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/MathService.java?view=auto&rev=466436
==============================================================================
---
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/MathService.java
(added)
+++
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/MathService.java
Sat Oct 21 11:58:08 2006
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ */
+package calculator;
+
+
+
+public interface MathService {
+
+ double sqrt(double n);
+
+}
Added:
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/MathServiceImpl.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/MathServiceImpl.java?view=auto&rev=466436
==============================================================================
---
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/MathServiceImpl.java
(added)
+++
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/MathServiceImpl.java
Sat Oct 21 11:58:08 2006
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+package calculator;
+
+import org.osoa.sca.annotations.Scope;
+
+/**
+ * An implementation of the Divide service.
+ */
[EMAIL PROTECTED]("MODULE")
+public class MathServiceImpl implements MathService {
+
+ public double sqrt(double n1) {
+ return java.lang.Math.sqrt(n1);
+ }
+
+}
Added:
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/MultiplyService.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/MultiplyService.java?view=auto&rev=466436
==============================================================================
---
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/MultiplyService.java
(added)
+++
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/MultiplyService.java
Sat Oct 21 11:58:08 2006
@@ -0,0 +1,25 @@
+/*
+ * 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.
+ */
+package calculator;
+
+public interface MultiplyService {
+
+ double multiply(double n1, double n2);
+
+}
Added:
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/MultiplyServiceImpl.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/MultiplyServiceImpl.java?view=auto&rev=466436
==============================================================================
---
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/MultiplyServiceImpl.java
(added)
+++
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/MultiplyServiceImpl.java
Sat Oct 21 11:58:08 2006
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+package calculator;
+
+import org.osoa.sca.annotations.Scope;
+
+/**
+ * An implementation of the Multiply service.
+ */
[EMAIL PROTECTED]("MODULE")
+public class MultiplyServiceImpl implements MultiplyService {
+
+ public double multiply(double n1, double n2) {
+ System.out.println("Multiplying... " + n1 + " x " + n2);
+ return n1 * n2;
+ }
+
+}
Added:
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/SubtractService.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/SubtractService.java?view=auto&rev=466436
==============================================================================
---
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/SubtractService.java
(added)
+++
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/SubtractService.java
Sat Oct 21 11:58:08 2006
@@ -0,0 +1,25 @@
+/*
+ * 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.
+ */
+package calculator;
+
+public interface SubtractService {
+
+ double subtract(double n1, double n2);
+
+}
Added:
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/SubtractServiceImpl.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/SubtractServiceImpl.java?view=auto&rev=466436
==============================================================================
---
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/SubtractServiceImpl.java
(added)
+++
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/SubtractServiceImpl.java
Sat Oct 21 11:58:08 2006
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+package calculator;
+
+import org.osoa.sca.annotations.Scope;
+
+/**
+ * An implementation of the subtract service.
+ */
[EMAIL PROTECTED]("MODULE")
+public class SubtractServiceImpl implements SubtractService {
+
+ public double subtract(double n1, double n2) {
+ return n1 - n2;
+ }
+
+}
Added:
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/server/CalculatorRMIServer.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/server/CalculatorRMIServer.java?view=auto&rev=466436
==============================================================================
---
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/server/CalculatorRMIServer.java
(added)
+++
incubator/tuscany/branches/sca-java-M2/samples/standalone/calculatorRMIService/src/main/java/calculator/server/CalculatorRMIServer.java
Sat Oct 21 11:58:08 2006
@@ -0,0 +1,45 @@
+/*
+ * 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.
+ */
+package calculator.server;
+
+/**
+ * The class holds up the Tuscany Runtime until a Enter key is pressed
+ *
+ */
+public class CalculatorRMIServer {
+
+ /**
+ * @param args
+ */
+ public static void main(String[] args) {
+ try {
+
System.out.println("*********************************************");
+ System.out.println("Calculator RMI Service Started and
Running...");
+
System.out.println("*********************************************");
+ System.out.println("Hit ENTER to exit");
+ System.in.read();
+ System.out.println("Calculator RMI Service Stopped!");
+ System.exit(0);
+ } catch ( Exception e ) {
+ e.printStackTrace();
+ }
+
+ }
+
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]