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

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

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

origin: com.isuwang/dapeng-core

@Override
public String toString(SoaHeader bean) {
  return bean == null ? "null" : bean.toString();
}
origin: isuwang/isuwang-soa

@Override
public String toString(SoaHeader bean) {
  return bean == null ? "null" : bean.toString();
}
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

  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: 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 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: 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: com.isuwang/dapeng-core

LOGGER.info("{} {} {} {} request header:{} body:{}", soaHeader.getServiceName(), soaHeader.getVersionName(), soaHeader.getMethodName(), context.getSeqid(), soaHeader.toString(), formatToString(soaProcessFunction.getReqSerializer().toString(args)));
long startTime = System.currentTimeMillis();
try {
  result = soaProcessFunction.getResult(iface, args);
  LOGGER.info("{} {} {} {} response header:{} body:{}", soaHeader.getServiceName(), soaHeader.getVersionName(), soaHeader.getMethodName(), context.getSeqid(), soaHeader.toString(), formatToString(soaProcessFunction.getResSerializer().toString(result)));
} finally {
  chain.setAttribute(ContainerFilterChain.ATTR_KEY_I_PROCESSTIME, System.currentTimeMillis() - startTime);
origin: com.isuwang/dapeng-core

LOGGER.info("{} {} {} {} request header:{} body:{}", soaHeader.getServiceName(), soaHeader.getVersionName(), soaHeader.getMethodName(), context.getSeqid(), soaHeader.toString(), formatToString(soaProcessFunction.getReqSerializer().toString(args)));
long startTime = System.currentTimeMillis();
origin: isuwang/isuwang-soa

LOGGER.info("{} {} {} {} request header:{} body:{}", soaHeader.getServiceName(), soaHeader.getVersionName(), soaHeader.getMethodName(), context.getSeqid(), soaHeader.toString(), formatToString(soaProcessFunction.getReqSerializer().toString(args)));
long startTime = System.currentTimeMillis();
origin: isuwang/isuwang-soa

LOGGER.info("{} {} {} {} request header:{} body:{}", soaHeader.getServiceName(), soaHeader.getVersionName(), soaHeader.getMethodName(), context.getSeqid(), soaHeader.toString(), formatToString(soaProcessFunction.getReqSerializer().toString(args)));
long startTime = System.currentTimeMillis();
origin: isuwang/isuwang-soa

LogUtil.logDebug(SoaBaseProcessor.class,soaHeader,"{} {} {} {} request header:{} body:{}",soaHeader.getServiceName(), soaHeader.getVersionName(), soaHeader.getMethodName(), context.getSeqid().toString(), soaHeader.toString(), formatToString(soaProcessFunction.getReqSerializer().toString(args)));
com.isuwang.dapeng.coreSoaHeadertoString

Popular methods of SoaHeader

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

Popular in Java

  • Making http requests using okhttp
  • compareTo (BigDecimal)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getSharedPreferences (Context)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top plugins for Android Studio
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