public static RemotingCommandType getRemotingCommandType(RemotingCommand remotingCommand) { if (RemotingCommandHelper.isResponseType(remotingCommand)) { return RemotingCommandType.RESPONSE_COMMAND; } return RemotingCommandType.REQUEST_COMMAND; }
public static boolean isOnewayRPC(RemotingCommand remotingCommand) { int bits = 1 << RPC_ONEWAY; return (remotingCommand.getFlag() & bits) == bits; }
@Override public RemotingCommand processRequest(Channel channel, RemotingCommand request) throws RemotingCommandException { JobCompletedRequest requestBody = request.getBody(); for (JobCompletedBiz biz : bizChain) { RemotingCommand remotingCommand = biz.doBiz(requestBody); if (remotingCommand != null) { return remotingCommand; } } return RemotingCommand.createResponseCommand(RemotingProtos.ResponseCode.SUCCESS.code()); }
public static RemotingCommand createResponseCommand(int code, String remark, RemotingCommandBody body) { RemotingCommand cmd = new RemotingCommand(); RemotingCommandHelper.markResponseType(cmd); cmd.setCode(code); cmd.setRemark(remark); cmd.setBody(body); cmd.setOpaque(requestId.getAndIncrement()); return cmd; }
public static RemotingCommand createResponseCommand(int code) { return createResponseCommand(code, null, null); }
@Override public RemotingCommand processRequest(Channel channel, RemotingCommand request) throws RemotingCommandException { JobCompletedRequest requestBody = request.getBody(); for (JobCompletedBiz biz : bizChain) { RemotingCommand remotingCommand = biz.doBiz(requestBody); if (remotingCommand != null) { return remotingCommand; } } return RemotingCommand.createResponseCommand(RemotingProtos.ResponseCode.SUCCESS.code()); }
public static RemotingCommand createResponseCommand(int code, String remark, RemotingCommandBody body) { RemotingCommand cmd = new RemotingCommand(); RemotingCommandHelper.markResponseType(cmd); cmd.setCode(code); cmd.setRemark(remark); cmd.setBody(body); cmd.setOpaque(requestId.getAndIncrement()); return cmd; }
public static RemotingCommand createResponseCommand(int code, RemotingCommandBody body) { return createResponseCommand(code, null, body); }
public static boolean isResponseType(RemotingCommand remotingCommand) { int bits = 1 << RPC_TYPE; return (remotingCommand.getFlag() & bits) == bits; }
public static RemotingCommandType getRemotingCommandType(RemotingCommand remotingCommand) { if (RemotingCommandHelper.isResponseType(remotingCommand)) { return RemotingCommandType.RESPONSE_COMMAND; } return RemotingCommandType.REQUEST_COMMAND; }
public static RemotingCommand createResponseCommand(int code, String remark) { return createResponseCommand(code, remark, null); }
public static boolean isResponseType(RemotingCommand remotingCommand) { int bits = 1 << RPC_TYPE; return (remotingCommand.getFlag() & bits) == bits; }
public static RemotingCommand createResponseCommand(int code) { return createResponseCommand(code, null, null); }
public static boolean isOnewayRPC(RemotingCommand remotingCommand) { int bits = 1 << RPC_ONEWAY; return (remotingCommand.getFlag() & bits) == bits; }
public static RemotingCommand createResponseCommand(int code, RemotingCommandBody body) { return createResponseCommand(code, null, body); }
public static RemotingCommand createResponseCommand(int code, String remark) { return createResponseCommand(code, remark, null); }