diff options
Diffstat (limited to 'java/demo/Ice/nested')
-rw-r--r-- | java/demo/Ice/nested/.externalToolBuilders/demo.Ice.nested.slice.launch | 17 | ||||
-rw-r--r-- | java/demo/Ice/nested/Client.java | 124 | ||||
-rw-r--r-- | java/demo/Ice/nested/Nested.ice | 20 | ||||
-rw-r--r-- | java/demo/Ice/nested/NestedI.java | 36 | ||||
-rw-r--r-- | java/demo/Ice/nested/README | 10 | ||||
-rw-r--r-- | java/demo/Ice/nested/Server.java | 40 | ||||
-rw-r--r-- | java/demo/Ice/nested/config.client | 46 | ||||
-rw-r--r-- | java/demo/Ice/nested/config.server | 41 | ||||
-rwxr-xr-x | java/demo/Ice/nested/expect.py | 30 |
9 files changed, 0 insertions, 364 deletions
diff --git a/java/demo/Ice/nested/.externalToolBuilders/demo.Ice.nested.slice.launch b/java/demo/Ice/nested/.externalToolBuilders/demo.Ice.nested.slice.launch deleted file mode 100644 index fb17d0b31db..00000000000 --- a/java/demo/Ice/nested/.externalToolBuilders/demo.Ice.nested.slice.launch +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType"> -<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_AUTO_TARGETS" value="generate,"/> -<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_CLEAN_TARGETS" value="clean,"/> -<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_MANUAL_TARGETS" value="generate,"/> -<booleanAttribute key="org.eclipse.ant.ui.ATTR_TARGETS_UPDATED" value="true"/> -<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/> -<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${project}"/> -<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/> -<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/> -<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="true"/> -<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="demo.Ice.nested"/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_BUILD_SCOPE" value="${working_set:<?xml version="1.0" encoding="UTF-8"?> <resources> <item path="/demo.Ice.nested/Nested.ice" type="1"/> </resources>}"/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/demo.Ice.nested/build.xml}"/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="incremental,auto,clean"/> -<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/> -</launchConfiguration> diff --git a/java/demo/Ice/nested/Client.java b/java/demo/Ice/nested/Client.java deleted file mode 100644 index e7ba716955b..00000000000 --- a/java/demo/Ice/nested/Client.java +++ /dev/null @@ -1,124 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2015 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 Demo.*; - -public class Client extends Ice.Application -{ - class ShutdownHook extends Thread - { - @Override - public void - run() - { - /* - * For this demo we won't destroy the communicator since it has to - * wait for any outstanding invocations to complete which may take - * some time if the nesting level is exceeded. - * - try - { - communicator().destroy(); - } - catch(Ice.LocalException ex) - { - ex.printStackTrace(); - } - */ - } - } - - @Override - public int - run(String[] args) - { - if(args.length > 0) - { - System.err.println(appName() + ": too many arguments"); - return 1; - } - - // - // Since this is an interactive demo we want to clear the - // Application installed interrupt callback and install our - // own shutdown hook. - // - setInterruptHook(new ShutdownHook()); - - NestedPrx nested = NestedPrxHelper.checkedCast(communicator().propertyToProxy("Nested.Proxy")); - if(nested == null) - { - System.err.println("invalid proxy"); - return 1; - } - - // - // Ensure the invocation times out if the nesting level is too - // high and there are no more threads in the thread pool to - // dispatch the call. - // - nested = (NestedPrx)nested.ice_invocationTimeout(5000); - - Ice.ObjectAdapter adapter = communicator().createObjectAdapter("Nested.Client"); - NestedPrx self = - NestedPrxHelper.uncheckedCast(adapter.createProxy(communicator().stringToIdentity("nestedClient"))); - adapter.add(new NestedI(self), communicator().stringToIdentity("nestedClient")); - adapter.activate(); - - System.out.println("Note: The maximum nesting level is sz * 2, with sz being"); - System.out.println("the maximum number of threads in the server thread pool. If"); - System.out.println("you specify a value higher than that, the application will"); - System.out.println("block or timeout."); - System.out.println(); - - java.io.BufferedReader in = new java.io.BufferedReader(new java.io.InputStreamReader(System.in)); - - String s = null; - do - { - try - { - System.out.print("enter nesting level or 'x' for exit: "); - System.out.flush(); - s = in.readLine(); - if(s == null) - { - break; - } - int level = Integer.parseInt(s); - if(level > 0) - { - nested.nestedCall(level, self); - } - } - catch(NumberFormatException ex) - { - } - catch(java.io.IOException ex) - { - ex.printStackTrace(); - } - catch(Ice.LocalException ex) - { - ex.printStackTrace(); - } - } - while(!s.equals("x")); - - return 0; - } - - public static void - main(String[] args) - { - Client app = new Client(); - int status = app.main("Client", args, "config.client"); - System.exit(status); - } -} diff --git a/java/demo/Ice/nested/Nested.ice b/java/demo/Ice/nested/Nested.ice deleted file mode 100644 index 430e9db0bf1..00000000000 --- a/java/demo/Ice/nested/Nested.ice +++ /dev/null @@ -1,20 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2015 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. -// -// ********************************************************************** - -#pragma once - -module Demo -{ - -interface Nested -{ - void nestedCall(int level, Nested* proxy); -}; - -}; diff --git a/java/demo/Ice/nested/NestedI.java b/java/demo/Ice/nested/NestedI.java deleted file mode 100644 index 4756af60a74..00000000000 --- a/java/demo/Ice/nested/NestedI.java +++ /dev/null @@ -1,36 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2015 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 Demo.*; - -class NestedI extends _NestedDisp -{ - NestedI(NestedPrx self) - { - _self = self; - } - - @Override - public void - nestedCall(int level, NestedPrx proxy, Ice.Current current) - { - System.out.println("" + level); - if(--level > 0) - { - // - // Ensure the invocation times out if the nesting level is too - // high and there are no more threads in the thread pool to - // dispatch the call. - // - ((NestedPrx)proxy.ice_invocationTimeout(5000)).nestedCall(level, _self); - } - } - - private NestedPrx _self; -} diff --git a/java/demo/Ice/nested/README b/java/demo/Ice/nested/README deleted file mode 100644 index 52e427c4db6..00000000000 --- a/java/demo/Ice/nested/README +++ /dev/null @@ -1,10 +0,0 @@ -A demo to illustrate how nested callbacks work, and how the size of -the thread pool affects the maximum nesting depth. - -To run the demo, first start the server: - -$ java -jar build/libs/server.jar - -In a separate window, start the client: - -$ java -jar build/libs/client.jar diff --git a/java/demo/Ice/nested/Server.java b/java/demo/Ice/nested/Server.java deleted file mode 100644 index 399005786b6..00000000000 --- a/java/demo/Ice/nested/Server.java +++ /dev/null @@ -1,40 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2015 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 Demo.*; - -public class Server extends Ice.Application -{ - @Override - public int - run(String[] args) - { - if(args.length > 0) - { - System.err.println(appName() + ": too many arguments"); - return 1; - } - - Ice.ObjectAdapter adapter = communicator().createObjectAdapter("Nested.Server"); - NestedPrx self = - NestedPrxHelper.uncheckedCast(adapter.createProxy(communicator().stringToIdentity("nestedServer"))); - adapter.add(new NestedI(self), communicator().stringToIdentity("nestedServer")); - adapter.activate(); - communicator().waitForShutdown(); - return 0; - } - - public static void - main(String[] args) - { - Server app = new Server(); - int status = app.main("Server", args, "config.server"); - System.exit(status); - } -} diff --git a/java/demo/Ice/nested/config.client b/java/demo/Ice/nested/config.client deleted file mode 100644 index 31c04dd2609..00000000000 --- a/java/demo/Ice/nested/config.client +++ /dev/null @@ -1,46 +0,0 @@ -# -# The client reads this property to create the reference to the -# "Nested" object in the server. -# -Nested.Proxy=nestedServer:default -h localhost -p 10000 - -# -# The client creates one single object adapter with the name -# "Nested.Client". The following line sets the endpoints for this -# adapter. -# -Nested.Client.Endpoints=default -h localhost - -# -# The following properties configure the server thread pool. The -# thread pool initially contains 5 threads, and the Ice run time -# starts emitting warnings once 5 threads are in use. The Ice run time -# creates more threads once all 5 are in use, up to a maximum of 10 -# threads. -# -Ice.ThreadPool.Server.Size=5 -Ice.ThreadPool.Server.SizeWarn=5 -Ice.ThreadPool.Server.SizeMax=10 - -# -# Warn about connection exceptions -# -Ice.Warn.Connections=1 - -# -# Network Tracing -# -# 0 = no network tracing -# 1 = trace connection establishment and closure -# 2 = like 1, but more detailed -# 3 = like 2, but also trace data transfer -# -#Ice.Trace.Network=1 - -# -# Protocol Tracing -# -# 0 = no protocol tracing -# 1 = trace protocol messages -# -#Ice.Trace.Protocol=1 diff --git a/java/demo/Ice/nested/config.server b/java/demo/Ice/nested/config.server deleted file mode 100644 index 5b30db90cbc..00000000000 --- a/java/demo/Ice/nested/config.server +++ /dev/null @@ -1,41 +0,0 @@ -# -# The server creates one single object adapter with the name -# "Nested.Server". The following line sets the endpoints for this -# adapter. -# -Nested.Server.Endpoints=default -h localhost -p 10000 - -# -# The following properties configure the server thread pool. The -# thread pool initially contains 5 threads, and the Ice run time -# starts emitting warnings once 5 threads are in use. The Ice run time -# creates more threads once all 5 are in use, up to a maximum of 10 -# threads. -# -Ice.ThreadPool.Server.Size=5 -Ice.ThreadPool.Server.SizeWarn=5 -Ice.ThreadPool.Server.SizeMax=10 - -# -# Warn about connection exceptions -# -Ice.Warn.Connections=1 - -# -# Network Tracing -# -# 0 = no network tracing -# 1 = trace connection establishment and closure -# 2 = like 1, but more detailed -# 3 = like 2, but also trace data transfer -# -#Ice.Trace.Network=1 - -# -# Protocol Tracing -# -# 0 = no protocol tracing -# 1 = trace protocol messages -# -#Ice.Trace.Protocol=1 - diff --git a/java/demo/Ice/nested/expect.py b/java/demo/Ice/nested/expect.py deleted file mode 100755 index 5cc1860e32c..00000000000 --- a/java/demo/Ice/nested/expect.py +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env python -# ********************************************************************** -# -# Copyright (c) 2003-2015 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 sys, os - -path = [ ".", "..", "../..", "../../..", "../../../.." ] -head = os.path.dirname(sys.argv[0]) -if len(head) > 0: - path = [os.path.join(head, p) for p in path] -path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "demoscript")) ] -if len(path) == 0: - raise RuntimeError("can't find toplevel directory!") -sys.path.append(path[0]) - -from demoscript import Util -from demoscript.Ice import nested - -server = Util.spawn('java -jar build/libs/server.jar --Ice.PrintAdapterReady') -server.expect('.* ready') -client = Util.spawn('java -jar build/libs/client.jar --Ice.Override.Timeout=2000') -client.expect('.*for exit:') - -nested.run(client, server) |