aboutsummaryrefslogtreecommitdiffstats
path: root/jrt_test/src/tests/mandatory-methods/RPCServer.java
blob: ee187e6cd7482109eeb18e2e0a3e0d07274dca8f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright Yahoo. 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();
    }
}