Author: mcombellack
Date: Tue May 19 20:22:02 2009
New Revision: 776443

URL: http://svn.apache.org/viewvc?rev=776443&view=rev
Log:
Initial commit of currency converter CORBA client that will access the CORBA 
interface exposed by the currency converter CORBA service

Added:
    tuscany/sandbox/travelsample/clients/currency-converter-corba-client/   
(with props)
    tuscany/sandbox/travelsample/clients/currency-converter-corba-client/pom.xml
    tuscany/sandbox/travelsample/clients/currency-converter-corba-client/src/
    
tuscany/sandbox/travelsample/clients/currency-converter-corba-client/src/main/
    
tuscany/sandbox/travelsample/clients/currency-converter-corba-client/src/main/java/
    
tuscany/sandbox/travelsample/clients/currency-converter-corba-client/src/main/java/scatours/
    
tuscany/sandbox/travelsample/clients/currency-converter-corba-client/src/main/java/scatours/CurrencyConverterCORBAClient.java
    
tuscany/sandbox/travelsample/clients/currency-converter-corba-client/src/main/resources/
    
tuscany/sandbox/travelsample/clients/currency-converter-corba-client/src/main/resources/currency-converter.idl
Modified:
    tuscany/sandbox/travelsample/clients/pom.xml

Propchange: 
tuscany/sandbox/travelsample/clients/currency-converter-corba-client/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue May 19 20:22:02 2009
@@ -0,0 +1,6 @@
+.project
+.classpath
+target
+maven-eclipse.xml
+.externalToolBuilders
+.settings

Added: 
tuscany/sandbox/travelsample/clients/currency-converter-corba-client/pom.xml
URL: 
http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/clients/currency-converter-corba-client/pom.xml?rev=776443&view=auto
==============================================================================
--- 
tuscany/sandbox/travelsample/clients/currency-converter-corba-client/pom.xml 
(added)
+++ 
tuscany/sandbox/travelsample/clients/currency-converter-corba-client/pom.xml 
Tue May 19 20:22:02 2009
@@ -0,0 +1,71 @@
+<?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>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.tuscany.sca</groupId>
+        <artifactId>tuscany-sca</artifactId>
+        <version>1.5-SNAPSHOT</version>
+        <!--relativePath>../../pom.xml</relativePath-->
+    </parent>
+    <artifactId>currency-converter-corba-client</artifactId>
+    <name>Apache Tuscany SCA Tours Currency Converter CORBA Client</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.5</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+    
+    <build>
+        <finalName>${artifactId}</finalName>
+
+        <plugins>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>idlj-maven-plugin</artifactId>
+                <version>1.1</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>generate</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <compiler>idlj</compiler>
+                    <sources>
+                        <source>
+                            <includes>
+                                <include>currency-converter.idl</include>
+                            </includes>
+                            <emitStubs>true</emitStubs>
+                            <emitSkeletons>false</emitSkeletons>
+                        </source>
+                    </sources>
+                    
<sourceDirectory>${basedir}/src/main/resources</sourceDirectory>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>

Added: 
tuscany/sandbox/travelsample/clients/currency-converter-corba-client/src/main/java/scatours/CurrencyConverterCORBAClient.java
URL: 
http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/clients/currency-converter-corba-client/src/main/java/scatours/CurrencyConverterCORBAClient.java?rev=776443&view=auto
==============================================================================
--- 
tuscany/sandbox/travelsample/clients/currency-converter-corba-client/src/main/java/scatours/CurrencyConverterCORBAClient.java
 (added)
+++ 
tuscany/sandbox/travelsample/clients/currency-converter-corba-client/src/main/java/scatours/CurrencyConverterCORBAClient.java
 Tue May 19 20:22:02 2009
@@ -0,0 +1,40 @@
+/*
+ * 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 scatours;
+
+import org.omg.CORBA.ORB;
+import org.omg.CORBA.Object;
+
+import scatours.currencyconverter.CurrencyConverter;
+import scatours.currencyconverter.CurrencyConverterHelper;
+
+public class CurrencyConverterCORBAClient {
+
+  public static void main(String[] args) throws Exception {
+
+    String[] orbArgs = {"-ORBInitialPort", "5080"};
+    ORB orb = ORB.init( orbArgs, null );
+
+    Object obj = 
orb.string_to_object("corbaname::localhost:5080#CurrencyConverterCORBAService");
+    CurrencyConverter converter = CurrencyConverterHelper.narrow(obj);
+
+    System.out.println("USD -> GBP = " + converter.getExchangeRate("USD", 
"GBP"));
+    System.out.println("100 USD = " + converter.convert("USD", "GBP", 100.0) + 
"GBP");
+  }
+}

Added: 
tuscany/sandbox/travelsample/clients/currency-converter-corba-client/src/main/resources/currency-converter.idl
URL: 
http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/clients/currency-converter-corba-client/src/main/resources/currency-converter.idl?rev=776443&view=auto
==============================================================================
--- 
tuscany/sandbox/travelsample/clients/currency-converter-corba-client/src/main/resources/currency-converter.idl
 (added)
+++ 
tuscany/sandbox/travelsample/clients/currency-converter-corba-client/src/main/resources/currency-converter.idl
 Tue May 19 20:22:02 2009
@@ -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.
+ */
+ 
+ module scatours {
+    module currencyconverter {
+        interface CurrencyConverter {
+            double getExchangeRate(in string fromCurrencyCode, in string 
toCurrencyCode);
+            double convert(in string fromCurrencyCode, in string 
toCurrencyCode, in double amount);
+        };
+    };
+};
\ No newline at end of file

Modified: tuscany/sandbox/travelsample/clients/pom.xml
URL: 
http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/clients/pom.xml?rev=776443&r1=776442&r2=776443&view=diff
==============================================================================
--- tuscany/sandbox/travelsample/clients/pom.xml (original)
+++ tuscany/sandbox/travelsample/clients/pom.xml Tue May 19 20:22:02 2009
@@ -36,6 +36,7 @@
                 <activeByDefault>true</activeByDefault>
             </activation>
             <modules>
+                <module>currency-converter-corba-client</module>
                 <module>currency-converter-rmi-client</module>
                 <module>currency-converter-ws-jaxws-client</module>
             </modules>


Reply via email to