veyron2/ipc: change Lookup to take second arg that is the method being invoked.
- update all uses of Lookup
- rename SoloDispatcher to LeafDispatcher (since that seems like a better
name) and create a RootDispatcher which doesn't have the test that
LeafDispatcher does. Update all uses.
Arguably, these should be separate CLs, but since I lumped together
since they touch many of the same files.
Change-Id: I8b7aab4abecbf702f49a3851c50c48e596b6da57
diff --git a/examples/bank/pbankd/main.go b/examples/bank/pbankd/main.go
index e4fa5ef..f0a77e2 100644
--- a/examples/bank/pbankd/main.go
+++ b/examples/bank/pbankd/main.go
@@ -393,7 +393,7 @@
// authBankAccount security.Authorizer
// }
-// func (d BankDispatcher) Lookup(suffix string) (ipc.Invoker, security.Authorizer, error) {
+// func (d BankDispatcher) Lookup(suffix, method string) (ipc.Invoker, security.Authorizer, error) {
// fmt.Println("Dispatcher Lookup Suffix:", suffix)
// if suffix != "" {
// return d.invokerBankAccount, d.authBankAccount, nil
diff --git a/examples/boxes/android/src/boxesp2p/main.go b/examples/boxes/android/src/boxesp2p/main.go
index 392710b..b5f5a19 100644
--- a/examples/boxes/android/src/boxesp2p/main.go
+++ b/examples/boxes/android/src/boxesp2p/main.go
@@ -138,14 +138,14 @@
C.callMethod(env, jni.jObj, jni.jMID, jBoxId, &jPoints[0])
}
-func (d *boxesDispatcher) Lookup(suffix string) (ipc.Invoker, security.Authorizer, error) {
+func (d *boxesDispatcher) Lookup(suffix, method string) (ipc.Invoker, security.Authorizer, error) {
if strings.HasSuffix(suffix, "draw") {
return d.drawServer, d.drawAuth, nil
}
if strings.HasSuffix(suffix, "sync") {
return d.syncServer, d.syncAuth, nil
}
- return d.storeDispatcher.Lookup(suffix)
+ return d.storeDispatcher.Lookup(suffix, method)
}
func (gs *goState) SyncBoxes(context ipc.ServerContext) error {
diff --git a/examples/boxes/signallingserver/main.go b/examples/boxes/signallingserver/main.go
index 6a5074b..97058d3 100644
--- a/examples/boxes/signallingserver/main.go
+++ b/examples/boxes/signallingserver/main.go
@@ -36,7 +36,7 @@
invoker ipc.Invoker
}
-func (d *dispatcher) Lookup(suffix string) (ipc.Invoker, security.Authorizer, error) {
+func (d *dispatcher) Lookup(suffix, method string) (ipc.Invoker, security.Authorizer, error) {
suffix = strings.TrimPrefix(suffix, signallingServiceName)
return d.invoker, nil, nil
}
diff --git a/examples/fortune/fortuned/main.go b/examples/fortune/fortuned/main.go
index 09e43a7..2cce124 100644
--- a/examples/fortune/fortuned/main.go
+++ b/examples/fortune/fortuned/main.go
@@ -65,7 +65,7 @@
// Serve the fortune dispatcher, but don't publish its existence
// to a mount table.
- if err := s.Serve("", ipc.SoloDispatcher(serverFortune, vflag.NewAuthorizerOrDie())); err != nil {
+ if err := s.Serve("", ipc.LeafDispatcher(serverFortune, vflag.NewAuthorizerOrDie())); err != nil {
log.Fatal("error serving service: ", err)
}
diff --git a/examples/inspector/inspectord/services.go b/examples/inspector/inspectord/services.go
index a28c0a0..87fbe5b 100644
--- a/examples/inspector/inspectord/services.go
+++ b/examples/inspector/inspectord/services.go
@@ -168,7 +168,7 @@
return s.s.ls(glob, details, &stublessServer{call})
}
-func (d *dispatcher) Lookup(suffix string) (ipc.Invoker, security.Authorizer, error) {
+func (d *dispatcher) Lookup(suffix, method string) (ipc.Invoker, security.Authorizer, error) {
s := &server{}
cwd, err := os.Getwd()
if err != nil {
diff --git a/examples/rockpaperscissors/impl/impl_test.go b/examples/rockpaperscissors/impl/impl_test.go
index 6f1b7f2..703f76b 100644
--- a/examples/rockpaperscissors/impl/impl_test.go
+++ b/examples/rockpaperscissors/impl/impl_test.go
@@ -50,7 +50,7 @@
if _, err = server.Listen("tcp", "127.0.0.1:0"); err != nil {
t.Fatalf("Listen failed: %v", err)
}
- disp := ipc.SoloDispatcher(rps.NewServerRockPaperScissors(rpsService), nil)
+ disp := ipc.LeafDispatcher(rps.NewServerRockPaperScissors(rpsService), nil)
names := []string{"rps/judge/test", "rps/player/test", "rps/scorekeeper/test"}
for _, n := range names {
if err := server.Serve(n, disp); err != nil {
diff --git a/examples/rockpaperscissors/rpsbot/main.go b/examples/rockpaperscissors/rpsbot/main.go
index a7fd405..37164ac 100644
--- a/examples/rockpaperscissors/rpsbot/main.go
+++ b/examples/rockpaperscissors/rpsbot/main.go
@@ -40,7 +40,7 @@
rand.Seed(time.Now().UTC().UnixNano())
rpsService := impl.NewRPS()
- dispatcher := ipc.SoloDispatcher(rps.NewServerRockPaperScissors(rpsService), sflag.NewAuthorizerOrDie())
+ dispatcher := ipc.LeafDispatcher(rps.NewServerRockPaperScissors(rpsService), sflag.NewAuthorizerOrDie())
ep, err := server.Listen(*protocol, *address)
if err != nil {
diff --git a/examples/rockpaperscissors/rpsplayercli/main.go b/examples/rockpaperscissors/rpsplayercli/main.go
index 5384675..b60438d 100644
--- a/examples/rockpaperscissors/rpsplayercli/main.go
+++ b/examples/rockpaperscissors/rpsplayercli/main.go
@@ -107,7 +107,7 @@
}
ch := make(chan gameChallenge)
- dispatcher := ipc.SoloDispatcher(rps.NewServerPlayer(&impl{ch: ch}), sflag.NewAuthorizerOrDie())
+ dispatcher := ipc.LeafDispatcher(rps.NewServerPlayer(&impl{ch: ch}), sflag.NewAuthorizerOrDie())
ep, err := server.Listen(*protocol, *address)
if err != nil {
vlog.Fatalf("Listen(%q, %q) failed: %v", "tcp", *address, err)
diff --git a/examples/rockpaperscissors/rpsscorekeeper/main.go b/examples/rockpaperscissors/rpsscorekeeper/main.go
index 787907c..46caeb9 100644
--- a/examples/rockpaperscissors/rpsscorekeeper/main.go
+++ b/examples/rockpaperscissors/rpsscorekeeper/main.go
@@ -46,7 +46,7 @@
ch := make(chan rps.ScoreCard)
rpsService := &impl{ch}
- dispatcher := ipc.SoloDispatcher(rps.NewServerScoreKeeper(rpsService), sflag.NewAuthorizerOrDie())
+ dispatcher := ipc.LeafDispatcher(rps.NewServerScoreKeeper(rpsService), sflag.NewAuthorizerOrDie())
ep, err := server.Listen(*protocol, *address)
if err != nil {
vlog.Fatalf("Listen(%q, %q) failed: %v", "tcp", *address, err)
diff --git a/examples/runtime/utils.go b/examples/runtime/utils.go
index 5d35119..edd15a7 100644
--- a/examples/runtime/utils.go
+++ b/examples/runtime/utils.go
@@ -16,7 +16,7 @@
// servers.
type dispatcher struct{}
-func (dispatcher) Lookup(suffix string) (ipc.Invoker, security.Authorizer, error) {
+func (dispatcher) Lookup(suffix, method string) (ipc.Invoker, security.Authorizer, error) {
return nil, nil, nil
}
diff --git a/examples/tunnel/tunneld/main.go b/examples/tunnel/tunneld/main.go
index 157e7a2..7f66f11 100644
--- a/examples/tunnel/tunneld/main.go
+++ b/examples/tunnel/tunneld/main.go
@@ -73,7 +73,7 @@
fmt.Sprintf("tunnel/hwaddr/%s", hwaddr),
fmt.Sprintf("tunnel/id/%s", rt.R().Identity().PublicID()),
}
- dispatcher := ipc.SoloDispatcher(tunnel.NewServerTunnel(&impl.T{}), sflag.NewAuthorizerOrDie())
+ dispatcher := ipc.LeafDispatcher(tunnel.NewServerTunnel(&impl.T{}), sflag.NewAuthorizerOrDie())
published := false
for _, n := range names {
if err := server.Serve(n, dispatcher); err != nil {
diff --git a/examples/unresolve/test_util.go b/examples/unresolve/test_util.go
index acd3e96..b4cfc18 100644
--- a/examples/unresolve/test_util.go
+++ b/examples/unresolve/test_util.go
@@ -81,7 +81,7 @@
func childFortune(args []string) {
defer initRT()()
- server, _ := createServer(args[0], ipc.SoloDispatcher(fortuneidl.NewServerFortune(new(fortune)), nil))
+ server, _ := createServer(args[0], ipc.LeafDispatcher(fortuneidl.NewServerFortune(new(fortune)), nil))
defer server.Stop()
for _, arg := range args[1:] {
server.Serve(arg, nil)
@@ -115,12 +115,10 @@
return reply, nil
}
-// Can't use the soloDispatcher (which is a bad name in any case) since it
-// doesn't allow name suffixes (which is also a silly restriction).
-// TODO(cnicolaou): rework soloDispatcher.
+// Can't use the LeafDispatcher since it doesn't allow name suffixes.
type fortuned struct{ obj interface{} }
-func (f *fortuned) Lookup(string) (ipc.Invoker, security.Authorizer, error) {
+func (f *fortuned) Lookup(suffix, method string) (ipc.Invoker, security.Authorizer, error) {
return ipc.ReflectInvoker(f.obj), nil, nil
}
@@ -144,7 +142,7 @@
func childFortuneNoIDL(args []string) {
defer initRT()()
for _, arg := range args {
- server, _ := createServer(arg, ipc.SoloDispatcher(new(fortuneNoIDL), nil))
+ server, _ := createServer(arg, ipc.LeafDispatcher(new(fortuneNoIDL), nil))
defer server.Stop()
}
fmt.Println("ready")
diff --git a/examples/wspr_sample/sampled/lib/sampled.go b/examples/wspr_sample/sampled/lib/sampled.go
index 16a4376..aca80b5 100644
--- a/examples/wspr_sample/sampled/lib/sampled.go
+++ b/examples/wspr_sample/sampled/lib/sampled.go
@@ -17,7 +17,7 @@
errorThrower interface{}
}
-func (cd *cacheDispatcher) Lookup(suffix string) (ipc.Invoker, security.Authorizer, error) {
+func (cd *cacheDispatcher) Lookup(suffix, method string) (ipc.Invoker, security.Authorizer, error) {
if strings.HasPrefix(suffix, "errorThrower") {
return ipc.ReflectInvoker(cd.errorThrower), nil, nil
}
diff --git a/lib/signals/signals_test.go b/lib/signals/signals_test.go
index 5b69816..596b9e2 100644
--- a/lib/signals/signals_test.go
+++ b/lib/signals/signals_test.go
@@ -291,7 +291,7 @@
if ep, err = server.Listen("tcp", "127.0.0.1:0"); err != nil {
t.Fatalf("Got error: %v", err)
}
- if err := server.Serve("", ipc.SoloDispatcher(node.NewServerConfig(&configServer{ch}), vflag.NewAuthorizerOrDie())); err != nil {
+ if err := server.Serve("", ipc.LeafDispatcher(node.NewServerConfig(&configServer{ch}), vflag.NewAuthorizerOrDie())); err != nil {
t.Fatalf("Got error: %v", err)
}
return server, naming.JoinAddressName(ep.String(), ""), ch
diff --git a/lib/testutil/modules/servers.go b/lib/testutil/modules/servers.go
index 1502dae..3d25636 100644
--- a/lib/testutil/modules/servers.go
+++ b/lib/testutil/modules/servers.go
@@ -19,12 +19,12 @@
}
func clockChild(args []string) {
- serve("clock", ipc.SoloDispatcher(NewServerClock(&clockServer{}), nil), args)
+ serve("clock", ipc.LeafDispatcher(NewServerClock(&clockServer{}), nil), args)
}
func echoChild(args []string) {
- serve("echo", ipc.SoloDispatcher(NewServerEcho(&echoServer{}), nil), args)
+ serve("echo", ipc.LeafDispatcher(NewServerEcho(&echoServer{}), nil), args)
}
func serve(msg string, dispatcher ipc.Dispatcher, args []string) {
diff --git a/runtimes/google/ipc/benchmarks/server.go b/runtimes/google/ipc/benchmarks/server.go
index d1ebf0a..dd884a1 100644
--- a/runtimes/google/ipc/benchmarks/server.go
+++ b/runtimes/google/ipc/benchmarks/server.go
@@ -41,7 +41,7 @@
if err != nil {
vlog.Fatalf("Listen failed: %v", err)
}
- if err := server.Serve("", ipc.SoloDispatcher(NewServerBenchmark(&impl{}), sflag.NewAuthorizerOrDie())); err != nil {
+ if err := server.Serve("", ipc.LeafDispatcher(NewServerBenchmark(&impl{}), sflag.NewAuthorizerOrDie())); err != nil {
vlog.Fatalf("Serve failed: %v", err)
}
return naming.JoinAddressName(ep.String(), ""), func() {
diff --git a/runtimes/google/ipc/cancel_test.go b/runtimes/google/ipc/cancel_test.go
index 60cfa2e..0dc8e92 100644
--- a/runtimes/google/ipc/cancel_test.go
+++ b/runtimes/google/ipc/cancel_test.go
@@ -72,7 +72,7 @@
stop: s.Stop,
}
- if err := s.Serve(name, ipc.SoloDispatcher(c, fakeAuthorizer(0))); err != nil {
+ if err := s.Serve(name, ipc.LeafDispatcher(c, fakeAuthorizer(0))); err != nil {
return nil, err
}
diff --git a/runtimes/google/ipc/flow_test.go b/runtimes/google/ipc/flow_test.go
index 753962d..e2e2808 100644
--- a/runtimes/google/ipc/flow_test.go
+++ b/runtimes/google/ipc/flow_test.go
@@ -58,7 +58,7 @@
newInvoker func(suffix string) ipc.Invoker
}
-func (td testDisp) Lookup(suffix string) (ipc.Invoker, security.Authorizer, error) {
+func (td testDisp) Lookup(suffix, method string) (ipc.Invoker, security.Authorizer, error) {
return td.newInvoker(suffix), nil, nil
}
diff --git a/runtimes/google/ipc/full_test.go b/runtimes/google/ipc/full_test.go
index 3a5a222..c626c57 100644
--- a/runtimes/google/ipc/full_test.go
+++ b/runtimes/google/ipc/full_test.go
@@ -150,7 +150,7 @@
type testServerDisp struct{ server interface{} }
-func (t testServerDisp) Lookup(suffix string) (ipc.Invoker, security.Authorizer, error) {
+func (t testServerDisp) Lookup(suffix, method string) (ipc.Invoker, security.Authorizer, error) {
// If suffix is "nilAuth" we use default authorization, if it is "aclAuth" we
// use an ACL based authorizer, and otherwise we use the custom testServerAuthorizer.
var authorizer security.Authorizer
diff --git a/runtimes/google/ipc/jni/dispatcher.go b/runtimes/google/ipc/jni/dispatcher.go
index 3b4c682..8afaa7e 100644
--- a/runtimes/google/ipc/jni/dispatcher.go
+++ b/runtimes/google/ipc/jni/dispatcher.go
@@ -47,7 +47,7 @@
jDispatcher C.jobject
}
-func (d *dispatcher) Lookup(suffix string) (ipc.Invoker, security.Authorizer, error) {
+func (d *dispatcher) Lookup(suffix, method string) (ipc.Invoker, security.Authorizer, error) {
// Get Java environment.
envPtr, freeFunc := util.GetEnv(d.jVM)
env := (*C.JNIEnv)(envPtr)
diff --git a/runtimes/google/ipc/server.go b/runtimes/google/ipc/server.go
index 416b6db..b8642b5 100644
--- a/runtimes/google/ipc/server.go
+++ b/runtimes/google/ipc/server.go
@@ -486,7 +486,7 @@
fs.discharges[d.CaveatID()] = d
}
// Lookup the invoker.
- invoker, auth, suffix, verr := fs.lookup(req.Suffix)
+ invoker, auth, suffix, verr := fs.lookup(req.Suffix, req.Method)
fs.suffix = suffix // with leading /'s stripped
if verr != nil {
return nil, verr
@@ -529,13 +529,13 @@
}
// lookup returns the invoker and authorizer responsible for serving the given
-// name. The name is stripped of any leading slashes, and the invoker is looked
-// up in the server's dispatcher. The (stripped) name and dispatch suffix are
-// also returned.
-func (fs *flowServer) lookup(name string) (ipc.Invoker, security.Authorizer, string, verror.E) {
+// name and method. The name is stripped of any leading slashes, and the
+// invoker is looked up in the server's dispatcher. The (stripped) name
+// and dispatch suffix are also returned.
+func (fs *flowServer) lookup(name, method string) (ipc.Invoker, security.Authorizer, string, verror.E) {
name = strings.TrimLeft(name, "/")
if fs.disp != nil {
- invoker, auth, err := fs.disp.Lookup(name)
+ invoker, auth, err := fs.disp.Lookup(name, method)
switch {
case err != nil:
return nil, nil, "", verror.Convert(err)
diff --git a/runtimes/google/naming/namespace/all_test.go b/runtimes/google/naming/namespace/all_test.go
index 2159584..c29e4f9 100644
--- a/runtimes/google/naming/namespace/all_test.go
+++ b/runtimes/google/naming/namespace/all_test.go
@@ -177,7 +177,7 @@
jokes := make(map[string]*serverEntry)
// Let's run some non-mount table services.
for _, j := range []string{j1MP, j2MP, j3MP} {
- disp := ipc.SoloDispatcher(&testServer{}, nil)
+ disp := ipc.LeafDispatcher(&testServer{}, nil)
jokes[j] = runServer(t, r, disp, j)
}
return root, mts, jokes, func() {
@@ -343,7 +343,7 @@
testResolve(t, r, ns, j, jokes[j].name)
knockKnock(t, r, j)
globalName := naming.JoinAddressName(mts["mt4"].name, j)
- disp := ipc.SoloDispatcher(&testServer{}, nil)
+ disp := ipc.LeafDispatcher(&testServer{}, nil)
gj := "g_" + j
jokes[gj] = runServer(t, r, disp, globalName)
testResolve(t, r, ns, "mt4/"+j, jokes[gj].name)
@@ -428,7 +428,7 @@
globServer := &GlobbableServer{}
name := naming.JoinAddressName(mts["mt4/foo/bar"].name, "glob")
- runningGlobServer := runServer(t, r, ipc.SoloDispatcher(mounttable.NewServerGlobbable(globServer), nil), name)
+ runningGlobServer := runServer(t, r, ipc.LeafDispatcher(mounttable.NewServerGlobbable(globServer), nil), name)
defer runningGlobServer.server.Stop()
ns := r.Namespace()
diff --git a/runtimes/google/naming/namespace/namespace.go b/runtimes/google/naming/namespace/namespace.go
index a778f40..d3603b9 100644
--- a/runtimes/google/naming/namespace/namespace.go
+++ b/runtimes/google/naming/namespace/namespace.go
@@ -112,7 +112,7 @@
return true
case verror.NotFound:
// This should cover "ipc: unknown method", "ipc: dispatcher not
- // found", and "ipc: SoloDispatcher lookup on non-empty suffix".
+ // found", and "ipc: LeafDispatcher lookup on non-empty suffix".
return true
case verror.BadProtocol:
// This covers "ipc: response decoding failed: EOF".
diff --git a/runtimes/google/rt/ipc_test.go b/runtimes/google/rt/ipc_test.go
index a8360a1..f7e1e52 100644
--- a/runtimes/google/rt/ipc_test.go
+++ b/runtimes/google/rt/ipc_test.go
@@ -161,7 +161,7 @@
continue
}
defer stopServer(server)
- if err := server.Serve("", ipc.SoloDispatcher(&testService{},
+ if err := server.Serve("", ipc.LeafDispatcher(&testService{},
vsecurity.NewACLAuthorizer(security.NewWhitelistACL(
map[security.PrincipalPattern]security.LabelSet{
security.AllPrincipals: security.AllLabels,
diff --git a/runtimes/google/rt/mgmt.go b/runtimes/google/rt/mgmt.go
index f24f208..e61b708 100644
--- a/runtimes/google/rt/mgmt.go
+++ b/runtimes/google/rt/mgmt.go
@@ -56,7 +56,7 @@
if ep, err = m.server.Listen("tcp", "127.0.0.1:0"); err != nil {
return err
}
- if err := m.server.Serve("", ipc.SoloDispatcher(appcycle.NewServerAppCycle(m), nil)); err != nil {
+ if err := m.server.Serve("", ipc.LeafDispatcher(appcycle.NewServerAppCycle(m), nil)); err != nil {
return err
}
return m.callbackToParent(parentName, naming.JoinAddressName(ep.String(), ""))
diff --git a/runtimes/google/rt/mgmt_test.go b/runtimes/google/rt/mgmt_test.go
index f2cf956..d280f8b 100644
--- a/runtimes/google/rt/mgmt_test.go
+++ b/runtimes/google/rt/mgmt_test.go
@@ -251,7 +251,7 @@
if ep, err = server.Listen("tcp", "127.0.0.1:0"); err != nil {
t.Fatalf("Got error: %v", err)
}
- if err := server.Serve("", ipc.SoloDispatcher(node.NewServerConfig(&configServer{ch}), vflag.NewAuthorizerOrDie())); err != nil {
+ if err := server.Serve("", ipc.LeafDispatcher(node.NewServerConfig(&configServer{ch}), vflag.NewAuthorizerOrDie())); err != nil {
t.Fatalf("Got error: %v", err)
}
return server, naming.JoinAddressName(ep.String(), ""), ch
diff --git a/runtimes/google/vsync/vsyncd.go b/runtimes/google/vsync/vsyncd.go
index 2b74ce7..9df19d0 100644
--- a/runtimes/google/vsync/vsyncd.go
+++ b/runtimes/google/vsync/vsyncd.go
@@ -61,7 +61,7 @@
return &syncDispatcher{ipc.ReflectInvoker(s), auth}
}
-func (d *syncDispatcher) Lookup(suffix string) (ipc.Invoker, security.Authorizer, error) {
+func (d *syncDispatcher) Lookup(suffix, method string) (ipc.Invoker, security.Authorizer, error) {
if strings.HasSuffix(suffix, "sync") {
return d.server, d.auth, nil
}
diff --git a/services/identity/identityd/main.go b/services/identity/identityd/main.go
index b3d8191..a411982 100644
--- a/services/identity/identityd/main.go
+++ b/services/identity/identityd/main.go
@@ -138,7 +138,7 @@
security.AllPrincipals: security.AllLabels,
})
objectname := fmt.Sprintf("identity/%s/google", r.Identity().PublicID().Names()[0])
- if err := server.Serve(objectname, ipc.SoloDispatcher(blesser.NewGoogleOAuthBlesserServer(params), vsecurity.NewACLAuthorizer(allowEveryoneACL))); err != nil {
+ if err := server.Serve(objectname, ipc.LeafDispatcher(blesser.NewGoogleOAuthBlesserServer(params), vsecurity.NewACLAuthorizer(allowEveryoneACL))); err != nil {
return nil, nil, fmt.Errorf("failed to start Veyron service: %v", err)
}
vlog.Infof("Google blessing service enabled at endpoint %v and name %q", ep, objectname)
diff --git a/services/mgmt/application/impl/dispatcher.go b/services/mgmt/application/impl/dispatcher.go
index d438fd2..66faf1a 100644
--- a/services/mgmt/application/impl/dispatcher.go
+++ b/services/mgmt/application/impl/dispatcher.go
@@ -26,7 +26,7 @@
// DISPATCHER INTERFACE IMPLEMENTATION
-func (d *dispatcher) Lookup(suffix string) (ipc.Invoker, security.Authorizer, error) {
+func (d *dispatcher) Lookup(suffix, method string) (ipc.Invoker, security.Authorizer, error) {
invoker := ipc.ReflectInvoker(repository.NewServerApplication(NewInvoker(d.store, suffix)))
return invoker, d.auth, nil
}
diff --git a/services/mgmt/binary/impl/dispatcher.go b/services/mgmt/binary/impl/dispatcher.go
index ac95da2..b0a0989 100644
--- a/services/mgmt/binary/impl/dispatcher.go
+++ b/services/mgmt/binary/impl/dispatcher.go
@@ -51,7 +51,7 @@
// DISPATCHER INTERFACE IMPLEMENTATION
-func (d *dispatcher) Lookup(suffix string) (ipc.Invoker, security.Authorizer, error) {
+func (d *dispatcher) Lookup(suffix, method string) (ipc.Invoker, security.Authorizer, error) {
invoker := ipc.ReflectInvoker(repository.NewServerBinary(newInvoker(d.state, suffix)))
return invoker, d.auth, nil
}
diff --git a/services/mgmt/build/buildd/main.go b/services/mgmt/build/buildd/main.go
index 6ad2ae3..dec12a2 100644
--- a/services/mgmt/build/buildd/main.go
+++ b/services/mgmt/build/buildd/main.go
@@ -38,7 +38,7 @@
vlog.Errorf("Listen(%v, %v) failed: %v", *protocol, *address, err)
return
}
- if err := server.Serve(*name, ipc.SoloDispatcher(build.NewServerBuilder(impl.NewInvoker(*gobin)), vflag.NewAuthorizerOrDie())); err != nil {
+ if err := server.Serve(*name, ipc.LeafDispatcher(build.NewServerBuilder(impl.NewInvoker(*gobin)), vflag.NewAuthorizerOrDie())); err != nil {
vlog.Errorf("Serve(%v) failed: %v", *name, err)
return
}
diff --git a/services/mgmt/build/impl/impl_test.go b/services/mgmt/build/impl/impl_test.go
index fda143f..65c1379 100644
--- a/services/mgmt/build/impl/impl_test.go
+++ b/services/mgmt/build/impl/impl_test.go
@@ -34,7 +34,7 @@
t.Fatalf("Listen(%v, %v) failed: %v", protocol, hostname, err)
}
unpublished := ""
- if err := server.Serve(unpublished, ipc.SoloDispatcher(build.NewServerBuilder(NewInvoker(gobin)), nil)); err != nil {
+ if err := server.Serve(unpublished, ipc.LeafDispatcher(build.NewServerBuilder(NewInvoker(gobin)), nil)); err != nil {
t.Fatalf("Serve(%q) failed: %v", unpublished, err)
}
name := "/" + endpoint.String()
diff --git a/services/mgmt/logreader/impl/logdir_invoker_test.go b/services/mgmt/logreader/impl/logdir_invoker_test.go
index 2375a43..192959d 100644
--- a/services/mgmt/logreader/impl/logdir_invoker_test.go
+++ b/services/mgmt/logreader/impl/logdir_invoker_test.go
@@ -22,7 +22,7 @@
root string
}
-func (d *logDirectoryDispatcher) Lookup(suffix string) (ipc.Invoker, security.Authorizer, error) {
+func (d *logDirectoryDispatcher) Lookup(suffix, _ string) (ipc.Invoker, security.Authorizer, error) {
invoker := ipc.ReflectInvoker(mounttable.NewServerGlobbable(impl.NewLogDirectoryInvoker(d.root, suffix)))
return invoker, nil, nil
}
diff --git a/services/mgmt/logreader/impl/logfile_invoker_test.go b/services/mgmt/logreader/impl/logfile_invoker_test.go
index 2b79268..171b293 100644
--- a/services/mgmt/logreader/impl/logfile_invoker_test.go
+++ b/services/mgmt/logreader/impl/logfile_invoker_test.go
@@ -20,7 +20,7 @@
root string
}
-func (d *logFileDispatcher) Lookup(suffix string) (ipc.Invoker, security.Authorizer, error) {
+func (d *logFileDispatcher) Lookup(suffix, _ string) (ipc.Invoker, security.Authorizer, error) {
invoker := ipc.ReflectInvoker(logreader.NewServerLogFile(impl.NewLogFileInvoker(d.root, suffix)))
return invoker, nil, nil
}
diff --git a/services/mgmt/node/impl/dispatcher.go b/services/mgmt/node/impl/dispatcher.go
index 35ed0be..ad3d92b 100644
--- a/services/mgmt/node/impl/dispatcher.go
+++ b/services/mgmt/node/impl/dispatcher.go
@@ -62,7 +62,7 @@
// DISPATCHER INTERFACE IMPLEMENTATION
-func (d *dispatcher) Lookup(suffix string) (ipc.Invoker, security.Authorizer, error) {
+func (d *dispatcher) Lookup(suffix, method string) (ipc.Invoker, security.Authorizer, error) {
components := strings.Split(suffix, "/")
for i := 0; i < len(components); i++ {
if len(components[i]) == 0 {
diff --git a/services/mgmt/node/impl/impl_test.go b/services/mgmt/node/impl/impl_test.go
index 6935713..3a0c0fc 100644
--- a/services/mgmt/node/impl/impl_test.go
+++ b/services/mgmt/node/impl/impl_test.go
@@ -146,7 +146,7 @@
defer rt.R().Cleanup()
server, _ := newServer()
defer server.Stop()
- if err := server.Serve(publishName, ipc.SoloDispatcher(new(appService), nil)); err != nil {
+ if err := server.Serve(publishName, ipc.LeafDispatcher(new(appService), nil)); err != nil {
vlog.Fatalf("Serve(%v) failed: %v", publishName, err)
}
if call, err := rt.R().Client().StartCall(rt.R().NewContext(), "pingserver", "Ping", nil); err != nil {
@@ -435,7 +435,7 @@
server, _ := newServer()
defer server.Stop()
pingCh := make(chan struct{})
- if err := server.Serve("pingserver", ipc.SoloDispatcher(pingServerDisp(pingCh), nil)); err != nil {
+ if err := server.Serve("pingserver", ipc.LeafDispatcher(pingServerDisp(pingCh), nil)); err != nil {
t.Fatalf("Failed to set up ping server")
}
diff --git a/services/mgmt/node/impl/mock_repo_test.go b/services/mgmt/node/impl/mock_repo_test.go
index 8630621..36db640 100644
--- a/services/mgmt/node/impl/mock_repo_test.go
+++ b/services/mgmt/node/impl/mock_repo_test.go
@@ -28,7 +28,7 @@
func startApplicationRepository() (*application.Envelope, func()) {
server, _ := newServer()
invoker := new(arInvoker)
- dispatcher := ipc.SoloDispatcher(repository.NewServerApplication(invoker), nil)
+ dispatcher := ipc.LeafDispatcher(repository.NewServerApplication(invoker), nil)
name := "ar"
if err := server.Serve(name, dispatcher); err != nil {
vlog.Fatalf("Serve(%v) failed: %v", name, err)
@@ -54,7 +54,7 @@
// returns a cleanup function.
func startBinaryRepository() func() {
server, _ := newServer()
- dispatcher := ipc.SoloDispatcher(repository.NewServerBinary(new(brInvoker)), nil)
+ dispatcher := ipc.LeafDispatcher(repository.NewServerBinary(new(brInvoker)), nil)
name := "br"
if err := server.Serve(name, dispatcher); err != nil {
vlog.Fatalf("Serve(%q) failed: %v", name, err)
diff --git a/services/mgmt/profile/impl/dispatcher.go b/services/mgmt/profile/impl/dispatcher.go
index fd25fde..a8a7c83 100644
--- a/services/mgmt/profile/impl/dispatcher.go
+++ b/services/mgmt/profile/impl/dispatcher.go
@@ -26,7 +26,7 @@
// DISPATCHER INTERFACE IMPLEMENTATION
-func (d *dispatcher) Lookup(suffix string) (ipc.Invoker, security.Authorizer, error) {
+func (d *dispatcher) Lookup(suffix, method string) (ipc.Invoker, security.Authorizer, error) {
invoker := ipc.ReflectInvoker(repository.NewServerProfile(NewInvoker(d.store, suffix)))
return invoker, d.auth, nil
}
diff --git a/services/mgmt/root/impl/dispatcher.go b/services/mgmt/root/impl/dispatcher.go
index 82269d1..4a56fb1 100644
--- a/services/mgmt/root/impl/dispatcher.go
+++ b/services/mgmt/root/impl/dispatcher.go
@@ -18,6 +18,6 @@
// DISPATCHER INTERFACE IMPLEMENTATION
-func (d *dispatcher) Lookup(suffix string) (ipc.Invoker, security.Authorizer, error) {
+func (d *dispatcher) Lookup(suffix, method string) (ipc.Invoker, security.Authorizer, error) {
return ipc.ReflectInvoker(root.NewServerRoot(d.state)), nil, nil
}
diff --git a/services/mounttable/lib/collectionserver_test.go b/services/mounttable/lib/collectionserver_test.go
index c393c08..e6cce88 100644
--- a/services/mounttable/lib/collectionserver_test.go
+++ b/services/mounttable/lib/collectionserver_test.go
@@ -29,7 +29,7 @@
}
// Lookup implements ipc.Dispatcher.Lookup.
-func (d *collectionDispatcher) Lookup(name string) (ipc.Invoker, security.Authorizer, error) {
+func (d *collectionDispatcher) Lookup(name, method string) (ipc.Invoker, security.Authorizer, error) {
rpcc := &rpcContext{name: name, collectionServer: d.collectionServer}
return ipc.ReflectInvoker(rpcc), d, nil
}
diff --git a/services/mounttable/lib/mounttable.go b/services/mounttable/lib/mounttable.go
index 0e7ef27..26b52ca 100644
--- a/services/mounttable/lib/mounttable.go
+++ b/services/mounttable/lib/mounttable.go
@@ -91,7 +91,7 @@
}
// LookupServer implements ipc.Dispatcher.Lookup.
-func (mt *mountTable) Lookup(name string) (ipc.Invoker, security.Authorizer, error) {
+func (mt *mountTable) Lookup(name, method string) (ipc.Invoker, security.Authorizer, error) {
vlog.VI(2).Infof("*********************Lookup %s", name)
mt.RLock()
defer mt.RUnlock()
diff --git a/services/mounttable/lib/neighborhood.go b/services/mounttable/lib/neighborhood.go
index 4e4cbb1..33485c5 100644
--- a/services/mounttable/lib/neighborhood.go
+++ b/services/mounttable/lib/neighborhood.go
@@ -120,7 +120,7 @@
}
// Lookup implements ipc.Dispatcher.Lookup.
-func (nh *neighborhood) Lookup(name string) (ipc.Invoker, security.Authorizer, error) {
+func (nh *neighborhood) Lookup(name, method string) (ipc.Invoker, security.Authorizer, error) {
vlog.VI(1).Infof("*********************LookupServer '%s'\n", name)
elems := strings.Split(name, "/")[nh.nelems:]
if name == "" {
diff --git a/services/proximity/proximityd/main.go b/services/proximity/proximityd/main.go
index 5019ca8..a67c5e1 100644
--- a/services/proximity/proximityd/main.go
+++ b/services/proximity/proximityd/main.go
@@ -67,7 +67,7 @@
// Start the server and register it with the mounttable under the
// given name.
- if err := s.Serve(*name, ipc.SoloDispatcher(prox.NewServerProximity(p), vflag.NewAuthorizerOrDie())); err != nil {
+ if err := s.Serve(*name, ipc.LeafDispatcher(prox.NewServerProximity(p), vflag.NewAuthorizerOrDie())); err != nil {
vlog.Fatalf("error publishing service (%s): %v", *name, err)
}
diff --git a/services/security/discharger/revoker_test.go b/services/security/discharger/revoker_test.go
index 8dc971a..fe0f938 100644
--- a/services/security/discharger/revoker_test.go
+++ b/services/security/discharger/revoker_test.go
@@ -29,7 +29,7 @@
t.Fatalf("NewRevoker failed: $v", err)
}
revokerServiceStub := ssecurity.NewServerRevoker(revokerService)
- err = revokerServer.Serve("", ipc.SoloDispatcher(revokerServiceStub, nil))
+ err = revokerServer.Serve("", ipc.LeafDispatcher(revokerServiceStub, nil))
if err != nil {
t.Fatalf("revokerServer.Serve discharger: %s", err)
}
@@ -43,7 +43,7 @@
t.Fatalf("revokerServer.Listen failed: %v", err)
}
dischargerServiceStub := ssecurity.NewServerDischarger(NewDischarger(r.Identity()))
- if err := dischargerServer.Serve("", ipc.SoloDispatcher(dischargerServiceStub, nil)); err != nil {
+ if err := dischargerServer.Serve("", ipc.LeafDispatcher(dischargerServiceStub, nil)); err != nil {
t.Fatalf("revokerServer.Serve revoker: %s", err)
}
return r.Identity().PublicID(),
diff --git a/services/store/server/server.go b/services/store/server/server.go
index de5824b..2a4c279 100644
--- a/services/store/server/server.go
+++ b/services/store/server/server.go
@@ -332,7 +332,7 @@
return &storeDispatcher{s: s, auth: auth}
}
-func (d *storeDispatcher) Lookup(suffix string) (ipc.Invoker, security.Authorizer, error) {
+func (d *storeDispatcher) Lookup(suffix, method string) (ipc.Invoker, security.Authorizer, error) {
serv, err := d.lookupServer(suffix)
if err != nil {
return nil, nil, err
diff --git a/services/wsprd/app/app_test.go b/services/wsprd/app/app_test.go
index 0e15fc7..7e4fdf8 100644
--- a/services/wsprd/app/app_test.go
+++ b/services/wsprd/app/app_test.go
@@ -113,7 +113,7 @@
}
func startAdderServer() (ipc.Server, naming.Endpoint, error) {
- return startAnyServer(false, ipc.SoloDispatcher(simpleAdder{}, nil))
+ return startAnyServer(false, ipc.LeafDispatcher(simpleAdder{}, nil))
}
func startProxy() (*proxy.Proxy, error) {
diff --git a/services/wsprd/ipc/server/dispatcher.go b/services/wsprd/ipc/server/dispatcher.go
index 7c73701..ea58748 100644
--- a/services/wsprd/ipc/server/dispatcher.go
+++ b/services/wsprd/ipc/server/dispatcher.go
@@ -17,7 +17,7 @@
}
// Lookup implements dispatcher interface Lookup.
-func (d *dispatcher) Lookup(suffix string) (ipc.Invoker, security.Authorizer, error) {
+func (d *dispatcher) Lookup(suffix, method string) (ipc.Invoker, security.Authorizer, error) {
return d.invoker, d.authorizer, nil
}
diff --git a/tools/application/impl/impl_test.go b/tools/application/impl/impl_test.go
index 94e80be..714ea52 100644
--- a/tools/application/impl/impl_test.go
+++ b/tools/application/impl/impl_test.go
@@ -68,7 +68,7 @@
return &dispatcher{}
}
-func (d *dispatcher) Lookup(suffix string) (ipc.Invoker, security.Authorizer, error) {
+func (d *dispatcher) Lookup(suffix, method string) (ipc.Invoker, security.Authorizer, error) {
invoker := ipc.ReflectInvoker(repository.NewServerApplication(&server{suffix: suffix}))
return invoker, nil, nil
}
diff --git a/tools/binary/impl/impl_test.go b/tools/binary/impl/impl_test.go
index 126ce11..fdad6d2 100644
--- a/tools/binary/impl/impl_test.go
+++ b/tools/binary/impl/impl_test.go
@@ -77,7 +77,7 @@
return &dispatcher{}
}
-func (d *dispatcher) Lookup(suffix string) (ipc.Invoker, security.Authorizer, error) {
+func (d *dispatcher) Lookup(suffix, method string) (ipc.Invoker, security.Authorizer, error) {
invoker := ipc.ReflectInvoker(repository.NewServerBinary(&server{suffix: suffix}))
return invoker, nil, nil
}
diff --git a/tools/build/impl/impl_test.go b/tools/build/impl/impl_test.go
index 6cd6311..77dfabf 100644
--- a/tools/build/impl/impl_test.go
+++ b/tools/build/impl/impl_test.go
@@ -50,7 +50,7 @@
t.Fatalf("Listen(%v, %v) failed: %v", protocol, address, err)
}
unpublished := ""
- if err := server.Serve(unpublished, ipc.SoloDispatcher(build.NewServerBuilder(&mock{}), nil)); err != nil {
+ if err := server.Serve(unpublished, ipc.LeafDispatcher(build.NewServerBuilder(&mock{}), nil)); err != nil {
t.Fatalf("Serve(%v) failed: %v", unpublished, err)
}
return server, endpoint
diff --git a/tools/mounttable/impl/impl_test.go b/tools/mounttable/impl/impl_test.go
index 8ec26e6..62e3d8a 100644
--- a/tools/mounttable/impl/impl_test.go
+++ b/tools/mounttable/impl/impl_test.go
@@ -48,7 +48,7 @@
type dispatcher struct {
}
-func (d *dispatcher) Lookup(suffix string) (ipc.Invoker, security.Authorizer, error) {
+func (d *dispatcher) Lookup(suffix, method string) (ipc.Invoker, security.Authorizer, error) {
invoker := ipc.ReflectInvoker(mounttable.NewServerMountTable(&server{suffix: suffix}))
return invoker, nil, nil
}
diff --git a/tools/profile/impl/impl_test.go b/tools/profile/impl/impl_test.go
index 3e600bf..731e0a9 100644
--- a/tools/profile/impl/impl_test.go
+++ b/tools/profile/impl/impl_test.go
@@ -79,7 +79,7 @@
return &dispatcher{}
}
-func (d *dispatcher) Lookup(suffix string) (ipc.Invoker, security.Authorizer, error) {
+func (d *dispatcher) Lookup(suffix, method string) (ipc.Invoker, security.Authorizer, error) {
invoker := ipc.ReflectInvoker(repository.NewServerProfile(&server{suffix: suffix}))
return invoker, nil, nil
}
diff --git a/tools/proximity/impl/impl_test.go b/tools/proximity/impl/impl_test.go
index 7286470..7ae5914 100644
--- a/tools/proximity/impl/impl_test.go
+++ b/tools/proximity/impl/impl_test.go
@@ -41,7 +41,7 @@
type dispatcher struct {
}
-func (d *dispatcher) Lookup(suffix string) (ipc.Invoker, security.Authorizer, error) {
+func (d *dispatcher) Lookup(suffix, method string) (ipc.Invoker, security.Authorizer, error) {
invoker := ipc.ReflectInvoker(proximity.NewServerProximity(&server{}))
return invoker, nil, nil
}
diff --git a/tools/vrpc/impl/impl_test.go b/tools/vrpc/impl/impl_test.go
index 54e06f4..091e606 100644
--- a/tools/vrpc/impl/impl_test.go
+++ b/tools/vrpc/impl/impl_test.go
@@ -126,7 +126,7 @@
}
func startServer(t *testing.T, r veyron2.Runtime) (ipc.Server, naming.Endpoint, error) {
- dispatcher := ipc.SoloDispatcher(test_base.NewServerTypeTester(&server{}), nil)
+ dispatcher := ipc.LeafDispatcher(test_base.NewServerTypeTester(&server{}), nil)
server, err := r.NewServer()
if err != nil {
t.Errorf("NewServer failed: %v", err)