public interface JServer extends Registry
| 限定符和类型 | 接口和说明 |
|---|---|
static interface |
JServer.ProviderInitializer<T> |
static interface |
JServer.ServiceRegistry
本地服务注册.
|
| 限定符和类型 | 方法和说明 |
|---|---|
JAcceptor |
acceptor()
网络层acceptor.
|
List<ServiceWrapper> |
allRegisteredServices()
注册所有服务到本地容器.
|
FlowController<JRequest> |
globalFlowController()
返回已设置的全局的拦截器.
|
ServiceWrapper |
lookupService(Directory directory)
根据服务目录查找对应服务提供者.
|
void |
publish(ServiceWrapper... serviceWrappers)
发布指定服务列表到注册中心.
|
void |
publish(ServiceWrapper serviceWrapper)
发布指定服务到注册中心.
|
void |
publishAll()
发布本地所有服务到注册中心.
|
<T> void |
publishWithInitializer(ServiceWrapper serviceWrapper,
JServer.ProviderInitializer<T> initializer,
Executor executor)
服务提供者初始化完成后再发布服务到注册中心(延迟发布服务), 并设置服务私有的线程池来执行初始化操作.
|
RegistryService |
registryService()
注册服务实例
|
ServiceWrapper |
removeService(Directory directory)
根据服务目录移除对应服务提供者.
|
JServer.ServiceRegistry |
serviceRegistry()
获取服务注册(本地)工具.
|
void |
shutdownGracefully()
优雅关闭jupiter server.
|
void |
start()
启动jupiter server, 以同步阻塞的方式启动.
|
void |
start(boolean sync)
启动jupiter server, 可通过参数指定异步/同步的方式启动.
|
void |
unpublish(ServiceWrapper serviceWrapper)
从注册中心把指定服务下线.
|
void |
unpublishAll()
从注册中心把本地所有服务全部下线.
|
JServer |
withAcceptor(JAcceptor acceptor)
设置网络层acceptor.
|
void |
withGlobalFlowController(FlowController<JRequest> flowController)
设置全局的流量控制器.
|
void |
withGlobalInterceptors(ProviderInterceptor... globalInterceptors)
设置全局的拦截器, 会拦截所有的服务提供者.
|
connectToRegistryServerJAcceptor acceptor()
RegistryService registryService()
void withGlobalInterceptors(ProviderInterceptor... globalInterceptors)
FlowController<JRequest> globalFlowController()
void withGlobalFlowController(FlowController<JRequest> flowController)
JServer.ServiceRegistry serviceRegistry()
ServiceWrapper lookupService(Directory directory)
ServiceWrapper removeService(Directory directory)
List<ServiceWrapper> allRegisteredServices()
void publish(ServiceWrapper serviceWrapper)
void publish(ServiceWrapper... serviceWrappers)
<T> void publishWithInitializer(ServiceWrapper serviceWrapper, JServer.ProviderInitializer<T> initializer, Executor executor)
void publishAll()
void unpublish(ServiceWrapper serviceWrapper)
void unpublishAll()
void start()
throws InterruptedException
void start(boolean sync)
throws InterruptedException
void shutdownGracefully()
Copyright © 2018. All rights reserved.