public class RpcServer extends Object
| 构造器和说明 |
|---|
RpcServer(int port) |
RpcServer(int port,
RpcServerOptions options) |
RpcServer(int port,
RpcServerOptions options,
List<Interceptor> interceptors) |
RpcServer(String host,
int port) |
RpcServer(String host,
int port,
RpcServerOptions options) |
RpcServer(String host,
int port,
RpcServerOptions options,
List<Interceptor> interceptors) |
| 限定符和类型 | 方法和说明 |
|---|---|
Protocol |
getProtocol() |
boolean |
isShutdown() |
void |
registerService(Object service) |
void |
registerService(Object service,
Class targetClass,
NamingOptions namingOptions) |
void |
registerService(Object service,
Class targetClass,
NamingOptions namingOptions,
RpcServerOptions serverOptions)
register service which can be accessed by client
|
void |
registerService(Object service,
NamingOptions namingOptions) |
void |
registerService(Object service,
RpcServerOptions serverOptions) |
<T> AsyncAwareFuture<T> |
sendServerPush(Request request) |
void |
setProtocol(Protocol protocol) |
void |
shutdown() |
void |
start() |
public RpcServer(int port)
public RpcServer(String host, int port)
public RpcServer(int port,
RpcServerOptions options)
public RpcServer(String host, int port, RpcServerOptions options)
public RpcServer(int port,
RpcServerOptions options,
List<Interceptor> interceptors)
public RpcServer(String host, int port, RpcServerOptions options, List<Interceptor> interceptors)
public void registerService(Object service)
public void registerService(Object service, NamingOptions namingOptions)
public void registerService(Object service, Class targetClass, NamingOptions namingOptions)
public void registerService(Object service, RpcServerOptions serverOptions)
public void registerService(Object service, Class targetClass, NamingOptions namingOptions, RpcServerOptions serverOptions)
service - the service object which implement rpc interface.namingOptions - register center infoserverOptions - service own custom RpcServerOptions
if not null, the service will not use the shared thread pool.public void start()
public void shutdown()
public boolean isShutdown()
public Protocol getProtocol()
public void setProtocol(Protocol protocol)
public <T> AsyncAwareFuture<T> sendServerPush(Request request)
Copyright © 2019 Baidu, Inc.. All rights reserved.