summaryrefslogtreecommitdiff
path: root/java/demo/Ice/value/Client.java
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2002-03-12 00:47:20 +0000
committerMark Spruiell <mes@zeroc.com>2002-03-12 00:47:20 +0000
commit886817574ccfd8cb04497edec181cf9a94d0c519 (patch)
tree8739beeeba72b1f75d7cbf244cb224bb5be4b5ea /java/demo/Ice/value/Client.java
parentalign with C++ (diff)
downloadice-886817574ccfd8cb04497edec181cf9a94d0c519.tar.bz2
ice-886817574ccfd8cb04497edec181cf9a94d0c519.tar.xz
ice-886817574ccfd8cb04497edec181cf9a94d0c519.zip
property fixes
Diffstat (limited to 'java/demo/Ice/value/Client.java')
-rw-r--r--java/demo/Ice/value/Client.java65
1 files changed, 22 insertions, 43 deletions
diff --git a/java/demo/Ice/value/Client.java b/java/demo/Ice/value/Client.java
index f672025d4eb..2e410480454 100644
--- a/java/demo/Ice/value/Client.java
+++ b/java/demo/Ice/value/Client.java
@@ -29,7 +29,7 @@ public class Client
Ice.Properties properties = communicator.getProperties();
final String refProperty = "Value.Initial";
String ref = properties.getProperty(refProperty);
- if (ref == null)
+ if (ref.length() == 0)
{
System.err.println("property `" + refProperty + "' not set");
return 1;
@@ -43,14 +43,11 @@ public class Client
return 1;
}
- java.io.BufferedReader in = new java.io.BufferedReader(
- new java.io.InputStreamReader(System.in));
+ java.io.BufferedReader in = new java.io.BufferedReader(new java.io.InputStreamReader(System.in));
System.out.println();
- System.out.println("Let's first transfer a simple object, for a " +
- "class without");
- System.out.println("operations, and print its contents. No factory " +
- "is required");
+ System.out.println("Let's first transfer a simple object, for a class without");
+ System.out.println("operations, and print its contents. No factory is required");
System.out.println("for this.");
System.out.println("[press enter]");
readline(in);
@@ -59,10 +56,8 @@ public class Client
System.out.println("==> " + simple._message);
System.out.println();
- System.out.println("Ok, this worked. Now let's try to transfer an " +
- "object for a class");
- System.out.println("with operations, without installing a factory " +
- "first. This should");
+ System.out.println("Ok, this worked. Now let's try to transfer an object for a class");
+ System.out.println("with operations, without installing a factory first. This should");
System.out.println("give us a `no factory' exception.");
System.out.println("[press enter]");
readline(in);
@@ -79,10 +74,8 @@ public class Client
}
System.out.println();
- System.out.println("Yep, that's what we expected. Now let's try " +
- "again, but with");
- System.out.println("installing an appropriate factory first. If " +
- "successful, we print");
+ System.out.println("Yep, that's what we expected. Now let's try again, but with");
+ System.out.println("installing an appropriate factory first. If successful, we print");
System.out.println("the object's content.");
System.out.println("[press enter]");
readline(in);
@@ -94,8 +87,7 @@ public class Client
System.out.println("==> " + printer.value._message);
System.out.println();
- System.out.println("Cool, it worked! Let's try calling the " +
- "printBackwards() method");
+ System.out.println("Cool, it worked! Let's try calling the printBackwards() method");
System.out.println("on the object we just received locally.");
System.out.println("[press enter]");
readline(in);
@@ -104,8 +96,7 @@ public class Client
printer.value.printBackwards(null);
System.out.println();
- System.out.println("Now we call the same method, but on the remote " +
- "object. Watch the");
+ System.out.println("Now we call the same method, but on the remote object. Watch the");
System.out.println("server's output.");
System.out.println("[press enter]");
readline(in);
@@ -113,12 +104,9 @@ public class Client
printerProxy.value.printBackwards();
System.out.println();
- System.out.println("Next, we transfer a derived object from the " +
- "server as base");
- System.out.println("object. Since we didn't install a factory for " +
- "the derived");
- System.out.println("class yet, we will get another `no factory' " +
- "exception.");
+ System.out.println("Next, we transfer a derived object from the server as base");
+ System.out.println("object. Since we didn't install a factory for the derived");
+ System.out.println("class yet, we will get another `no factory' exception.");
System.out.println("[press enter]");
readline(in);
@@ -134,14 +122,10 @@ public class Client
}
System.out.println();
- System.out.println("Now we install a factory for the derived class, " +
- "and try again.");
- System.out.println("We won't get a `no factory' exception anymore, " +
- "but since we");
- System.out.println("receive the derived object as base object, we " +
- "need to do a");
- System.out.println("dynamic_cast<> to get from the base to the " +
- "derived object.");
+ System.out.println("Now we install a factory for the derived class, and try again.");
+ System.out.println("We won't get a `no factory' exception anymore, but since we");
+ System.out.println("receive the derived object as base object, we need to do a");
+ System.out.println("dynamic_cast<> to get from the base to the derived object.");
System.out.println("[press enter]");
readline(in);
@@ -153,10 +137,8 @@ public class Client
System.out.println("==> dynamic_cast<> to derived object succeded");
System.out.println();
- System.out.println("Let's print the message contained in the " +
- "derived object, and");
- System.out.println("call the operation printUppercase() on the " +
- "derived object");
+ System.out.println("Let's print the message contained in the derived object, and");
+ System.out.println("call the operation printUppercase() on the derived object");
System.out.println("locally.");
System.out.println("[press enter]");
readline(in);
@@ -166,10 +148,8 @@ public class Client
derived.printUppercase(null);
System.out.println();
- System.out.println("Finally, we try the same again, but instead of " +
- "returning the");
- System.out.println("derived object, we throw an exception " +
- "containing the derived");
+ System.out.println("Finally, we try the same again, but instead of returning the");
+ System.out.println("derived object, we throw an exception containing the derived");
System.out.println("object.");
System.out.println("[press enter]");
readline(in);
@@ -202,8 +182,7 @@ public class Client
try
{
- Ice.Properties properties =
- Ice.Util.createPropertiesFromFile(args, "config");
+ Ice.Properties properties = Ice.Util.createPropertiesFromFile(args, "config");
communicator = Ice.Util.initializeWithProperties(properties);
status = run(args, communicator);
}