blob: 71a8bf84eb52e9b8800cee4383651c4e0ae7de3d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
import com.yahoo.jrt.*;
public class MockupInvoke {
public static void main(String[] args) {
if (args.length != 3) {
System.out.println("error: Wrong number of parameters");
System.exit(0);
}
Transport transport = new Transport();
Supervisor orb = new Supervisor(transport);
Spec spec = new Spec(args[0]);
Request req = new Request("concat");
req.parameters().add(new StringValue(args[1]));
req.parameters().add(new StringValue(args[2]));
orb.invokeBatch(spec, req, 60.0);
if (req.isError()) {
System.out.println("error: " + req.errorCode()
+ ": " + req.errorMessage());
System.exit(0);
}
if (req.returnValues().size() != 1
|| req.returnValues().get(0).type() != 's') {
System.out.println("error: Wrong return values");
System.exit(0);
}
System.out.println("result: '"
+ req.returnValues().get(0).asString()
+ "'");
}
}
|