summaryrefslogtreecommitdiffstats
path: root/jrt_test/src/tests/mandatory-methods/RPCServer.java
diff options
context:
space:
mode:
Diffstat (limited to 'jrt_test/src/tests/mandatory-methods/RPCServer.java')
-rw-r--r--jrt_test/src/tests/mandatory-methods/RPCServer.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/jrt_test/src/tests/mandatory-methods/RPCServer.java b/jrt_test/src/tests/mandatory-methods/RPCServer.java
new file mode 100644
index 00000000000..a9fe3bae7b0
--- /dev/null
+++ b/jrt_test/src/tests/mandatory-methods/RPCServer.java
@@ -0,0 +1,21 @@
+// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+import com.yahoo.jrt.*;
+
+public class RPCServer {
+
+ public static void main(String[] args) {
+ if (args.length != 1) {
+ System.err.println("usage: RPCServer <spec>");
+ System.exit(1);
+ }
+ Supervisor orb = new Supervisor(new Transport());
+ try {
+ orb.listen(new Spec(args[0]));
+ } catch (ListenFailedException e) {
+ System.err.println("could not listen at " + args[0]);
+ System.exit(1);
+ }
+ orb.transport().join();
+ }
+}