2017-11-26 10:15:51 +00:00
|
|
|
package rpc
|
|
|
|
|
2017-11-27 16:22:02 +00:00
|
|
|
import (
|
|
|
|
"git.loafle.net/commons_go/rpc/protocol"
|
|
|
|
cuc "git.loafle.net/commons_go/util/context"
|
|
|
|
)
|
2017-11-26 10:15:51 +00:00
|
|
|
|
|
|
|
type ServletHandler interface {
|
2017-11-27 16:22:02 +00:00
|
|
|
ServletContext(parent cuc.Context) ServletContext
|
|
|
|
|
2017-11-27 12:04:25 +00:00
|
|
|
Init(servletCTX ServletContext) error
|
2017-11-26 10:15:51 +00:00
|
|
|
|
2017-11-28 09:33:52 +00:00
|
|
|
GetRequest(servletCTX ServletContext, codec protocol.ServerCodec, conn interface{}) (protocol.ServerRequestCodec, error)
|
2017-11-27 12:04:25 +00:00
|
|
|
Invoke(servletCTX ServletContext, requestCodec protocol.RegistryCodec) (result interface{}, err error)
|
2017-11-28 09:33:52 +00:00
|
|
|
SendResponse(servletCTX ServletContext, conn interface{}, requestCodec protocol.ServerRequestCodec, result interface{}, err error) error
|
|
|
|
SendNotification(servletCTX ServletContext, conn interface{}, codec protocol.ServerCodec, method string, args ...interface{}) error
|
2017-11-26 10:15:51 +00:00
|
|
|
|
2017-11-27 12:04:25 +00:00
|
|
|
Destroy(servletCTX ServletContext)
|
2017-11-26 10:15:51 +00:00
|
|
|
|
|
|
|
RegisterCodec(contentType string, codec protocol.ServerCodec)
|
|
|
|
|
|
|
|
getCodec(contentType string) (protocol.ServerCodec, error)
|
|
|
|
|
|
|
|
GetPendingMessages() int
|
|
|
|
Validate()
|
|
|
|
}
|