diff --git a/common/proxy/invoker.go b/common/proxy/invoker.go deleted file mode 100644 index 1a703d112412fe85d049ccb71dfd24ed0557da19..0000000000000000000000000000000000000000 --- a/common/proxy/invoker.go +++ /dev/null @@ -1,40 +0,0 @@ -package proxy - -import ( - "github.com/apache/dubbo-go/common" - "github.com/apache/dubbo-go/protocol" -) - -type CallInvoker struct { - protocol.BaseInvoker -} - -func NewCallInvoker(url common.URL) *CallInvoker { - return &CallInvoker{ - BaseInvoker: *protocol.NewBaseInvoker(url), - } -} - -func (bi *CallInvoker) Invoke(invocation protocol.Invocation) protocol.Result { - rpcResult := &protocol.RPCResult{Attrs: invocation.Attachments()} - //todo:call service - - // get method - //proto := bi.GetUrl().Protocol - //if bi.GetUrl().SubURL != nil { - // proto = bi.GetUrl().SubURL.Protocol - //} - //svc := common.ServiceMap.GetService(proto, serviceName) - //if svc == nil { - // return perrors.New("cannot find svc " + serviceName) - //} - //method := svc.Method()[methodName] - //if method == nil { - // logger.Errorf("method not found!") - // rpcResult.Err = perrors.New("cannot find method " + methodName + " of svc " + serviceName) - // return rpcResult - //} - // - //returnValues := method.Method().Func.Call(in) - return rpcResult -} diff --git a/common/proxy/proxy_factory/default.go b/common/proxy/proxy_factory/default.go index 62940fc81154c0b79ced12e35857063b1346b2af..1665a7346e09016570dd36c56d231d3706b96a54 100644 --- a/common/proxy/proxy_factory/default.go +++ b/common/proxy/proxy_factory/default.go @@ -51,5 +51,6 @@ func (factory *DefaultProxyFactory) GetProxy(invoker protocol.Invoker, url *comm return proxy.NewProxy(invoker, nil, attachments) } func (factory *DefaultProxyFactory) GetInvoker(url common.URL) protocol.Invoker { - return proxy.NewCallInvoker(url) + // todo: call service + return protocol.NewBaseInvoker(url) } diff --git a/protocol/dubbo/listener.go b/protocol/dubbo/listener.go index 4975bc370c3ad7cba9352a0396f44c10d8693c92..b779183830fbb72af69792a16008a582155151d1 100644 --- a/protocol/dubbo/listener.go +++ b/protocol/dubbo/listener.go @@ -20,7 +20,6 @@ package dubbo import ( "context" "fmt" - "github.com/apache/dubbo-go/protocol" "net/url" "reflect" "sync" @@ -37,6 +36,7 @@ import ( "github.com/apache/dubbo-go/common" "github.com/apache/dubbo-go/common/constant" "github.com/apache/dubbo-go/common/logger" + "github.com/apache/dubbo-go/protocol" "github.com/apache/dubbo-go/protocol/invocation" ) diff --git a/protocol/jsonrpc/jsonrpc_protocol.go b/protocol/jsonrpc/jsonrpc_protocol.go index 7c05da7c8e991a2fd77c692d5ff40f1ab30f7a00..c18345d413edb2d263f1acaef1741514b665f042 100644 --- a/protocol/jsonrpc/jsonrpc_protocol.go +++ b/protocol/jsonrpc/jsonrpc_protocol.go @@ -17,14 +17,17 @@ package jsonrpc +import ( + "strings" + "sync" +) + import ( "github.com/apache/dubbo-go/common" "github.com/apache/dubbo-go/common/extension" "github.com/apache/dubbo-go/common/logger" "github.com/apache/dubbo-go/config" "github.com/apache/dubbo-go/protocol" - "strings" - "sync" ) const JSONRPC = "jsonrpc" diff --git a/registry/directory/directory.go b/registry/directory/directory.go index 8352536ee869b24cc93932b71a2198d35f36af23..a4a9263156345a6e98c5a5189a49d4e54d65a76b 100644 --- a/registry/directory/directory.go +++ b/registry/directory/directory.go @@ -18,7 +18,6 @@ package directory import ( - "github.com/apache/dubbo-go/remoting" "sync" "time" ) @@ -36,6 +35,7 @@ import ( "github.com/apache/dubbo-go/protocol" "github.com/apache/dubbo-go/protocol/protocolwrapper" "github.com/apache/dubbo-go/registry" + "github.com/apache/dubbo-go/remoting" ) const (