jupiter2
2021-04-04 01:18:23 19 举报
jupiter
作者其他创作
大纲/内容
FailOverJupiterClient//测试进行代理调用等
JClient
*appName. String appName();*网络层connector. JConnector<JConnection> connector();*设置网络层connector. JClient withConnector(JConnector<JConnection> connector); * 注册服务实例 RegistryService registryService();
ClusterInvoker//发起调用
FailFastClusterInvoker;FailOverClusterInvoker;FailSafeClusterInvoker
启动registerServer
The client of registration center.
DefaultBroadcastDispatcher
//组播方式派发消息.
集成
The server of registration center
把invoker和Connecto组合起来了
1:n
Dispatcher
ClusterService syncService = ProxyFactory.factory(ClusterService.class) .version(\"1.0.0\") .client(client) .invokeType(InvokeType.SYNC) .clusterStrategy(ClusterInvoker.Strategy.FAIL_FAST) .newProxyInstance(); try { System.err.println(\"Sync result=\" + syncService.helloString()); } catch (Exception e) { e.printStackTrace(); }
NettyChannelGroup
int DEFAULT_SEQUENCE_STEP ;IntSequence sequence; //序号生成器ConcurrentLinkedQueue<Runnable> waitAvailableListeners; ChannelFutureListener remover;waitForAvailable();//****重要***//add(JChannel channel);JChannel next();
包含如下代码
派发消息
ProxyFactory
DefaultRoundDispatcher
//单播方式派发消息
IntRhsPadding
DefaultRegistry//继承于connector
DefaultRegistryServer
DefaultRegistryService
继承
IntSequence
DEFAULT_STEP;AtomicIntegerFieldUpdater<IntValue> updater;
NettyConnector
NettyDomainConnector;NettyTcpConnector
DefaultRegistry
默认 registry service
1:1
JupiterRegistryServer
AbstractDispatcher
JClient client;LoadBalancer loadBalancer;Serializer serializerImpl;ConsumerInterceptor[] interceptors;
序号生成器
0 条评论
下一页