bind: seq.Transact requires interface descriptor.

seq.Transact is called when Go calls a method of a foreign object
that implements a Go interface. Currently, we assume that the foreign
object has an instance method that can conduct the message routing,
so the object id and the method code is sufficient for transact.

Passing the interface descriptor (e.g.  go.testpkg.I) however allows
the bind internal to use non-instance methods to implement the routing.

Change-Id: I1f61a04f919fbd09117ea332d678cd50e4861e46
Reviewed-on: https://go-review.googlesource.com/12685
Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
Hyang-Ah (Hana) Kim
2015-07-27 18:08:41 +00:00
committed by Hyang-Ah Hana Kim
parent 73db4d8b43
commit c261c465a9
5 changed files with 12 additions and 10 deletions
+2 -2
View File
@@ -133,7 +133,7 @@ func RecvRes(handle C.int32_t, out *C.uint8_t, outlen C.size_t) {
// transact calls a method on a Java object instance.
// It blocks until the call is complete.
func transact(ref *seq.Ref, code int, in *seq.Buffer) *seq.Buffer {
func transact(ref *seq.Ref, _ string, code int, in *seq.Buffer) *seq.Buffer {
recv.Lock()
if recv.next == 1<<31-1 {
panic("recv handle overflow")
@@ -173,7 +173,7 @@ func init() {
if ref.Num < 0 {
panic(fmt.Sprintf("not a Java ref: %d", ref.Num))
}
transact(ref, -1, new(seq.Buffer))
transact(ref, "", -1, new(seq.Buffer))
}
seq.Transact = transact