public class ResponseMessageProcessor extends Object
| 构造器和说明 |
|---|
ResponseMessageProcessor() |
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
handshake(io.netty.channel.Channel channel)
与已连接的模块握手
Shake hands with the core module (Manager)
|
static boolean |
handshake(String url)
与已连接的模块握手
Shake hands with the core module (Manager)
|
static String |
requestAndInvoke(String role,
Request request,
BaseInvoke baseInvoke)
发送Request,封装Request对象(可以一次调用多个cmd)
Send Request, need to wrap the Request object manually(for calling multiple methods at a time)
|
static String |
requestAndInvoke(String role,
String cmd,
Map params,
String subscriptionPeriod,
String subscriptionEventCounter,
BaseInvoke baseInvoke)
发送Request,并根据返回结果自动调用本地方法
Send the Request and automatically call the local method based on the return result
|
static String |
requestAndInvokeWithAck(String role,
String cmd,
Map params,
String subscriptionPeriod,
String subscriptionEventCounter,
BaseInvoke baseInvoke)
发送Request,需要一个Ack作为确认,并根据返回结果自动调用本地方法
Send the Request, an Ack must be received as an acknowledgement, and automatically call the local method based on the return result
|
static Response |
requestAndResponse(String role,
String cmd,
Map params)
发送Request,并等待Response
Send Request and wait for Response
|
static Response |
requestAndResponse(String role,
String cmd,
Map params,
long timeOut)
发送Request,并等待Response
Send Request and wait for Response
|
static String |
requestOnly(String role,
Request request)
发送Request,不接收返回
Send Request and wait for Response
|
static void |
sendUnsubscribe(String messageId)
取消订阅
Unsubscribe
|
static void |
syncKernel(String kernelUrl) |
static void |
syncKernel(String kernelUrl,
BaseInvoke callbackInvoke)
同步本地模块与核心模块(Manager)
1.
|
public static boolean handshake(String url) throws Exception
Exception - 握手失败, handshake failedpublic static boolean handshake(io.netty.channel.Channel channel)
throws Exception
Exception - 握手失败, handshake failedpublic static void syncKernel(String kernelUrl, BaseInvoke callbackInvoke) throws Exception
Synchronize Local Module and Core Module (Manager) 1. Send local information to Manager 2. Get connection information for locally dependent roles
Exception - 核心模块(Manager)不可用,Core Module (Manager) Not Availablepublic static Response requestAndResponse(String role, String cmd, Map params) throws Exception
role - 远程方法所属的角色,The role of remote methodcmd - 远程方法的命令,Command of the remote methodparams - 远程方法所需的参数,Parameters of the remote methodException - 请求超时(1分钟),timeout (1 minute)public static Response requestAndResponse(String role, String cmd, Map params, long timeOut) throws Exception
role - 远程方法所属的角色,The role of remote methodcmd - 远程方法的命令,Command of the remote methodparams - 远程方法所需的参数,Parameters of the remote methodtimeOut - 超时时间, timeout millisException - 请求超时(timeOut),timeout (timeOut)public static String requestAndInvoke(String role, String cmd, Map params, String subscriptionPeriod, String subscriptionEventCounter, BaseInvoke baseInvoke) throws Exception
role - 远程方法所属的角色,The role of remote methodcmd - 远程方法的命令,Command of the remote methodparams - 远程方法所需的参数,Parameters of the remote methodsubscriptionPeriod - 远程方法调用频率(秒),Frequency of remote method (Second)subscriptionEventCounter - 远程方法调用频率(改变次数),Frequency of remote method (Change count)baseInvoke - 响应该结果的类的实例,Classes that respond to this resultException - 请求超时(1分钟),timeout (1 minute)public static String requestAndInvokeWithAck(String role, String cmd, Map params, String subscriptionPeriod, String subscriptionEventCounter, BaseInvoke baseInvoke) throws Exception
role - 远程方法所属的角色,The role of remote methodcmd - 远程方法的命令,Command of the remote methodparams - 远程方法所需的参数,Parameters of the remote methodsubscriptionPeriod - 远程方法调用频率(秒),Frequency of remote method (Second)subscriptionEventCounter - 远程方法调用频率(改变次数),Frequency of remote method (Change count)baseInvoke - 响应该结果的类的实例,Classes that respond to this resultException - 请求超时(1分钟),timeout (1 minute)public static String requestAndInvoke(String role, Request request, BaseInvoke baseInvoke) throws Exception
role - 远程方法所属的角色,The role of remote methodrequest - 包含所有访问属性的Request对象,Request object containing all necessary informationbaseInvoke - 响应该结果的类的实例,Classes that respond to this resultException - 请求超时(1分钟),timeout (1 minute)public static String requestOnly(String role, Request request) throws Exception
role - 远程方法所属的角色,The role of remote methodrequest - 远程方法的命令,Command of the remote methodException - 请求超时(1分钟),timeout (1 minute)Copyright © 2021. All rights reserved.