• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java TBaseAsyncProcessor类的典型用法和代码示例

java 2次浏览

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

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

示例1: invoke

点赞 3

import org.apache.thrift.TBaseAsyncProcessor; //导入依赖的package包/类
public void invoke() {
  frameTrans_.reset(buffer_.array());
  response_.reset();

  try {
    if (eventHandler_ != null) {
      eventHandler_.processContext(context_, inTrans_, outTrans_);
    }
    ((TBaseAsyncProcessor)processorFactory_.getProcessor(inTrans_)).process(this);
    return;
  } catch (TException te) {
    LOGGER.warn("Exception while invoking!", te);
  } catch (Throwable t) {
    LOGGER.error("Unexpected throwable while invoking!", t);
  }
  // This will only be reached when there is a throwable.
  state_ = FrameBufferState.AWAITING_CLOSE;
  requestSelectInterestChange();
}
 

开发者ID:adityayadav76,
项目名称:internet_of_things_simulator,
代码行数:20,
代码来源:AbstractNonblockingServer.java

示例2: verifyServerTraces

点赞 3

import org.apache.thrift.TBaseAsyncProcessor; //导入依赖的package包/类
@Override
public void verifyServerTraces(PluginTestVerifier verifier) throws Exception {
    final InetSocketAddress actualServerAddress = super.environment.getServerAddress();
    verifier.verifyTraceCount(2);
    Method process = TBaseAsyncProcessor.class.getDeclaredMethod("process", AsyncFrameBuffer.class);
    // RootSpan
    verifier.verifyTrace(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 - TBaseAsyncProcessor.process
    verifier.verifyTrace(event("THRIFT_SERVER_INTERNAL", process));
    verifier.verifyTraceCount(0);
}
 

开发者ID:naver,
项目名称:pinpoint,
代码行数:17,
代码来源:AsyncEchoTestServer.java

示例3: getMethodUri

点赞 3

import org.apache.thrift.TBaseAsyncProcessor; //导入依赖的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 TBaseAsyncProcessor) {
        ThriftClientCallContext clientCallContext = (ThriftClientCallContext)attachment;
        String methodName = clientCallContext.getMethodName();
        methodUri = ThriftUtils.getAsyncProcessorNameAsUri((TBaseAsyncProcessor<?>)target);
        StringBuilder sb = new StringBuilder(methodUri);
        if (!methodUri.endsWith("/")) {
            sb.append("/");
        }
        sb.append(methodName);
        methodUri = sb.toString();
    }
    return methodUri;
}
 

开发者ID:naver,
项目名称:pinpoint,
代码行数:18,
代码来源:TBaseAsyncProcessorProcessInterceptor.java

示例4: getThriftAsyncProcessMap

点赞 2

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

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

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

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

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

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

        return processMap;
    } catch (Exception e) {
        logger.debug("Failed to retrieve the asynchronous process map from:: {}", iface, e);
        return null;
    }
}
 

开发者ID:line,
项目名称:armeria,
代码行数:32,
代码来源:ThriftServiceMetadata.java

示例5: getAsyncProcessorNameAsUri

点赞 2

import org.apache.thrift.TBaseAsyncProcessor; //导入依赖的package包/类
/**
 * Returns the name of the specified {@link org.apache.thrift.TBaseAsyncProcessor TBaseAsyncProcessor}
 * as uri to be used in Pinpoint.
 */
public static String getAsyncProcessorNameAsUri(TBaseAsyncProcessor<?> asyncProcessor) {
    String actualAsyncProcessorName = asyncProcessor.getClass().getName();
    return convertDotPathToUriPath(ThriftConstants.ASYNC_PROCESSOR_PATTERN.matcher(actualAsyncProcessorName).replaceAll("."));
}
 

开发者ID:naver,
项目名称:pinpoint,
代码行数:9,
代码来源:ThriftUtils.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)