com.ikasoa.rpc.service.AbstractGetService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ikasoa-rpc Show documentation
Show all versions of ikasoa-rpc Show documentation
ikasoa-rpc is a high performance RPC(Remote Procedure Call) framework.
package com.ikasoa.rpc.service;
import com.ikasoa.core.thrift.service.Service;
import com.ikasoa.core.utils.StringUtil;
import com.ikasoa.rpc.handler.ProtocolHandler;
import lombok.SneakyThrows;
import com.ikasoa.rpc.BaseGetService;
import com.ikasoa.rpc.RpcException;
/**
* 抽象服务端服务
*
* @author Larry
* @version 0.1
*/
public abstract class AbstractGetService implements Service, BaseGetService {
protected ProtocolHandler protocolHandler;
@Override
@SneakyThrows
public String get(String argStr) throws RpcException {
if (protocolHandler == null)
throw new RpcException("'protocolHandler' is null !");
if (StringUtil.isEmpty(argStr))
throw new RpcException("'argStr' is null !");
return protocolHandler.resultToStr(get(protocolHandler.strToArg(argStr)));
}
}