• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java TBaseProcessor类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.thrift.TBaseProcessor的典型用法代码示例。如果您正苦于以下问题:Java TBaseProcessor类的具体用法?Java TBaseProcessor怎么用?Java TBaseProcessor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TBaseProcessor类属于org.apache.thrift包,在下文中一共展示了TBaseProcessor类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: verifyServerTraces

import org.apache.thrift.TBaseProcessor; //导入依赖的package包/类
@Override
public void verifyServerTraces(PluginTestVerifier verifier) throws Exception {
    final InetSocketAddress actualServerAddress = super.environment.getServerAddress();
    verifier.verifyTraceCount(2);
    Method process = TBaseProcessor.class.getDeclaredMethod("process", TProtocol.class, TProtocol.class);
    verifier.verifyDiscreteTrace(
    // RootSpan - Thrift Server Invocation
            root("THRIFT_SERVER", // ServiceType,
                    "Thrift Server Invocation", // Method
                    "com/navercorp/pinpoint/plugin/thrift/dto/EchoService/echo", // rpc
                    actualServerAddress.getHostName() + ":" + actualServerAddress.getPort(), // endPoint
                    actualServerAddress.getHostName()), // remoteAddress
            // SpanEvent - TBaseProcessor.process
            event("THRIFT_SERVER_INTERNAL", process));
    verifier.verifyTraceCount(0);
}
 
开发者ID:naver,项目名称:pinpoint,代码行数:17,代码来源:SyncEchoTestServer.java


示例2: getMethodUri

import org.apache.thrift.TBaseProcessor; //导入依赖的package包/类
private String getMethodUri(Object target) {
    String methodUri = ThriftConstants.UNKNOWN_METHOD_URI;
    InterceptorScopeInvocation currentTransaction = this.scope.getCurrentInvocation();
    Object attachment = currentTransaction.getAttachment();
    if (attachment instanceof ThriftClientCallContext && target instanceof TBaseProcessor) {
        ThriftClientCallContext clientCallContext = (ThriftClientCallContext)attachment;
        String methodName = clientCallContext.getMethodName();
        methodUri = ThriftUtils.getProcessorNameAsUri((TBaseProcessor<?>)target);
        StringBuilder sb = new StringBuilder(methodUri);
        if (!methodUri.endsWith("/")) {
            sb.append("/");
        }
        sb.append(methodName);
        methodUri = sb.toString();
    }
    return methodUri;
}
 
开发者ID:naver,项目名称:pinpoint,代码行数:18,代码来源:TBaseProcessorProcessInterceptor.java


示例3: main

import org.apache.thrift.TBaseProcessor; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
	int port = 8083;

	TBaseProcessor<?> processor = new TCalculator.Processor<TCalculator.Iface>(new CalcIfaceImpl());

	ThriftServerDef serverDef = ThriftServerDef.newBuilder().listen(port)//
			.withProcessor(processor)//
			.using(Executors.newCachedThreadPool())//
			.clientIdleTimeout(TimeUnit.SECONDS.toMillis(15)).build();
	final ServerBootstrap server = new ServerBootstrap(serverDef);
	// 启动 Server
	server.start();
}
 
开发者ID:houkx,项目名称:nettythrift,代码行数:14,代码来源:DemoServer.java


示例4: getThriftProcessMap

import org.apache.thrift.TBaseProcessor; //导入依赖的package包/类
private static Map<String, ProcessFunction<?, ?>> getThriftProcessMap(Object service, Class<?> iface) {

        final String name = iface.getName();
        if (!name.endsWith("$Iface")) {
            return null;
        }

        final String processorName = name.substring(0, name.length() - 5) + "Processor";
        try {
            final Class<?> processorClass = Class.forName(processorName, false, iface.getClassLoader());
            if (!TBaseProcessor.class.isAssignableFrom(processorClass)) {
                return null;
            }

            final Constructor<?> processorConstructor = processorClass.getConstructor(iface);

            @SuppressWarnings("rawtypes")
            final TBaseProcessor processor = (TBaseProcessor) processorConstructor.newInstance(service);

            @SuppressWarnings("unchecked")
            Map<String, ProcessFunction<?, ?>> processMap =
                    (Map<String, ProcessFunction<?, ?>>) processor.getProcessMapView();

            return processMap;
        } catch (Exception e) {
            logger.debug("Failed to retrieve the process map from: {}", iface, e);
            return null;
        }
    }
 
开发者ID:line,项目名称:armeria,代码行数:30,代码来源:ThriftServiceMetadata.java


示例5: getProcessor

import org.apache.thrift.TBaseProcessor; //导入依赖的package包/类
@JsonIgnore
public TBaseProcessor getProcessor() {
    return this.processor;
}
 
开发者ID:sofn,项目名称:trpc,代码行数:5,代码来源:ServiceArgs.java


示例6: withProcessor

import org.apache.thrift.TBaseProcessor; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public T withProcessor(@SuppressWarnings("rawtypes") TBaseProcessor processor) {
	this.processor = processor;
	return (T) this;
}
 
开发者ID:houkx,项目名称:nettythrift,代码行数:6,代码来源:ThriftServerDefBuilderBase.java


示例7: create

import org.apache.thrift.TBaseProcessor; //导入依赖的package包/类
@Override
public TProcessor create(HttpServletRequest request) {
	return new TBaseProcessor<Hawk.Iface>(
		new HawkThriftIface(protocol, request, artemisServer), processMap) {};
}
 
开发者ID:mondo-project,项目名称:mondo-integration,代码行数:6,代码来源:HawkThriftProcessorFactory.java


示例8: getProcessorNameAsUri

import org.apache.thrift.TBaseProcessor; //导入依赖的package包/类
/**
 * Returns the name of the specified {@link org.apache.thrift.TBaseProcessor TBaseProcessor}
 * as uri to be used in Pinpoint.
 */
public static String getProcessorNameAsUri(TBaseProcessor<?> processor) {
    String actualProcessorName = processor.getClass().getName();
    return convertDotPathToUriPath(ThriftConstants.PROCESSOR_PATTERN.matcher(actualProcessorName).replaceAll("."));
}
 
开发者ID:naver,项目名称:pinpoint,代码行数:9,代码来源:ThriftUtils.java



注:本文中的org.apache.thrift.TBaseProcessor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ArtifactResolutionException类代码示例发布时间:2022-05-22
下一篇:
Java GotoStmt类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap