| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- // Java Package psi is a proxy for talking to a Go program.
- // gobind -lang=java github.com/Psiphon-Labs/psiphon-tunnel-core/AndroidLibrary/psi
- //
- // File is generated by gobind. Do not edit.
- package go.psi;
- import go.Seq;
- public abstract class Psi {
- private Psi() {} // uninstantiable
-
- public interface Listener extends go.Seq.Object {
- public void Message(String message);
-
- public static abstract class Stub implements Listener {
- static final String DESCRIPTOR = "go.psi.Listener";
-
- private final go.Seq.Ref ref;
- public Stub() {
- ref = go.Seq.createRef(this);
- }
-
- public go.Seq.Ref ref() { return ref; }
-
- public void call(int code, go.Seq in, go.Seq out) {
- switch (code) {
- case Proxy.CALL_Message: {
- String param_message = in.readUTF16();
- this.Message(param_message);
- return;
- }
- default:
- throw new RuntimeException("unknown code: "+ code);
- }
- }
- }
-
- static final class Proxy implements Listener {
- static final String DESCRIPTOR = Stub.DESCRIPTOR;
-
- private go.Seq.Ref ref;
-
- Proxy(go.Seq.Ref ref) { this.ref = ref; }
-
- public go.Seq.Ref ref() { return ref; }
-
- public void call(int code, go.Seq in, go.Seq out) {
- throw new RuntimeException("cycle: cannot call proxy");
- }
-
- public void Message(String message) {
- go.Seq _in = new go.Seq();
- go.Seq _out = new go.Seq();
- _in.writeRef(ref);
- _in.writeUTF16(message);
- Seq.send(DESCRIPTOR, CALL_Message, _in, _out);
- }
-
- static final int CALL_Message = 0x10a;
- }
- }
-
- public static void Start(String configJson, Listener listener) throws Exception {
- go.Seq _in = new go.Seq();
- go.Seq _out = new go.Seq();
- _in.writeUTF16(configJson);
- _in.writeRef(listener.ref());
- Seq.send(DESCRIPTOR, CALL_Start, _in, _out);
- String _err = _out.readUTF16();
- if (_err != null) {
- throw new Exception(_err);
- }
- }
-
- public static void Stop() {
- go.Seq _in = new go.Seq();
- go.Seq _out = new go.Seq();
- Seq.send(DESCRIPTOR, CALL_Stop, _in, _out);
- }
-
- private static final int CALL_Start = 1;
- private static final int CALL_Stop = 2;
- private static final String DESCRIPTOR = "psi";
- }
|