public class RpcServer
extends io.netty.bootstrap.ServerBootstrap
| 构造器和说明 |
|---|
RpcServer()
Instantiates a new rpc server.
|
RpcServer(Class<? extends io.netty.channel.ServerChannel> serverChannelClass)
Instantiates a new rpc server.
|
RpcServer(Class<? extends io.netty.channel.ServerChannel> serverChannelClass,
RpcServerOptions serverOptions,
RpcServiceRegistry rpcServiceRegistry) |
RpcServer(Class<? extends io.netty.channel.ServerChannel> serverChannelClass,
RpcServerOptions serverOptions,
RpcServiceRegistry rpcServiceRegistry,
ExceptionCatcher exceptionCatcher)
Instantiates a new rpc server.
|
RpcServer(ExceptionCatcher exceptionCatcher)
Instantiates a new rpc server.
|
RpcServer(RpcServerOptions serverOptions)
Instantiates a new rpc server.
|
RpcServer(RpcServerOptions serverOptions,
RpcServiceRegistry rpcServiceRegistry)
Instantiates a new rpc server.
|
| 限定符和类型 | 方法和说明 |
|---|---|
ThreadPoolExecutor |
getEs()
Gets the es.
|
protected ExceptionCatcher |
getExceptionCatcher()
Gets the exception catcher.
|
InetSocketAddress |
getInetSocketAddress()
Gets the inet socket address.
|
RpcServerOptions |
getRpcServerOptions()
Gets the rpc server options.
|
long |
getStartTime()
Gets the start time.
|
AtomicBoolean |
getStop()
Gets the stop.
|
protected void |
init(RpcServerOptions serverOptions)
Inits the.
|
protected void |
initAfterBindPort(InetSocketAddress sa)
Inits the after bind port.
|
boolean |
isStop()
Checks if is stop.
|
void |
registerDynamicService(String methodSignature,
Method method,
Object service,
Class<? extends ServerAttachmentHandler> cls)
Register dynamic service.
|
void |
registerDynamicService(String serviceName,
String methodName,
Method method,
Object service,
Class<? extends ServerAttachmentHandler> cls)
Register dynamic service.
|
void |
registerService(IDLServiceExporter service)
Register service.
|
void |
registerService(Object target)
Register service.
|
void |
setExceptionCatcher(ExceptionCatcher exceptionCatcher)
Sets the exception catcher.
|
void |
setInterceptor(InvokerInterceptor interceptor)
Sets the interceptor.
|
void |
setRpcServerOptions(RpcServerOptions rpcServerOptions)
Sets the rpc server options.
|
void |
setStop(AtomicBoolean stop)
Sets the stop.
|
void |
shutdown()
Shutdown.
|
void |
start(InetSocketAddress sa)
Start.
|
void |
start(int port)
Start.
|
void |
startSync(InetSocketAddress sa)
Start.
|
void |
startSync(int port)
Start.
|
void |
stop()
Stop.
|
void |
unRegisterDynamicService(String methodSignature)
remove service by method signature. if method signature not exist nothing to do.
|
void |
waitForStop()
Wait for stop.
|
childAttr, childGroup, childHandler, childOption, clone, config, group, group, validatepublic RpcServer(Class<? extends io.netty.channel.ServerChannel> serverChannelClass, RpcServerOptions serverOptions, RpcServiceRegistry rpcServiceRegistry, ExceptionCatcher exceptionCatcher)
serverChannelClass - the server channel classserverOptions - the server optionsrpcServiceRegistry - the rpc service registrypublic RpcServer(Class<? extends io.netty.channel.ServerChannel> serverChannelClass, RpcServerOptions serverOptions, RpcServiceRegistry rpcServiceRegistry)
public RpcServer(RpcServerOptions serverOptions)
serverOptions - the server optionspublic RpcServer(RpcServerOptions serverOptions, RpcServiceRegistry rpcServiceRegistry)
serverOptions - the server optionsrpcServiceRegistry - the rpc service registrypublic RpcServer()
public RpcServer(ExceptionCatcher exceptionCatcher)
public RpcServer(Class<? extends io.netty.channel.ServerChannel> serverChannelClass)
serverChannelClass - the server channel classpublic void setExceptionCatcher(ExceptionCatcher exceptionCatcher)
exceptionCatcher - the new exception catcherprotected ExceptionCatcher getExceptionCatcher()
public void setInterceptor(InvokerInterceptor interceptor)
interceptor - the new interceptorpublic InetSocketAddress getInetSocketAddress()
public ThreadPoolExecutor getEs()
protected void init(RpcServerOptions serverOptions)
serverOptions - the server optionspublic void registerService(IDLServiceExporter service)
service - the servicepublic void registerService(Object target)
target - the targetpublic void registerDynamicService(String methodSignature, Method method, Object service, Class<? extends ServerAttachmentHandler> cls)
methodSignature - the method signaturemethod - the methodservice - the servicecls - the clspublic void unRegisterDynamicService(String methodSignature)
methodSignature - target method signature to remove.public void registerDynamicService(String serviceName, String methodName, Method method, Object service, Class<? extends ServerAttachmentHandler> cls)
serviceName - the service namemethodName - the method namemethod - the methodservice - the servicecls - the clspublic void start(int port)
port - the portpublic void startSync(int port)
port - the portpublic void startSync(InetSocketAddress sa)
sa - the sapublic void start(InetSocketAddress sa)
sa - the saprotected void initAfterBindPort(InetSocketAddress sa)
sa - the sapublic void waitForStop()
throws InterruptedException
InterruptedException - the interrupted exceptionpublic void stop()
public AtomicBoolean getStop()
public boolean isStop()
public void shutdown()
public void setStop(AtomicBoolean stop)
stop - the new stoppublic RpcServerOptions getRpcServerOptions()
public void setRpcServerOptions(RpcServerOptions rpcServerOptions)
rpcServerOptions - the new rpc server optionspublic long getStartTime()
Copyright © 2022 Baidu, Inc.. All rights reserved.