Tabnine Logo
SoaHeader.getMethodName
Code IndexAdd Tabnine to your IDE (free)

How to use
getMethodName
method
in
com.isuwang.dapeng.core.SoaHeader

Best Java code snippets using com.isuwang.dapeng.core.SoaHeader.getMethodName (Showing top 20 results out of 315)

origin: isuwang/isuwang-soa

private static String generateKey(SoaHeader soaHeader) {
  return soaHeader.getServiceName() + ":" + soaHeader.getMethodName() + ":" + soaHeader.getVersionName();
}
origin: com.isuwang/dapeng-remoting-api

@Override
public void doFilter(FilterChain chain) throws TException {
  final long startTime = System.currentTimeMillis();
  final SoaHeader soaHeader = (SoaHeader) chain.getAttribute(StubFilterChain.ATTR_KEY_HEADER);
  try {
    chain.doFilter();
  } finally {
    LOGGER.info("{} {} {} 耗时:{}ms", soaHeader.getServiceName(), soaHeader.getVersionName(), soaHeader.getMethodName(), System.currentTimeMillis() - startTime);
  }
}
origin: isuwang/isuwang-soa

  private String generateKey(SoaHeader header) {
    return header.getServiceName() + ":" + header.getMethodName() + ":" + header.getVersionName();
  }
}
origin: isuwang/isuwang-soa

@Override
public void doFilter(FilterChain chain) throws TException {
  final long startTime = System.currentTimeMillis();
  final SoaHeader soaHeader = (SoaHeader) chain.getAttribute(StubFilterChain.ATTR_KEY_HEADER);
  try {
    chain.doFilter();
  } finally {
    LOGGER.info("{} {} {} 耗时:{}ms", soaHeader.getServiceName(), soaHeader.getVersionName(), soaHeader.getMethodName(), System.currentTimeMillis() - startTime);
  }
}
origin: isuwang/isuwang-soa

@Override
public void doFilter(FilterChain chain) throws TException {
  final long startTime = System.currentTimeMillis();
  final SoaHeader soaHeader = (SoaHeader) chain.getAttribute(ContainerFilterChain.ATTR_KEY_HEADER);
  final TransactionContext context = (TransactionContext) chain.getAttribute(ContainerFilterChain.ATTR_KEY_CONTEXT);
  try {
    chain.doFilter();
  } finally {
    LOGGER.info("{} {} {} {} 耗时:{}ms", soaHeader.getServiceName(), soaHeader.getVersionName(), soaHeader.getMethodName(), context.getSeqid(), System.currentTimeMillis() - startTime);
  }
}
origin: isuwang/isuwang-soa

.filter(m -> m.getName().equals(soaHeader.getMethodName()) && m.isAnnotationPresent(SoaGlobalTransactional.class))
.count();
count = count + new ArrayList<>(Arrays.asList(aClass.getMethods()))
    .stream()
    .filter(m -> m.getName().equals(soaHeader.getMethodName()) && m.isAnnotationPresent(SoaGlobalTransactional.class))
    .count();
origin: com.isuwang/dapeng-remoting-api

@Override
public void doFilter(FilterChain chain) throws TException {
  final SoaHeader soaHeader = (SoaHeader) chain.getAttribute(StubFilterChain.ATTR_KEY_HEADER);
  final Object request = chain.getAttribute(StubFilterChain.ATTR_KEY_REQUEST);
  LOGGER.info("{} {} {} request header:{} body:{}", soaHeader.getServiceName(), soaHeader.getVersionName(), soaHeader.getMethodName(), soaHeader.toString(), request.toString());
  try {
    chain.doFilter();
  } finally {
    Object response = chain.getAttribute(StubFilterChain.ATTR_KEY_RESPONSE);
    if (response != null)
      LOGGER.info("{} {} {} response header:{} body:{}", soaHeader.getServiceName(), soaHeader.getVersionName(), soaHeader.getMethodName(), soaHeader.toString(), formatToString(response.toString()));
  }
}
origin: isuwang/isuwang-soa

public Task(TransactionContext context) {
  this.startTime = System.currentTimeMillis();
  this.seqid = context.getSeqid();
  SoaHeader soaHeader = context.getHeader();
  this.serviceName = soaHeader.getServiceName();
  this.versionName = soaHeader.getVersionName();
  this.methodName = soaHeader.getMethodName();
  this.callerFrom = soaHeader.getCallerFrom().isPresent() ? soaHeader.getCallerFrom().get() : null;
  this.callerIp = soaHeader.getCallerIp().isPresent() ? soaHeader.getCallerIp().get() : null;
  this.operatorId = soaHeader.getOperatorId().isPresent() ? soaHeader.getOperatorId().get() : null;
  this.operatorName = soaHeader.getOperatorName().isPresent() ? soaHeader.getOperatorName().get() : null;
  this.customerId = soaHeader.getCustomerId().isPresent() ? soaHeader.getCustomerId().get() : null;
  this.customerName = soaHeader.getCustomerName().isPresent() ? soaHeader.getCustomerName().get() : null;
  this.currentThread = Thread.currentThread();
}
origin: isuwang/isuwang-soa

String callerInfo = LoadBalanceFilter.getCallerInfo(header.getServiceName(), header.getVersionName(), header.getMethodName());
origin: isuwang/isuwang-soa

  private void writeErrorMessage(ChannelHandlerContext ctx, ByteBuf outputBuf, TransactionContext context, SoaHeader soaHeader, TSoaTransport outputSoaTransport, TSoaServiceProtocol outputProtocol, SoaException e) {
    if (outputProtocol != null) {
      try {
        if (outputBuf.writerIndex() > 0)
          outputBuf.writerIndex(Integer.BYTES);

        soaHeader.setRespCode(Optional.ofNullable(e.getCode()));
        soaHeader.setRespMessage(Optional.ofNullable(e.getMsg()));
        outputProtocol.writeMessageBegin(new TMessage(soaHeader.getServiceName() + ":" + soaHeader.getMethodName(), TMessageType.REPLY, context.getSeqid()));
        outputProtocol.writeMessageEnd();

        outputSoaTransport.flush();

        ctx.writeAndFlush(outputBuf);

        LOGGER.info("{} {} {} response header:{} body:{null}", soaHeader.getServiceName(), soaHeader.getVersionName(), soaHeader.getMethodName(), soaHeader.toString());
      } catch (Throwable e1) {
        LOGGER.error(e1.getMessage(), e1);
      }
    }
  }
}
origin: isuwang/isuwang-soa

@Override
public void doFilter(FilterChain chain) throws TException {
  final SoaHeader soaHeader = (SoaHeader) chain.getAttribute(StubFilterChain.ATTR_KEY_HEADER);
  final Object request = chain.getAttribute(StubFilterChain.ATTR_KEY_REQUEST);
  final long startTime = System.currentTimeMillis();
  final InvocationContext context = (InvocationContext) chain.getAttribute(StubFilterChain.ATTR_KEY_CONTEXT);
  LOGGER.info("{} {} {} request", soaHeader.getServiceName(), soaHeader.getVersionName(), soaHeader.getMethodName());
  try {
    chain.doFilter();
  } finally {
    // Object response = chain.getAttribute(StubFilterChain.ATTR_KEY_RESPONSE);
    final long endTime = System.currentTimeMillis();
    LOGGER.info("{} {} {} callee: {}:{} response respCode:{} time:{}ms", soaHeader.getServiceName(), soaHeader.getVersionName(), soaHeader.getMethodName(),
        context.getCalleeIp(), context.getCalleePort(), soaHeader.getRespCode(), endTime-startTime);
  }
}
origin: com.isuwang/dapeng-core

/**
 * SoaHeader验证
 */
@Override
public void validate(SoaHeader bean) throws TException {
  if (bean.getServiceName() == null)
    throw new SoaException(SoaBaseCode.NotNull, "serviceName字段不允许为空");
  if (bean.getMethodName() == null)
    throw new SoaException(SoaBaseCode.NotNull, "methodName字段不允许为空");
  if (bean.getVersionName() == null)
    throw new SoaException(SoaBaseCode.NotNull, "versionName字段不允许为空");
}
origin: isuwang/isuwang-soa

/**
 * SoaHeader验证
 */
@Override
public void validate(SoaHeader bean) throws TException {
  if (bean.getServiceName() == null)
    throw new SoaException(SoaBaseCode.NotNull, "serviceName字段不允许为空");
  if (bean.getMethodName() == null)
    throw new SoaException(SoaBaseCode.NotNull, "methodName字段不允许为空");
  if (bean.getVersionName() == null)
    throw new SoaException(SoaBaseCode.NotNull, "versionName字段不允许为空");
}
origin: com.isuwang/dapeng-route-impl

/**
 * 根据matcher.Id,返回上下文中对应的值
 *
 * @param ctx
 * @param matcher
 * @return
 */
public static Object checkFieldMatcher(InvocationContext ctx, Matcher matcher) {
  Id id = matcher.getId();
  if ("operatorId".equals(id.getName())) {
    return ctx.getHeader().getOperatorId().orElse(null);
  } else if ("callerFrom".equals(id.getName())) {
    return ctx.getHeader().getCallerFrom().orElse(null);
  } else if ("ip".equals(id.getName())) {
    return ctx.getHeader().getCallerIp().orElse(null);
  } else if ("customerId".equals(id.getName())) {
    return ctx.getHeader().getCustomerId().orElse(null);
  } else if ("service".equals(id.getName())) {
    return ctx.getHeader().getServiceName();
  } else if ("method".equals(id.getName())) {
    return ctx.getHeader().getMethodName();
  } else if ("version".equals(id.getName())) {
    return ctx.getHeader().getVersionName();
  } else {
    throw new AssertionError("not support Field: " + id.getName());
  }
}
origin: isuwang/isuwang-soa

/**
 * 根据matcher.Id,返回上下文中对应的值
 *
 * @param ctx
 * @param matcher
 * @return
 */
public static Object checkFieldMatcher(InvocationContext ctx, Matcher matcher) {
  Id id = matcher.getId();
  if ("operatorId".equals(id.getName())) {
    return ctx.getHeader().getOperatorId().orElse(null);
  } else if ("callerFrom".equals(id.getName())) {
    return ctx.getHeader().getCallerFrom().orElse(null);
  } else if ("ip".equals(id.getName())) {
    return ctx.getHeader().getCallerIp().orElse(null);
  } else if ("customerId".equals(id.getName())) {
    return ctx.getHeader().getCustomerId().orElse(null);
  } else if ("service".equals(id.getName())) {
    return ctx.getHeader().getServiceName();
  } else if ("method".equals(id.getName())) {
    return ctx.getHeader().getMethodName();
  } else if ("version".equals(id.getName())) {
    return ctx.getHeader().getVersionName();
  } else {
    throw new AssertionError("not support Field: " + id.getName());
  }
}
origin: com.isuwang/dapeng-core

/**
 * 异步处理,当返回结果被complete时调用
 *
 * @param context
 * @param soaProcessFunction
 * @param result
 * @param out
 * @param future
 */
private void AsyncAccept(Context context, SoaProcessFunction<I, Object, Object, ? extends TBeanSerializer<Object>, ? extends TBeanSerializer<Object>> soaProcessFunction, Object result, TProtocol out, CompletableFuture future) {
  try {
    TransactionContext.Factory.setCurrentInstance((TransactionContext) context);
    SoaHeader soaHeader = context.getHeader();
    LOGGER.info("{} {} {} {} response header:{} body:{}", soaHeader.getServiceName(), soaHeader.getVersionName(), soaHeader.getMethodName(), context.getSeqid(), soaHeader.toString(), formatToString(soaProcessFunction.getResSerializer().toString(result)));
    soaHeader.setRespCode(Optional.of("0000"));
    soaHeader.setRespMessage(Optional.of("成功"));
    out.writeMessageBegin(new TMessage(soaHeader.getMethodName(), TMessageType.CALL, context.getSeqid()));
    soaProcessFunction.getResSerializer().write(result, out);
    out.writeMessageEnd();
    /**
     * 通知外层handler处理结果
     */
    future.complete(context);
  } catch (TException e) {
    e.printStackTrace();
  }
}
origin: isuwang/isuwang-soa

/**
 * 异步处理,当返回结果被complete时调用
 *
 * @param context
 * @param soaProcessFunction
 * @param result
 * @param out
 * @param future
 */
private void AsyncAccept(Context context, SoaProcessFunction<I, Object, Object, ? extends TBeanSerializer<Object>, ? extends TBeanSerializer<Object>> soaProcessFunction, Object result, TProtocol out, CompletableFuture future) {
  try {
    TransactionContext.Factory.setCurrentInstance((TransactionContext) context);
    SoaHeader soaHeader = context.getHeader();
    LOGGER.info("{} {} {} {} response header:{} body:{}", soaHeader.getServiceName(), soaHeader.getVersionName(), soaHeader.getMethodName(), context.getSeqid(), soaHeader.toString(), formatToString(soaProcessFunction.getResSerializer().toString(result)));
    soaHeader.setRespCode(Optional.of("0000"));
    soaHeader.setRespMessage(Optional.of("成功"));
    out.writeMessageBegin(new TMessage(soaHeader.getMethodName(), TMessageType.CALL, context.getSeqid()));
    soaProcessFunction.getResSerializer().write(result, out);
    out.writeMessageEnd();
    /**
     * 通知外层handler处理结果
     */
    future.complete(context);
  } catch (TException e) {
    e.printStackTrace();
  }
}
origin: isuwang/isuwang-soa

/**
 * 异步处理,当返回结果被complete时调用
 *
 * @param context
 * @param soaProcessFunction
 * @param result
 * @param out
 * @param future
 */
private void AsyncAccept(Context context, SoaProcessFunction<I, Object, Object, ? extends TCommonBeanSerializer<Object>, ? extends TCommonBeanSerializer<Object>> soaProcessFunction, Object result, TProtocol out, CompletableFuture future) {
  try {
    TransactionContext.Factory.setCurrentInstance((TransactionContext) context);
    SoaHeader soaHeader = context.getHeader();
    LOGGER.info("{} {} {} {} response header:{} body:{}", soaHeader.getServiceName(), soaHeader.getVersionName(), soaHeader.getMethodName(), context.getSeqid(), soaHeader.toString(), formatToString(soaProcessFunction.getResSerializer().toString(result)));
    soaHeader.setRespCode(Optional.of("0000"));
    soaHeader.setRespMessage(Optional.of("成功"));
    out.writeMessageBegin(new TMessage(soaHeader.getMethodName(), TMessageType.CALL, context.getSeqid()));
    soaProcessFunction.getResSerializer().write(result, out);
    out.writeMessageEnd();
    /**
     * 通知外层handler处理结果
     */
    future.complete(context);
  } catch (TException e) {
    e.printStackTrace();
  }
}
origin: com.isuwang/dapeng-remoting-api

String serviceKey = soaHeader.getServiceName() + "." + soaHeader.getVersionName() + "." + soaHeader.getMethodName() + ".consumer";
RegistryAgent registryAgent = RegistryAgentProxy.getCurrentInstance(RegistryAgentProxy.Type.Client);
origin: isuwang/isuwang-soa

public static PlatformProcessData getNewInstance(SoaHeader soaHeader) {
  PlatformProcessData processData = new PlatformProcessData();
  processData.setServiceName(soaHeader.getServiceName());
  processData.setMethodName(soaHeader.getMethodName());
  processData.setVersionName(soaHeader.getVersionName());
  processData.setServerIP(IPUtils.localIp());
  processData.setServerPort(SoaSystemEnvProperties.SOA_CONTAINER_PORT);
  processData.setIAverageTime(0l);
  processData.setIMaxTime(0l);
  processData.setIMinTime(0l);
  processData.setITotalTime(0l);
  processData.setPAverageTime(0l);
  processData.setPMaxTime(0l);
  processData.setPMinTime(0l);
  processData.setPTotalTime(0l);
  processData.setFailCalls(0);
  processData.setSucceedCalls(0);
  processData.setTotalCalls(0);
  processData.setRequestFlow(0);
  processData.setResponseFlow(0);
  return processData;
}
com.isuwang.dapeng.coreSoaHeadergetMethodName

Popular methods of SoaHeader

  • getServiceName
  • getVersionName
  • <init>
  • setMethodName
  • setServiceName
  • setVersionName
  • getRespCode
  • setCallerFrom
  • getCallerFrom
  • getCustomerId
  • getOperatorId
  • getRespMessage
  • getOperatorId,
  • getRespMessage,
  • getCallerIp,
  • getCustomerName,
  • getOperatorName,
  • setCallerIp,
  • setOperatorId,
  • setOperatorName,
  • setTransactionId

Popular in Java

  • Finding current android device location
  • getContentResolver (Context)
  • getSharedPreferences (Context)
  • getResourceAsStream (ClassLoader)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now