discovery: introduce session to discovery

  Currently we have only one discovery instance per runtime and all
  discovery clients share the same instance. Although this makes sense
  and required, it may cause inconvenience in some cases like when a
  user wants to excludes services that are advertised by the same
  discovery client.

  This change introduces 'session' to discovery so that we can
  distinguish discovery clients including

    o simplify discovery.T interface
      - remove unnecessary/not-used interfaces.
    o make discovery.T as a sessioned discovery and change v23 API for
      getting discovery instance.
    o change scan() to filter out advertisements from the same discovery.T
      instance.
    o remove discovery service
      - the current interface is not sufficient. E.g., there is no way
        to remove obsolete advertisement.
      - discovery as a service doesn't make sense for now.
      - if needed, we can add it again with more complete
        api/implementation later.

MultiPart: 4/4
Change-Id: I3df1dab7dd2b9d42e82a20247df44baf92f822cd
diff --git a/impl/google/rt/jni.go b/impl/google/rt/jni.go
index ee6eeb2..f6450fc 100644
--- a/impl/google/rt/jni.go
+++ b/impl/google/rt/jni.go
@@ -287,8 +287,8 @@
 	return C.jobject(unsafe.Pointer(jSpec))
 }
 
-//export Java_io_v_impl_google_rt_VRuntimeImpl_nativeGetDiscovery
-func Java_io_v_impl_google_rt_VRuntimeImpl_nativeGetDiscovery(jenv *C.JNIEnv, jRuntime C.jclass, jContext C.jobject) C.jobject {
+//export Java_io_v_impl_google_rt_VRuntimeImpl_nativeNewDiscovery
+func Java_io_v_impl_google_rt_VRuntimeImpl_nativeNewDiscovery(jenv *C.JNIEnv, jRuntime C.jclass, jContext C.jobject) C.jobject {
 	env := jutil.Env(uintptr(unsafe.Pointer(jenv)))
 	ctx, _, err := jcontext.GoContext(env, jutil.Object(uintptr(unsafe.Pointer(jContext))))
 	if err != nil {
@@ -296,7 +296,12 @@
 		return nil
 	}
 
-	jDiscovery, err := jdiscovery.JavaDiscovery(env, v23.GetDiscovery(ctx))
+	discovery, err := v23.NewDiscovery(ctx)
+	if err != nil {
+		jutil.JThrowV(env, err)
+		return nil
+	}
+	jDiscovery, err := jdiscovery.JavaDiscovery(env, discovery)
 	if err != nil {
 		jutil.JThrowV(env, err)
 		return nil