summaryrefslogtreecommitdiff
path: root/java/demo
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2009-01-09 11:49:20 -0330
committerMatthew Newhook <matthew@zeroc.com>2009-01-09 11:49:20 -0330
commit9117e9040c02465cb9f0a1e0bcc6aa963f71c61a (patch)
treeef345adb5612327136e70c8207182e015dfc6349 /java/demo
parentFixed NRVO demo depend file (diff)
parenthttp://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=3553. database demo uses w... (diff)
downloadice-9117e9040c02465cb9f0a1e0bcc6aa963f71c61a.tar.bz2
ice-9117e9040c02465cb9f0a1e0bcc6aa963f71c61a.tar.xz
ice-9117e9040c02465cb9f0a1e0bcc6aa963f71c61a.zip
Merge commit 'origin/R3_3_branch'
Conflicts: cs/demo/WCF/latency/Client.cs cs/demo/WCF/latency_m/Client.cs cs/demo/WCF/throughput/Client.cs cs/demo/WCF/throughput_m/Client.cs cs/demo/WCF/throughput_m/Service.cs java/demo/Database/library/BookI.java java/demo/Database/library/BookQueryResultI.java java/demo/Database/library/Client.java java/demo/Database/library/ConnectionPool.java java/demo/Database/library/DispatchInterceptorI.java java/demo/Database/library/Glacier2Session.ice java/demo/Database/library/Glacier2SessionManagerI.java java/demo/Database/library/Grammar.java java/demo/Database/library/Library.ice java/demo/Database/library/LibraryI.java java/demo/Database/library/Parser.java java/demo/Database/library/ReapThread.java java/demo/Database/library/RunParser.java java/demo/Database/library/SQLRequestContext.java java/demo/Database/library/Scanner.java java/demo/Database/library/Server.java java/demo/Database/library/Session.ice java/demo/Database/library/SessionFactoryI.java java/demo/Database/library/SessionI.java java/demo/Database/library/Token.java java/demo/Database/library/build.xml java/demo/Database/library/config.client
Diffstat (limited to 'java/demo')
-rw-r--r--java/demo/Database/.DS_Storebin0 -> 6148 bytes
-rw-r--r--java/demo/Database/library/Glacier2Session.ice4
-rw-r--r--java/demo/Database/library/Library.ice4
-rw-r--r--java/demo/Database/library/RunParser.java102
-rw-r--r--java/demo/Database/library/Session.ice4
-rw-r--r--java/demo/Database/library/build.xml4
-rw-r--r--java/demo/Database/library/config.client4
-rw-r--r--java/demo/Ice/applet/.gitignore1
-rw-r--r--java/demo/Ice/applet/HelloApplet.java20
-rw-r--r--java/demo/Ice/applet/README4
-rw-r--r--java/demo/Ice/applet/build.xml4
-rw-r--r--java/demo/RMI/README12
-rw-r--r--java/demo/RMI/build.xml24
-rwxr-xr-xjava/demo/RMI/throughput/Client.java421
-rwxr-xr-xjava/demo/RMI/throughput/README26
-rwxr-xr-xjava/demo/RMI/throughput/Server.java145
-rwxr-xr-xjava/demo/RMI/throughput/Throughput.java51
-rwxr-xr-xjava/demo/RMI/throughput/build.xml35
-rwxr-xr-xjava/demo/RMI/throughput/policy3
19 files changed, 97 insertions, 771 deletions
diff --git a/java/demo/Database/.DS_Store b/java/demo/Database/.DS_Store
new file mode 100644
index 00000000000..ca6143d6f15
--- /dev/null
+++ b/java/demo/Database/.DS_Store
Binary files differ
diff --git a/java/demo/Database/library/Glacier2Session.ice b/java/demo/Database/library/Glacier2Session.ice
index 5a9ab2dd252..1dce2feae44 100644
--- a/java/demo/Database/library/Glacier2Session.ice
+++ b/java/demo/Database/library/Glacier2Session.ice
@@ -1,6 +1,10 @@
// **********************************************************************
//
+<<<<<<< HEAD:java/demo/Database/library/Glacier2Session.ice
// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
+=======
+// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved.
+>>>>>>> origin/R3_3_branch:java/demo/Database/library/Glacier2Session.ice
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
diff --git a/java/demo/Database/library/Library.ice b/java/demo/Database/library/Library.ice
index a26dbe20b01..8d647be0360 100644
--- a/java/demo/Database/library/Library.ice
+++ b/java/demo/Database/library/Library.ice
@@ -1,6 +1,10 @@
// **********************************************************************
//
+<<<<<<< HEAD:java/demo/Database/library/Library.ice
// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
+=======
+// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved.
+>>>>>>> origin/R3_3_branch:java/demo/Database/library/Library.ice
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
diff --git a/java/demo/Database/library/RunParser.java b/java/demo/Database/library/RunParser.java
index e616218df9e..17a21db127e 100644
--- a/java/demo/Database/library/RunParser.java
+++ b/java/demo/Database/library/RunParser.java
@@ -21,56 +21,6 @@ class RunParser
public void refresh();
}
- static class Glacier2SessionAdapter implements SessionAdapter
- {
- public LibraryPrx getLibrary()
- {
- return _session.getLibrary();
- }
-
- public void destroy()
- {
- _session.destroy();
- }
-
- public void refresh()
- {
- _session.refresh();
- }
-
- Glacier2SessionAdapter(Glacier2SessionPrx session)
- {
- _session = session;
- }
-
- private Glacier2SessionPrx _session;
- }
-
- static class DemoSessionAdapter implements SessionAdapter
- {
- public LibraryPrx getLibrary()
- {
- return _session.getLibrary();
- }
-
- public void destroy()
- {
- _session.destroy();
- }
-
- public void refresh()
- {
- _session.refresh();
- }
-
- DemoSessionAdapter(SessionPrx session)
- {
- _session = session;
- }
-
- private SessionPrx _session;
- }
-
static private class SessionRefreshThread extends Thread
{
SessionRefreshThread(Ice.Logger logger, long timeout, SessionAdapter session)
@@ -124,7 +74,7 @@ class RunParser
runParser(String appName, String[] args, Ice.Communicator communicator)
{
SessionAdapter session;
- Glacier2.RouterPrx router = Glacier2.RouterPrxHelper.uncheckedCast(communicator.getDefaultRouter());
+ final Glacier2.RouterPrx router = Glacier2.RouterPrxHelper.uncheckedCast(communicator.getDefaultRouter());
long timeout;
if(router != null)
{
@@ -166,7 +116,36 @@ class RunParser
ex.printStackTrace();
}
}
- session = new Glacier2SessionAdapter(Glacier2SessionPrxHelper.uncheckedCast(glacier2session));
+ final Glacier2SessionPrx sess = Glacier2SessionPrxHelper.uncheckedCast(glacier2session);
+ session = new SessionAdapter()
+ {
+ public LibraryPrx getLibrary()
+ {
+ return sess.getLibrary();
+ }
+
+ public void destroy()
+ {
+ try
+ {
+ router.destroySession();
+ }
+ catch(Glacier2.SessionNotExistException ex)
+ {
+ }
+ catch(Ice.ConnectionLostException ex)
+ {
+ //
+ // Expected: the router closed the connection.
+ //
+ }
+ }
+
+ public void refresh()
+ {
+ sess.refresh();
+ }
+ };
}
else
{
@@ -178,7 +157,24 @@ class RunParser
return 1;
}
- session = new DemoSessionAdapter(factory.create());
+ final SessionPrx sess = factory.create();
+ session = new SessionAdapter()
+ {
+ public LibraryPrx getLibrary()
+ {
+ return sess.getLibrary();
+ }
+
+ public void destroy()
+ {
+ sess.destroy();
+ }
+
+ public void refresh()
+ {
+ sess.refresh();
+ }
+ };
timeout = factory.getSessionTimeout()/2;
}
SessionRefreshThread refresh = new SessionRefreshThread(communicator.getLogger(), timeout, session);
diff --git a/java/demo/Database/library/Session.ice b/java/demo/Database/library/Session.ice
index 5640227eb05..8c223c370f4 100644
--- a/java/demo/Database/library/Session.ice
+++ b/java/demo/Database/library/Session.ice
@@ -1,6 +1,10 @@
// **********************************************************************
//
+<<<<<<< HEAD:java/demo/Database/library/Session.ice
// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
+=======
+// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved.
+>>>>>>> origin/R3_3_branch:java/demo/Database/library/Session.ice
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
diff --git a/java/demo/Database/library/build.xml b/java/demo/Database/library/build.xml
index 915b235a438..5d894d4610c 100644
--- a/java/demo/Database/library/build.xml
+++ b/java/demo/Database/library/build.xml
@@ -1,7 +1,11 @@
<!--
**********************************************************************
+<<<<<<< HEAD:java/demo/Database/library/build.xml
Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
+=======
+ Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved.
+>>>>>>> origin/R3_3_branch:java/demo/Database/library/build.xml
This copy of Ice is licensed to you under the terms described in the
ICE_LICENSE file included in this distribution.
diff --git a/java/demo/Database/library/config.client b/java/demo/Database/library/config.client
index 9f0fa65a663..ca71c17ee16 100644
--- a/java/demo/Database/library/config.client
+++ b/java/demo/Database/library/config.client
@@ -25,7 +25,11 @@ Ice.RetryIntervals=-1
#
# Warn about connection exceptions
#
+<<<<<<< HEAD:java/demo/Database/library/config.client
Ice.Warn.Connections=1
+=======
+#Ice.Warn.Connections=1
+>>>>>>> origin/R3_3_branch:java/demo/Database/library/config.client
#
# Network Tracing
diff --git a/java/demo/Ice/applet/.gitignore b/java/demo/Ice/applet/.gitignore
new file mode 100644
index 00000000000..e5786e5ddd4
--- /dev/null
+++ b/java/demo/Ice/applet/.gitignore
@@ -0,0 +1 @@
+Hello.jar
diff --git a/java/demo/Ice/applet/HelloApplet.java b/java/demo/Ice/applet/HelloApplet.java
index 2de5b0ba04d..504f775a148 100644
--- a/java/demo/Ice/applet/HelloApplet.java
+++ b/java/demo/Ice/applet/HelloApplet.java
@@ -43,7 +43,27 @@ public class HelloApplet extends JApplet
Ice.InitializationData initData = new Ice.InitializationData();
initData.properties = Ice.Util.createProperties();
initData.properties.setProperty("Ice.ACM.Client", "10");
+ initData.properties.setProperty("Ice.Trace.Network", "3");
+ initData.properties.setProperty("IceSSL.Trace.Security", "3");
+ initData.properties.setProperty("IceSSL.Password", "password");
+ initData.properties.setProperty("Ice.InitPlugins", "0");
+ initData.properties.setProperty("Ice.Plugin.IceSSL", "IceSSL.PluginFactory");
_communicator = Ice.Util.initialize(initData);
+
+ //
+ // We delayed the initialization of the IceSSL plug-in by setting Ice.InitPlugins=0.
+ // Now we obtain a reference to the plugin so that we can supply a keystore and
+ // truststore using a resource file.
+ //
+ IceSSL.Plugin plugin = (IceSSL.Plugin)_communicator.getPluginManager().getPlugin("IceSSL");
+ java.io.InputStream certs = getClass().getClassLoader().getResourceAsStream("client.jks");
+ plugin.setKeystoreStream(certs);
+ plugin.setTruststoreStream(certs);
+
+ //
+ // Finally, we're ready to complete the initialization.
+ //
+ _communicator.getPluginManager().initializePlugins();
}
catch(Throwable ex)
{
diff --git a/java/demo/Ice/applet/README b/java/demo/Ice/applet/README
index 83e3cfc5e84..c5edfad259f 100644
--- a/java/demo/Ice/applet/README
+++ b/java/demo/Ice/applet/README
@@ -1,5 +1,7 @@
This demo presents an unsigned applet that shows how to make
-asynchronous Ice invocations in a graphical application.
+asynchronous Ice invocations in a graphical application. It also
+demonstrates how to configure IceSSL using a resource file as the
+keystore.
The demo includes a start page (hello.html) that you will need to
publish on a web server. This page assumes that the demo applet is
diff --git a/java/demo/Ice/applet/build.xml b/java/demo/Ice/applet/build.xml
index 0f3ea00c870..495021109ad 100644
--- a/java/demo/Ice/applet/build.xml
+++ b/java/demo/Ice/applet/build.xml
@@ -52,6 +52,9 @@
<include name="Demo/**"/>
<include name="HelloApplet*"/>
</jar>
+ <jar jarfile="Hello.jar" update="true" basedir="${top.dir}/../certs">
+ <include name="client.jks"/>
+ </jar>
</target>
<target name="proguard-jar" depends="jar" if="proguard-found">
@@ -77,6 +80,7 @@
<proguard configuration="applet.pro">
<injar path="${class.dir}"/>
+ <injar path="${top.dir}/../certs/client.jks"/>
<injar refid="ice.classpath" filter="!META-INF/**"/>
<outjar path="Hello.jar"/>
<libraryjar path="${library.jars}"/>
diff --git a/java/demo/RMI/README b/java/demo/RMI/README
deleted file mode 100644
index 50bf06f8b2f..00000000000
--- a/java/demo/RMI/README
+++ /dev/null
@@ -1,12 +0,0 @@
-Demos in this directory:
-
-- latency
-
- A simple latency test that measures the basic call dispatch delay of RMI.
-
-- throughput
-
- A simple RMI throughput demo that allows you to send sequences of
- various types between client and server and to measure the maximum
- bandwidth that can be achieved using serialized synchronous
- requests.
diff --git a/java/demo/RMI/build.xml b/java/demo/RMI/build.xml
deleted file mode 100644
index d7424212ffe..00000000000
--- a/java/demo/RMI/build.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<!--
- **********************************************************************
-
- Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
-
- This copy of Ice is licensed to you under the terms described in the
- ICE_LICENSE file included in this distribution.
-
- **********************************************************************
--->
-
-<project name="demo" default="all" basedir=".">
-
- <target name="all">
- <ant dir="latency"/>
- <ant dir="throughput"/>
- </target>
-
- <target name="clean">
- <ant dir="latency" target="clean"/>
- <ant dir="throughput" target="clean"/>
- </target>
-
-</project>
diff --git a/java/demo/RMI/throughput/Client.java b/java/demo/RMI/throughput/Client.java
deleted file mode 100755
index f54ea3e6c21..00000000000
--- a/java/demo/RMI/throughput/Client.java
+++ /dev/null
@@ -1,421 +0,0 @@
-// **********************************************************************
-//
-// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
-//
-// This copy of Ice is licensed to you under the terms described in the
-// ICE_LICENSE file included in this distribution.
-//
-// **********************************************************************
-
-import java.rmi.registry.LocateRegistry;
-import java.rmi.registry.Registry;
-
-public class Client
-{
- private static void
- menu()
- {
- System.out.println(
- "usage:\n" +
- "\n" +
- "toggle type of data to send:\n" +
- "1: sequence of bytes (default)\n" +
- "2: sequence of strings (\"hello\")\n" +
- "3: sequence of structs with a string (\"hello\") and a double\n" +
- "4: sequence of structs with two ints and a double\n" +
- "\n" +
- "select test to run:\n" +
- "t: Send sequence\n" +
- "r: Receive sequence\n" +
- "e: Echo (send and receive) sequence\n" +
- "\n" +
- "other commands:\n" +
- "s: shutdown server\n" +
- "x: exit\n" +
- "?: help\n");
- }
-
- public int
- run(String args[]) throws java.lang.Exception
- {
- String registryHost;
- if(args.length == 0)
- {
- registryHost = "127.0.0.1";
- }
- else if(args.length == 1)
- {
- registryHost = args[0];
- }
- else
- {
- System.err.println("usage: java Client [registryHost]");
- return 1;
- }
-
-
- if(System.getSecurityManager() == null)
- {
- System.setSecurityManager(new SecurityManager());
- }
- Registry registry = LocateRegistry.getRegistry(registryHost);
- Throughput throughput = (Throughput)registry.lookup("throughput");
-
- byte[] byteSeq = new byte[Throughput.ByteSeqSize];
-
- String[] stringSeq = new String[Throughput.StringSeqSize];
- for(int i = 0; i < Throughput.StringSeqSize; ++i)
- {
- stringSeq[i] = new String("hello");
- }
-
- Throughput.StringDouble[] structSeq = new Throughput.StringDouble[Throughput.StringDoubleSeqSize];
- for(int i = 0; i < Throughput.StringDoubleSeqSize; ++i)
- {
- structSeq[i] = new Throughput.StringDouble();
- structSeq[i].s = new String("Hello");
- structSeq[i].d = 3.14;
- }
-
- Throughput.Fixed[] fixedSeq = new Throughput.Fixed[Throughput.FixedSeqSize];
- for(int i = 0; i < Throughput.FixedSeqSize; ++i)
- {
- fixedSeq[i] = new Throughput.Fixed();
- fixedSeq[i].i = 0;
- fixedSeq[i].j = 0;
- fixedSeq[i].d = 0;
- }
-
- {
- byte[] emptyBytes= new byte[1];
- String[] emptyStrings = new String[1];
- Throughput.StringDouble[] emptyStructs = new Throughput.StringDouble[1];
- emptyStructs[0] = new Throughput.StringDouble();
- Throughput.Fixed[] emptyFixed = new Throughput.Fixed[1];
- emptyFixed[0] = new Throughput.Fixed();
-
- System.out.print("warming up...");
- System.out.flush();
- for(int i = 0; i < 100; i++)
- {
- throughput.sendByteSeq(emptyBytes);
- throughput.recvByteSeq();
- throughput.echoByteSeq(emptyBytes);
-
- throughput.sendStringSeq(emptyStrings);
- throughput.recvStringSeq();
- throughput.echoFixedSeq(emptyFixed);
-
- throughput.sendStructSeq(emptyStructs);
- throughput.recvStructSeq();
- throughput.echoStructSeq(emptyStructs);
-
- throughput.sendFixedSeq(emptyFixed);
- throughput.recvFixedSeq();
- throughput.echoStringSeq(emptyStrings);
- }
- System.out.println();
- }
-
- menu();
-
- java.io.BufferedReader in = new java.io.BufferedReader(new java.io.InputStreamReader(System.in));
-
- char currentType = '1';
- int seqSize = Throughput.ByteSeqSize;
-
- String line = null;
- do
- {
- try
- {
- System.out.print("==> ");
- System.out.flush();
- line = in.readLine();
- if(line == null)
- {
- break;
- }
-
- long tmsec = System.currentTimeMillis();
- final int repetitions = 100;
-
- if(line.equals("1") || line.equals("2") || line.equals("3") || line.equals("4"))
- {
- currentType = line.charAt(0);
-
- switch(currentType)
- {
- case '1':
- {
- System.out.println("using byte sequences");
- seqSize = Throughput.ByteSeqSize;
- break;
- }
-
- case '2':
- {
- System.out.println("using string sequences");
- seqSize = Throughput.StringSeqSize;
- break;
- }
-
- case '3':
- {
- System.out.println("using variable-length struct sequences");
- seqSize = Throughput.StringDoubleSeqSize;
- break;
- }
-
- case '4':
- {
- System.out.println("using fixed-length struct sequences");
- seqSize = Throughput.FixedSeqSize;
- break;
- }
- }
- }
- else if(line.equals("t") || line.equals("o") || line.equals("r") || line.equals("e"))
- {
- char c = line.charAt(0);
-
- switch(c)
- {
- case 't':
- {
- System.out.print("sending");
- break;
- }
-
- case 'r':
- {
- System.out.print("receiving");
- break;
- }
-
- case 'e':
- {
- System.out.print("sending and receiving");
- break;
- }
- }
-
- System.out.print(" " + repetitions);
- switch(currentType)
- {
- case '1':
- {
- System.out.print(" byte");
- break;
- }
-
- case '2':
- {
- System.out.print(" string");
- break;
- }
-
- case '3':
- {
- System.out.print(" variable-length struct");
- break;
- }
-
- case '4':
- {
- System.out.print(" fixed-length struct");
- break;
- }
- }
-
- System.out.print(" sequences of size " + seqSize + "...");
-
-
- for(int i = 0; i < repetitions; ++i)
- {
- switch(currentType)
- {
- case '1':
- {
- switch(c)
- {
- case 't':
- {
- throughput.sendByteSeq(byteSeq);
- break;
- }
-
- case 'r':
- {
- throughput.recvByteSeq();
- break;
- }
-
- case 'e':
- {
- throughput.echoByteSeq(byteSeq);
- break;
- }
- }
- break;
- }
-
- case '2':
- {
- switch(c)
- {
- case 't':
- {
- throughput.sendStringSeq(stringSeq);
- break;
- }
-
- case 'r':
- {
- throughput.recvStringSeq();
- break;
- }
-
- case 'e':
- {
- throughput.echoStringSeq(stringSeq);
- break;
- }
- }
- break;
- }
-
- case '3':
- {
- switch(c)
- {
- case 't':
- {
- throughput.sendStructSeq(structSeq);
- break;
- }
-
- case 'r':
- {
- throughput.recvStructSeq();
- break;
- }
-
- case 'e':
- {
- throughput.echoStructSeq(structSeq);
- break;
- }
- }
- break;
- }
-
- case '4':
- {
- switch(c)
- {
- case 't':
- {
- throughput.sendFixedSeq(fixedSeq);
- break;
- }
-
- case 'r':
- {
- throughput.recvFixedSeq();
- break;
- }
-
- case 'e':
- {
- throughput.echoFixedSeq(fixedSeq);
- break;
- }
- }
- break;
- }
- }
- }
-
- double dmsec = System.currentTimeMillis() - tmsec;
- System.out.println("time for " + repetitions + " sequences: " + dmsec + "ms");
- System.out.println("time per sequence: " + dmsec / repetitions + "ms");
- int size = 0;
- switch(currentType)
- {
- case '1':
- {
- size = 1;
- break;
- }
-
- case '2':
- {
- size = stringSeq[0].length();
- break;
- }
-
- case '3':
- {
- size = structSeq[0].s.length() + 8;
- break;
- }
-
- case '4':
- {
- size = 16; // Two ints and a double.
- break;
- }
- }
- double mbit = repetitions * seqSize * size * 8.0 / dmsec / 1000.0;
- if(c == 'e')
- {
- mbit *= 2;
- }
- System.out.println("throughput: " + new java.text.DecimalFormat("#.##").format(mbit) + "Mbps");
- }
- else if(line.equals("s"))
- {
- throughput.shutdown();
- }
- else if(line.equals("x"))
- {
- // Nothing to do
- }
- else if(line.equals("?"))
- {
- menu();
- }
- else
- {
- System.out.println("unknown command `" + line + "'");
- menu();
- }
- }
- catch(Exception ex)
- {
- ex.printStackTrace();
- }
- }
- while(!line.equals("x"));
-
- return 0;
- }
-
- public static void
- main(String[] args)
- {
- Client app = new Client();
- int status;
- try
- {
- status = app.run(args);
- }
- catch(Exception e)
- {
- System.err.println(e);
- status = 1;
- }
- System.exit(status);
- }
-}
diff --git a/java/demo/RMI/throughput/README b/java/demo/RMI/throughput/README
deleted file mode 100755
index 82fa2178612..00000000000
--- a/java/demo/RMI/throughput/README
+++ /dev/null
@@ -1,26 +0,0 @@
-A simple RMI throughput demo that allows you to send sequences of various
-types between client and server and to measure the maximum bandwidth
-that can be achieved using serialized synchronous requests.
-
-To run the demo, start the RMI registry:
-
-$ rmiregistry
-
-In a separate window, start the server:
-
-$ java -Djava.rmi.server.hostname=127.0.0.1 -Djava.rmi.server.codebase=file:/c:/path/to/ice/java/demo/RMI/throughput/classes/ -Djava.security.policy=policy Server
-
-You need to edit the path on the command line to specify this directory.
-Under Vista, you must run the server as administrator.
-
-In a separate window, start the client:
-
-$ client.exe --Djava.security.policy=policy Client
-
-If you want to run client and server on different machines, you
-can specify the hsot on which you started the registry on
-the client's command line, for example:
-
-$ client.exe --Djava.security.policy=policy Client 192.168.4.2
-
-This directs the client to connect to the registry at the specified IP address.
diff --git a/java/demo/RMI/throughput/Server.java b/java/demo/RMI/throughput/Server.java
deleted file mode 100755
index fbfc8680d8d..00000000000
--- a/java/demo/RMI/throughput/Server.java
+++ /dev/null
@@ -1,145 +0,0 @@
-// **********************************************************************
-//
-// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
-//
-// This copy of Ice is licensed to you under the terms described in the
-// ICE_LICENSE file included in this distribution.
-//
-// **********************************************************************
-
-import java.rmi.RemoteException;
-import java.rmi.registry.LocateRegistry;
-import java.rmi.registry.Registry;
-import java.rmi.server.UnicastRemoteObject;
-
-public class Server implements Throughput
-{
-
- public
- Server()
- {
- _byteSeq = new byte[ByteSeqSize];
-
- _stringSeq = new String[StringSeqSize];
- for(int i = 0; i < StringSeqSize; ++i)
- {
- _stringSeq[i] = new String("hello");
- }
-
- _structSeq = new StringDouble[StringDoubleSeqSize];
- for(int i = 0; i < StringDoubleSeqSize; ++i)
- {
- _structSeq[i] = new StringDouble();
- _structSeq[i].s = new String("hello");
- _structSeq[i].d = 3.14;
- }
-
- _fixedSeq = new Fixed[FixedSeqSize];
- for(int i = 0; i < FixedSeqSize; ++i)
- {
- _fixedSeq[i] = new Fixed();
- _fixedSeq[i].i = 0;
- _fixedSeq[i].j = 0;
- _fixedSeq[i].d = 0;
- }
- }
-
- public void
- sendByteSeq(byte[] seq)
- {
- }
-
- public byte[]
- recvByteSeq()
- {
- return _byteSeq;
- }
-
- public byte[]
- echoByteSeq(byte[] seq)
- {
- return seq;
- }
-
- public void
- sendStringSeq(String[] seq)
- {
- }
-
- public String[]
- recvStringSeq()
- {
- return _stringSeq;
- }
-
- public String[]
- echoStringSeq(String[] seq)
- {
- return seq;
- }
-
- public void
- sendStructSeq(StringDouble[] seq)
- {
- }
-
- public StringDouble[]
- recvStructSeq()
- {
- return _structSeq;
- }
-
- public StringDouble[]
- echoStructSeq(StringDouble[] seq)
- {
- return seq;
- }
-
- public void
- sendFixedSeq(Fixed[] seq)
- {
- }
-
- public Fixed[]
- recvFixedSeq()
- {
- return _fixedSeq;
- }
-
- public Fixed[]
- echoFixedSeq(Fixed[] seq)
- {
- return seq;
- }
-
- public void
- shutdown()
- {
- System.exit(0);
- }
-
- private byte[] _byteSeq;
- private String[] _stringSeq;
- private StringDouble[] _structSeq;
- private Fixed[] _fixedSeq;
-
- public static void main(String[] args)
- {
- if(System.getSecurityManager() == null)
- {
- System.setSecurityManager(new SecurityManager());
- }
- try
- {
- Throughput servant = new Server();
- Throughput stub = (Throughput)UnicastRemoteObject.exportObject(servant, 0);
- Registry registry = LocateRegistry.getRegistry();
- registry.rebind("throughput", stub);
- System.out.println("ready");
- }
- catch(Exception e)
- {
- System.err.println(e);
- }
- }
-}
diff --git a/java/demo/RMI/throughput/Throughput.java b/java/demo/RMI/throughput/Throughput.java
deleted file mode 100755
index 92c7f8717a7..00000000000
--- a/java/demo/RMI/throughput/Throughput.java
+++ /dev/null
@@ -1,51 +0,0 @@
-// **********************************************************************
-//
-// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
-//
-// This copy of Ice is licensed to you under the terms described in the
-// ICE_LICENSE file included in this distribution.
-//
-// **********************************************************************
-
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-
-public interface Throughput extends Remote
-{
- int ByteSeqSize = 500000;
-
- int StringSeqSize = 50000;
-
- class StringDouble implements java.io.Serializable
- {
- public String s;
- public double d;
- };
- int StringDoubleSeqSize = 50000;
-
- class Fixed implements java.io.Serializable
- {
- int i;
- int j;
- double d;
- };
- int FixedSeqSize = 50000;
-
- void sendByteSeq(byte[] seq) throws RemoteException;
- byte[] recvByteSeq() throws RemoteException;
- byte[] echoByteSeq(byte[] seq) throws RemoteException;
-
- void sendStringSeq(String[] seq) throws RemoteException;
- String[] recvStringSeq() throws RemoteException;
- String[] echoStringSeq(String[] seq) throws RemoteException;
-
- void sendStructSeq(StringDouble[] seq) throws RemoteException;
- StringDouble[] recvStructSeq() throws RemoteException;
- StringDouble[] echoStructSeq(StringDouble[] seq) throws RemoteException;
-
- void sendFixedSeq(Fixed[] seq) throws RemoteException;
- Fixed[] recvFixedSeq() throws RemoteException;
- Fixed[] echoFixedSeq(Fixed[] seq) throws RemoteException;
-
- void shutdown() throws RemoteException;
-}
diff --git a/java/demo/RMI/throughput/build.xml b/java/demo/RMI/throughput/build.xml
deleted file mode 100755
index 89f2881febc..00000000000
--- a/java/demo/RMI/throughput/build.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<!--
- **********************************************************************
-
- Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
-
- This copy of Ice is licensed to you under the terms described in the
- ICE_LICENSE file included in this distribution.
-
- **********************************************************************
--->
-
-<project name="rmi_throughput" default="all" basedir=".">
-
- <!-- set global properties for this build -->
- <property name="top.dir" value="../../.."/>
-
- <!-- import common definitions -->
- <import file="${top.dir}/config/common.xml"/>
-
- <target name="compile">
- <mkdir dir="${class.dir}"/>
- <javac srcdir="." destdir="${class.dir}"
- debug="${debug}">
- <compilerarg value="${javac.lint}"/>
- </javac>
- </target>
-
- <target name="all" depends="compile"/>
-
- <target name="clean">
- <delete dir="${generated.dir}"/>
- <delete dir="${class.dir}"/>
- </target>
-
-</project>
diff --git a/java/demo/RMI/throughput/policy b/java/demo/RMI/throughput/policy
deleted file mode 100755
index 1b73fb10b9c..00000000000
--- a/java/demo/RMI/throughput/policy
+++ /dev/null
@@ -1,3 +0,0 @@
-grant {
- permission java.net.SocketPermission "*:*", "connect,accept,resolve,listen";
-};