All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ikasoa.rpc.service.AbstractGetService Maven / Gradle / Ivy

There is a newer version: 0.3.3-BETA3
Show newest version
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)));
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy