2017-12-05 05:20:42 +00:00
|
|
|
package server
|
|
|
|
|
|
|
|
import (
|
2017-12-05 05:40:31 +00:00
|
|
|
crpj "git.loafle.net/commons_go/rpc/protocol/json"
|
2017-12-05 05:20:42 +00:00
|
|
|
crr "git.loafle.net/commons_go/rpc/registry"
|
|
|
|
"git.loafle.net/commons_go/rpc/server"
|
|
|
|
)
|
|
|
|
|
2017-12-05 05:40:31 +00:00
|
|
|
func NewRPCServletHandler(rpcInvoker crr.RPCInvoker) server.ServletHandler {
|
2017-12-05 05:20:42 +00:00
|
|
|
sh := &RPCServletHandlers{}
|
|
|
|
sh.RPCInvoker = rpcInvoker
|
2017-12-05 05:40:31 +00:00
|
|
|
sh.RegisterCodec(crpj.Name, crpj.NewServerCodec())
|
2017-12-05 05:20:42 +00:00
|
|
|
|
|
|
|
return sh
|
|
|
|
}
|
|
|
|
|
|
|
|
type RPCServletHandlers struct {
|
|
|
|
server.ServletHandlers
|
|
|
|
}
|
|
|
|
|
|
|
|
func (sh *RPCServletHandlers) Validate() {
|
|
|
|
sh.ServletHandlers.Validate()
|
|
|
|
|
|
|
|
}
|