Merge "veyron/runtimes/google/ipc/stream/vif: Fix race in VIF closure."
diff --git a/runtimes/google/ipc/jni/arg_getter.go b/runtimes/google/ipc/jni/arg_getter.go
index 7479f00..7540bd3 100644
--- a/runtimes/google/ipc/jni/arg_getter.go
+++ b/runtimes/google/ipc/jni/arg_getter.go
@@ -10,11 +10,18 @@
"veyron/examples/fortune"
ctx "veyron2/context"
"veyron2/ipc"
+ "veyron2/services/proximity"
)
func init() {
registerInterface((*fortune.Fortune)(nil))
registerInterface((*fortune.FortuneService)(nil))
+ registerInterface((*proximity.Proximity)(nil))
+ registerInterface((*proximity.ProximityService)(nil))
+ registerInterface((*proximity.ProximityScanner)(nil))
+ registerInterface((*proximity.ProximityScannerService)(nil))
+ registerInterface((*proximity.ProximityAnnouncer)(nil))
+ registerInterface((*proximity.ProximityAnnouncerService)(nil))
}
// A list of all registered argGetter-s.
diff --git a/runtimes/google/ipc/jni/client.go b/runtimes/google/ipc/jni/client.go
index e3fb714..58b446c 100644
--- a/runtimes/google/ipc/jni/client.go
+++ b/runtimes/google/ipc/jni/client.go
@@ -37,9 +37,10 @@
argStrs[i] = goString(env, C.jstring(C.GetObjectArrayElement(env, jArgs, C.jsize(i))))
}
// Get argument instances that correspond to the provided method.
- getter := newArgGetter(strings.Join(strings.Split(goString(env, jPath), ".")[1:], "/"))
+ vdlPackagePath := strings.Join(strings.Split(goString(env, jPath), ".")[1:], "/")
+ getter := newArgGetter(vdlPackagePath)
if getter == nil {
- return nil, fmt.Errorf("couldn't find VDL interface corresponding to path %q", goString(env, jPath))
+ return nil, fmt.Errorf("couldn't find VDL interface corresponding to path %q", vdlPackagePath)
}
mArgs := getter.FindMethod(method, len(argStrs))
if mArgs == nil {
@@ -116,6 +117,7 @@
return nil, fmt.Errorf("error marshalling %q into JSON", resultptr)
}
}
+
// Convert to Java array of C.jstring.
ret := C.NewObjectArray(env, C.jsize(len(jsonResults)), jStringClass, nil)
for i, result := range jsonResults {
diff --git a/runtimes/google/ipc/jni/invoker.go b/runtimes/google/ipc/jni/invoker.go
index 5c62670..12d8c57 100644
--- a/runtimes/google/ipc/jni/invoker.go
+++ b/runtimes/google/ipc/jni/invoker.go
@@ -44,9 +44,10 @@
// Fetch the argGetter for the object.
pid := jMethodID(env, jVDLInvokerClass, "getInterfacePath", fmt.Sprintf("()%s", stringSign))
jPath := C.jstring(C.CallGetInterfacePath(env, jInvoker, pid))
- getter := newArgGetter(strings.Join(strings.Split(goString(env, jPath), ".")[1:], "/"))
+ vdlPackagePath := strings.Join(strings.Split(goString(env, jPath), ".")[1:], "/")
+ getter := newArgGetter(vdlPackagePath)
if getter == nil {
- return nil, fmt.Errorf("couldn't find VDL interface corresponding to path %q", goString(env, jPath))
+ return nil, fmt.Errorf("couldn't find VDL interface corresponding to path %q", vdlPackagePath)
}
// Reference Java invoker; it will be de-referenced when the go invoker
// created below is garbage-collected (through the finalizer callback we
diff --git a/runtimes/google/ipc/jni/jni.go b/runtimes/google/ipc/jni/jni.go
index d9e6a98..627d828 100644
--- a/runtimes/google/ipc/jni/jni.go
+++ b/runtimes/google/ipc/jni/jni.go
@@ -173,8 +173,8 @@
}
}
-//export Java_com_veyron_runtimes_google_jni_Runtime_00024Server_nativeStop
-func Java_com_veyron_runtimes_google_jni_Runtime_00024Server_nativeStop(env *C.JNIEnv, server C.jobject, goServerPtr C.jlong) {
+//export Java_com_veyron_runtimes_google_Runtime_00024Server_nativeStop
+func Java_com_veyron_runtimes_google_Runtime_00024Server_nativeStop(env *C.JNIEnv, server C.jobject, goServerPtr C.jlong) {
s := (*ipc.Server)(ptr(goServerPtr))
if s == nil {
jThrowV(env, fmt.Errorf("Couldn't find Go server with pointer: %d", int(goServerPtr)))
@@ -186,8 +186,8 @@
}
}
-//export Java_com_veyron_runtimes_google_jni_Runtime_00024Server_nativeFinalize
-func Java_com_veyron_runtimes_google_jni_Runtime_00024Server_nativeFinalize(env *C.JNIEnv, server C.jobject, goServerPtr C.jlong) {
+//export Java_com_veyron_runtimes_google_Runtime_00024Server_nativeFinalize
+func Java_com_veyron_runtimes_google_Runtime_00024Server_nativeFinalize(env *C.JNIEnv, server C.jobject, goServerPtr C.jlong) {
s := (*ipc.Server)(ptr(goServerPtr))
if s != nil {
goUnref(s)