/**
* Autogenerated by Thrift Compiler (0.9.3)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package thrift.iface;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2015-11-22")
public class DIYFrameworkService {
public interface Iface {
public Reponse send(Request request) throws ServiceException, org.apache.thrift.TException;
}
public interface AsyncIface {
public void send(Request request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
}
public static class Client extends org.apache.thrift.TServiceClient implements Iface {
public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
public Factory() {}
public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
return new Client(prot);
}
public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
return new Client(iprot, oprot);
}
}
public Client(org.apache.thrift.protocol.TProtocol prot)
{
super(prot, prot);
}
public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
super(iprot, oprot);
}
public Reponse send(Request request) throws ServiceException, org.apache.thrift.TException
{
send_send(request);
return recv_send();
}
public void send_send(Request request) throws org.apache.thrift.TException
{
send_args args = new send_args();
args.setRequest(request);
sendBase("send", args);
}
public Reponse recv_send() throws ServiceException, org.apache.thrift.TException
{
send_result result = new send_result();
receiveBase(result, "send");
if (result.isSetSuccess()) {
return result.success;
}
if (result.e != null) {
throw result.e;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "send failed: unknown result");
}
}
public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface {
public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
private org.apache.thrift.async.TAsyncClientManager clientManager;
private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
this.clientManager = clientManager;
this.protocolFactory = protocolFactory;
}
public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
return new AsyncClient(protocolFactory, clientManager, transport);
}
}
public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
super(protocolFactory, clientManager, transport);
}
public void send(Request request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
send_call method_call = new send_call(request, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class send_call extends org.apache.thrift.async.TAsyncMethodCall {
private Request request;
public send_call(Request request, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.request = request;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("send", org.apache.thrift.protocol.TMessageType.CALL, 0));
send_args args = new send_args();
args.setRequest(request);
args.write(prot);
prot.writeMessageEnd();
}
public Reponse getResult() throws ServiceException, org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_send();
}
}
}
public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor {
private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
public Processor(I iface) {
super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
}
protected Processor(I iface, Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) {
super(iface, getProcessMap(processMap));
}
private static <I extends Iface> Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> getProcessMap(Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) {
processMap.put("send", new send());
return processMap;
}
public static class send<I extends Iface> extends org.apache.thrift.ProcessFunction<I, send_args> {
public send() {
super("send");
}
public send_args getEmptyArgsInstance() {
return new send_args();
}
protected boolean isOneway() {
return false;
}
public send_result getResult(I iface, send_args args) throws org.apache.thrift.TException {
send_result result = new send_result();
try {
result.success = iface.send(args.request);
} catch (ServiceException e) {
result.e = e;
}
return result;
}
}
}
public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> {
private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName());
public AsyncProcessor(I iface) {
super(iface,
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
服务治理框架,一般存在与RPC的上一层,用来在大量RPC服务至上,协调客户端和服务器的调用工作。这个示例工程和我的博客《架构设计:系统间通信(13)——RPC实例Apache Thrift 下篇》(http://blog.csdn.net/yinwenjie/article/details/49869535)相对应。相关的设计和代码说明,请参见我的博客。另外,工程已经测试过了,可以直接下载导入eclipse运行,您需要maven的支持。
资源推荐
资源详情
资源评论
收起资源包目录
testThrift2.rar (98个子文件)
testThrift2
.project 563B
src
processor
DIYFrameworkServiceImpl.java 5KB
MainProcessor.java 8KB
utils
JSONUtils.java 6KB
DateUtils.java 3KB
client
ThriftClient.java 5KB
business
pojo
UserPojo.java 895B
AbstractPojo.java 287B
DescPojo.java 1KB
BusinessResponsePojo.java 1016B
BusinessServicesMapping.java 446B
impl
QueryUserDetailServiceImpl.java 649B
exception
ResponseCode.java 2KB
BizException.java 834B
BusinessService.java 567B
thrift
iface
ServiceException.java 16KB
RESCODE.java 892B
Request.java 16KB
DIYFrameworkService.java 36KB
Reponse.java 16KB
EXCCODE.java 883B
target
classes
processor
MainProcessor$StartServerThread.class 3KB
MainProcessor$MyDefaultWatcher.class 823B
MainProcessor.class 5KB
DIYFrameworkServiceImpl.class 5KB
MainProcessor$StartServerEventHandler.class 2KB
utils
DateUtils.class 3KB
JSONUtils.class 5KB
DateJsonValueProcessor.class 2KB
JSONUtils$1.class 985B
client
ThriftClient.class 5KB
ClientDefaultWatcher.class 491B
business
pojo
BusinessResponsePojo.class 1KB
DescPojo.class 1KB
UserPojo.class 1005B
AbstractPojo.class 289B
BusinessServicesMapping.class 728B
impl
QueryUserDetailServiceImpl.class 1KB
exception
ResponseCode.class 3KB
BizException.class 822B
BusinessService.class 367B
thrift
iface
DIYFrameworkService$AsyncProcessor$send$1.class 3KB
Request$_Fields.class 3KB
DIYFrameworkService$send_args$send_argsTupleScheme.class 2KB
Reponse$ReponseTupleScheme.class 2KB
DIYFrameworkService$send_args$_Fields.class 3KB
DIYFrameworkService$send_result$send_resultTupleSchemeFactory.class 1KB
DIYFrameworkService$send_result.class 12KB
DIYFrameworkService$AsyncClient$send_call.class 3KB
ServiceException$_Fields.class 3KB
DIYFrameworkService$send_args$send_argsStandardScheme.class 3KB
Reponse$ReponseStandardScheme.class 3KB
DIYFrameworkService.class 881B
Request$RequestStandardScheme.class 3KB
DIYFrameworkService$AsyncClient$Factory.class 2KB
ServiceException$ServiceExceptionStandardSchemeFactory.class 1KB
DIYFrameworkService$send_args$send_argsStandardSchemeFactory.class 1KB
Reponse$ReponseTupleSchemeFactory.class 919B
DIYFrameworkService$send_result$send_resultStandardScheme.class 3KB
ServiceException$ServiceExceptionTupleSchemeFactory.class 1KB
Reponse$_Fields.class 3KB
RESCODE.class 1KB
DIYFrameworkService$Client$Factory.class 2KB
ServiceException$ServiceExceptionTupleScheme.class 2KB
Request$RequestTupleSchemeFactory.class 919B
DIYFrameworkService$Client.class 2KB
DIYFrameworkService$send_result$send_resultTupleScheme.class 2KB
DIYFrameworkService$send_args.class 10KB
DIYFrameworkService$Iface.class 373B
Reponse$ReponseStandardSchemeFactory.class 943B
Request$RequestStandardSchemeFactory.class 943B
DIYFrameworkService$AsyncIface.class 370B
DIYFrameworkService$send_result$send_resultStandardSchemeFactory.class 1KB
ServiceException.class 12KB
DIYFrameworkService$send_args$send_argsTupleSchemeFactory.class 1KB
EXCCODE.class 1KB
DIYFrameworkService$AsyncClient.class 2KB
DIYFrameworkService$send_result$_Fields.class 3KB
DIYFrameworkService$Processor$send.class 2KB
ServiceException$ServiceExceptionStandardScheme.class 3KB
Reponse.class 12KB
DIYFrameworkService$AsyncProcessor.class 2KB
DIYFrameworkService$Processor.class 2KB
Request$RequestTupleScheme.class 2KB
Request.class 12KB
DIYFrameworkService$AsyncProcessor$send.class 3KB
test-classes
.settings
org.eclipse.m2e.core.prefs 90B
org.eclipse.jdt.core.prefs 664B
org.eclipse.core.resources.prefs 96B
thrift
demoHello.thrift 1KB
gen-java
thrift
iface
ServiceException.java 16KB
RESCODE.java 979B
Request.java 16KB
DIYFrameworkService.java 37KB
Reponse.java 16KB
EXCCODE.java 970B
pom.xml 2KB
.classpath 781B
bin
processor
thrift
iface
共 98 条
- 1
说好不能打脸
- 粉丝: 1w+
- 资源: 8
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
前往页