You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yoko-commits@incubator.apache.org by br...@apache.org on 2006/06/23 15:08:09 UTC

svn commit: r416736 - in /incubator/yoko/trunk/distribution/src/main/samples: orb/hello_world/build.xml orb/hello_world/src/corba/client/Client.java ws/hello_world/build.xml

Author: bravi
Date: Fri Jun 23 08:08:08 2006
New Revision: 416736

URL: http://svn.apache.org/viewvc?rev=416736&view=rev
Log:
Updated the ORB hello_world demo and the ws hello_world build.xml
JIRA: http://issues.apache.org/jira/browse/YOKO-54

Modified:
    incubator/yoko/trunk/distribution/src/main/samples/orb/hello_world/build.xml
    incubator/yoko/trunk/distribution/src/main/samples/orb/hello_world/src/corba/client/Client.java
    incubator/yoko/trunk/distribution/src/main/samples/ws/hello_world/build.xml

Modified: incubator/yoko/trunk/distribution/src/main/samples/orb/hello_world/build.xml
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/distribution/src/main/samples/orb/hello_world/build.xml?rev=416736&r1=416735&r2=416736&view=diff
==============================================================================
--- incubator/yoko/trunk/distribution/src/main/samples/orb/hello_world/build.xml (original)
+++ incubator/yoko/trunk/distribution/src/main/samples/orb/hello_world/build.xml Fri Jun 23 08:08:08 2006
@@ -29,7 +29,7 @@
     <condition property="yoko.home" value="${env.YOKO_HOME}">
         <isset property="env.YOKO_HOME"/>
     </condition>
-    <property name="yoko.home" location="../../../../../.."/>
+    <property name="yoko.home" location="../../../"/>
 
     <target name="init">
         <mkdir dir="build/src"/>
@@ -41,7 +41,7 @@
             <src path="${basedir}/src"/>
             <src path="${build.src.dir}"/>
             <classpath>
-		<path path="${yoko.home}/core/target/yoko-core-1.0-incubating-M1-SNAPSHOT.jar"/>
+		<path path="${yoko.home}/lib/yoko-core-1.0-incubating-M1-SNAPSHOT.jar"/>
             </classpath>
         </javac>
     </target>

Modified: incubator/yoko/trunk/distribution/src/main/samples/orb/hello_world/src/corba/client/Client.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/distribution/src/main/samples/orb/hello_world/src/corba/client/Client.java?rev=416736&r1=416735&r2=416736&view=diff
==============================================================================
--- incubator/yoko/trunk/distribution/src/main/samples/orb/hello_world/src/corba/client/Client.java (original)
+++ incubator/yoko/trunk/distribution/src/main/samples/orb/hello_world/src/corba/client/Client.java Fri Jun 23 08:08:08 2006
@@ -27,52 +27,57 @@
 
 public class Client {
     static int run(ORB orb, String[] args) throws UserException {
-	
+        
         // Get "hello" object
-	Object obj = orb.string_to_object("corbaloc::localhost:40000/hw");
-	if(obj == null) {
-	    System.err.println("Client: Could not resolve target object");
-	    return 1;
-	}
+        Object obj = orb.string_to_object("corbaloc::localhost:40000/hw");
+        if(obj == null) {
+            System.err.println("Client: Could not resolve target object");
+            return 1;
+        }
 
-	HelloWorld hello = HelloWorldHelper.narrow(obj);
+        HelloWorld hello = HelloWorldHelper.narrow(obj);
 
         // Test our narrowed "hello" object
         System.out.println("Invoking greetMe...");
-        String result = hello.greetMe(new String());
+        String result;
+        if (args.length > 0) {
+            result = hello.greetMe(args[args.length - 1]);
+        } else {
+            result = hello.greetMe(new String());
+        }
         System.out.println("greetMe.result = " + result);
 
-	return 0;
+        return 0;
     }
 
     // Standalone program initialization
     public static void main(String args[]) {
-	int status = 0;
-	ORB orb = null;
+        int status = 0;
+        ORB orb = null;
 
-	Properties props = System.getProperties();
-	props.put("org.omg.CORBA.ORBClass", "org.apache.yoko.orb.CORBA.ORB");
-	props.put("org.omg.CORBA.ORBSingletonClass",
-		  "org.apache.yoko.orb.CORBA.ORBSingleton");
-	props.put("yoko.orb.id", "HelloWorld-Client");
+        Properties props = System.getProperties();
+        props.put("org.omg.CORBA.ORBClass", "org.apache.yoko.orb.CORBA.ORB");
+        props.put("org.omg.CORBA.ORBSingletonClass",
+                  "org.apache.yoko.orb.CORBA.ORBSingleton");
+        props.put("yoko.orb.id", "HelloWorld-Client");
 
-	try {
+        try {
             orb = ORB.init(args, props);
-	    status = run(orb, args);
-	} catch(Exception ex) {
-	    ex.printStackTrace();
-	    status = 1;
-	}
-
-	if(orb != null) {
-	    try {
-		orb.destroy();
-	    } catch(Exception ex) {
-		ex.printStackTrace();
-		status = 1;
-	    }
-	}
+            status = run(orb, args);
+        } catch(Exception ex) {
+            ex.printStackTrace();
+            status = 1;
+        }
+
+        if(orb != null) {
+            try {
+                orb.destroy();
+            } catch(Exception ex) {
+                ex.printStackTrace();
+                status = 1;
+            }
+        }
 
-	System.exit(status);
+        System.exit(status);
     }
 }

Modified: incubator/yoko/trunk/distribution/src/main/samples/ws/hello_world/build.xml
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/distribution/src/main/samples/ws/hello_world/build.xml?rev=416736&r1=416735&r2=416736&view=diff
==============================================================================
--- incubator/yoko/trunk/distribution/src/main/samples/ws/hello_world/build.xml (original)
+++ incubator/yoko/trunk/distribution/src/main/samples/ws/hello_world/build.xml Fri Jun 23 08:08:08 2006
@@ -62,12 +62,12 @@
 
     <target name="generate.server.code">
         <echo level="info" message="Generating server code using wsdl2java..."/>
-        <wsdl2java file="HelloWorld-corba.wsdl" package="yoko.server" extraArgs="-server" />
+        <wsdl2java file="HelloWorld-corba.wsdl" package="yoko.server" />
     </target>
 
     <target name="generate.client.code">
         <echo level="info" message="Generating client code using wsdl2java..."/>
-        <wsdl2java file="HelloWorld-corba.wsdl" package="yoko.client" extraArgs="-client" />
+        <wsdl2java file="HelloWorld-corba.wsdl" package="yoko.client" />
     </target>
 
     <target name="generate.idl.client.code">