Tabnine Logo
InvocationContext.getHeader
Code IndexAdd Tabnine to your IDE (free)

How to use
getHeader
method
in
com.isuwang.dapeng.core.InvocationContext

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

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-transaction-api

invocationContext.getHeader().setTransactionId(Optional.of(transactionContext.getCurrentTransactionId()));
invocationContext.getHeader().setTransactionSequence(Optional.of(transactionContext.getCurrentTransactionSequence()));
transactionProcess.setExpectedStatus(TGlobalTransactionProcessExpectedStatus.Success);
transactionProcess.setServiceName(invocationContext.getHeader().getServiceName());
transactionProcess.setMethodName(invocationContext.getHeader().getMethodName());
transactionProcess.setVersionName(invocationContext.getHeader().getVersionName());
transactionProcess.setRollbackMethodName(invocationContext.getHeader().getMethodName() + "_rollback");
origin: isuwang/isuwang-soa

invocationContext.getHeader().setTransactionId(Optional.of(transactionContext.getCurrentTransactionId()));
invocationContext.getHeader().setTransactionSequence(Optional.of(transactionContext.getCurrentTransactionSequence()));
transactionProcess.setExpectedStatus(TGlobalTransactionProcessExpectedStatus.Success);
transactionProcess.setServiceName(invocationContext.getHeader().getServiceName());
transactionProcess.setMethodName(invocationContext.getHeader().getMethodName());
transactionProcess.setVersionName(invocationContext.getHeader().getVersionName());
transactionProcess.setRollbackMethodName(invocationContext.getHeader().getMethodName() + "_rollback");
origin: isuwang/isuwang-soa

public <REQ, RESP> RESP send(REQ request, TCommonBeanSerializer<REQ> requestSerializer, TCommonBeanSerializer<RESP> responseSerializer) throws TException {
  final InvocationContext context = InvocationContext.Factory.getCurrentInstance();
  SoaHeader header = context.getHeader();
  RESP response=null;
    header =  InvocationContext.Factory.getCurrentInstance().getHeader();
    if (msg.type == TMessageType.EXCEPTION) {
      TApplicationException x = TApplicationException.read(protocol);
origin: isuwang/isuwang-soa

SoaHeader soaHeader = context.getHeader();
        SoaHeader resultSoaHeader = InvocationContext.Factory.getCurrentInstance().getHeader();
        if (TMessageType.EXCEPTION == msg.type) {
          TApplicationException x = TApplicationException.read(inputProtocol);
origin: isuwang/isuwang-soa

SoaHeader soaHeader = context.getHeader();
        SoaHeader resultSoaHeader = InvocationContext.Factory.getCurrentInstance().getHeader();
        if (TMessageType.EXCEPTION == msg.type) {
          TApplicationException x = TApplicationException.read(inputProtocol);
origin: isuwang/isuwang-soa

SoaHeader soaHeader = context.getHeader();
  soaHeader=InvocationContext.Factory.getCurrentInstance().getHeader();
  if (TMessageType.EXCEPTION == msg.type) {
    TApplicationException x = TApplicationException.read(inputProtocol);
origin: isuwang/isuwang-soa

@Override
public <REQ, RESP> RESP send(REQ request, TCommonBeanSerializer<REQ> requestSerializer, TCommonBeanSerializer<RESP> responseSerializer) throws TException {
  InvocationContext context = InvocationContext.Factory.getCurrentInstance();
  SoaHeader soaHeader = context.getHeader();
      soaHeader = InvocationContext.Factory.getCurrentInstance().getHeader();
origin: isuwang/isuwang-soa

public <REQ, RESP> RESP send(REQ request, RESP response, TBeanSerializer<REQ> requestSerializer, TBeanSerializer<RESP> responseSerializer) throws TException {
  InvocationContext context = InvocationContext.Factory.getCurrentInstance();
  SoaHeader soaHeader = context.getHeader();
      soaHeader=InvocationContext.Factory.getCurrentInstance().getHeader();
      if (TMessageType.EXCEPTION == msg.type) {
        TApplicationException x = TApplicationException.read(inputProtocol);
origin: isuwang/isuwang-soa

SoaHeader soaHeader = context.getHeader() == null ? new SoaHeader() : context.getHeader();
origin: com.isuwang/dapeng-remoting-api

SoaHeader soaHeader = context.getHeader() == null ? new SoaHeader() : context.getHeader();
origin: com.isuwang/dapeng-remoting-api

@SuppressWarnings("unchecked")
protected <REQ, RESP> RESP sendBase(REQ request, RESP response, TBeanSerializer<REQ> requestSerializer, TBeanSerializer<RESP> responseSerializer) throws TException {
  InvocationContext context = InvocationContext.Factory.getCurrentInstance();
  SoaHeader soaHeader = context.getHeader();
origin: com.isuwang/dapeng-remoting-api

  context.setCalleeIp(infos[0]);
  context.setCalleePort(Integer.valueOf(infos[1]));
  context.getHeader().setVersionName(infos[2]);
} else if (isLocal) {
  context.setCalleeIp(SoaSystemEnvProperties.SOA_SERVICE_IP);
origin: isuwang/isuwang-soa

@SuppressWarnings("unchecked")
protected <REQ, RESP> RESP sendBase(REQ request, TCommonBeanSerializer<REQ> requestSerializer, TCommonBeanSerializer<RESP> responseSerializer) throws TException {
  InvocationContext context = InvocationContext.Factory.getCurrentInstance();
  SoaHeader soaHeader = context.getHeader();
origin: isuwang/isuwang-soa

@SuppressWarnings("unchecked")
protected <REQ, RESP> RESP sendBase(REQ request, RESP response, TBeanSerializer<REQ> requestSerializer, TBeanSerializer<RESP> responseSerializer) throws TException {
  InvocationContext context = InvocationContext.Factory.getCurrentInstance();
  SoaHeader soaHeader = context.getHeader();
origin: isuwang/isuwang-soa

  context.setCalleeIp(infos[0]);
  context.setCalleePort(Integer.valueOf(infos[1]));
  context.getHeader().setVersionName(infos[2]);
} else if (isLocal) {
  context.setCalleeIp(SoaSystemEnvProperties.SOA_SERVICE_IP);
origin: com.isuwang/dapeng-remoting-api

/**
 * 发送异步请求
 *
 * @param request            请求实体
 * @param response           返回实体
 * @param requestSerializer
 * @param responseSerializer
 * @param timeout            超时时间
 * @param <REQ>
 * @param <RESP>
 * @return
 * @throws TException
 */
protected <REQ, RESP> Future<RESP> sendBaseAsync(REQ request, RESP response, TBeanSerializer<REQ> requestSerializer, TBeanSerializer<RESP> responseSerializer, long timeout) throws TException {
  InvocationContext context = InvocationContext.Factory.getCurrentInstance();
  SoaHeader soaHeader = context.getHeader();
  soaHeader.setAsyncCall(true);
  final StubFilterChain stubFilterChain = new StubFilterChain();
  stubFilterChain.setLastFilter(new SendMessageFilter());
  stubFilterChain.setAttribute(StubFilterChain.ATTR_KEY_CONTEXT, context);
  stubFilterChain.setAttribute(StubFilterChain.ATTR_KEY_HEADER, soaHeader);
  stubFilterChain.setAttribute(StubFilterChain.ATTR_KEY_REQUEST, request);
  stubFilterChain.setAttribute(SendMessageFilter.ATTR_KEY_SENDMESSAGE, (SendMessageFilter.SendMessageAction) (chain) -> {
    SoaConnection conn = connectionPool.getConnection();
    Future<RESP> resp = conn.sendAsync(request, response, requestSerializer, responseSerializer, timeout);
    chain.setAttribute(StubFilterChain.ATTR_KEY_RESPONSE, resp);
  });
  stubFilterChain.doFilter();
  return (Future<RESP>) stubFilterChain.getAttribute(StubFilterChain.ATTR_KEY_RESPONSE);
}
origin: isuwang/isuwang-soa

/**
 * 发送异步请求
 *
 * @param request            请求实体
 * @param response           返回实体
 * @param requestSerializer
 * @param responseSerializer
 * @param timeout            超时时间
 * @param <REQ>
 * @param <RESP>
 * @return
 * @throws TException
 */
protected <REQ, RESP> Future<RESP> sendBaseAsync(REQ request, RESP response, TBeanSerializer<REQ> requestSerializer, TBeanSerializer<RESP> responseSerializer, long timeout) throws TException {
  InvocationContext context = InvocationContext.Factory.getCurrentInstance();
  SoaHeader soaHeader = context.getHeader();
  soaHeader.setAsyncCall(true);
  final StubFilterChain stubFilterChain = new StubFilterChain();
  stubFilterChain.setLastFilter(new SendMessageFilter());
  stubFilterChain.setAttribute(StubFilterChain.ATTR_KEY_CONTEXT, context);
  stubFilterChain.setAttribute(StubFilterChain.ATTR_KEY_HEADER, soaHeader);
  stubFilterChain.setAttribute(StubFilterChain.ATTR_KEY_REQUEST, request);
  stubFilterChain.setAttribute(SendMessageFilter.ATTR_KEY_SENDMESSAGE, (SendMessageFilter.SendMessageAction) (chain) -> {
    SoaConnection conn = connectionPool.getConnection();
    Future<RESP> resp = conn.sendAsync(request, response, requestSerializer, responseSerializer, timeout);
    chain.setAttribute(StubFilterChain.ATTR_KEY_RESPONSE, resp);
  });
  stubFilterChain.doFilter();
  return (Future<RESP>) stubFilterChain.getAttribute(StubFilterChain.ATTR_KEY_RESPONSE);
}
origin: isuwang/isuwang-soa

/**
 * 发送异步请求
 *
 * @param request            请求实体
 * @param requestSerializer
 * @param responseSerializer
 * @param timeout            超时时间
 * @param <REQ>
 * @param <RESP>
 * @return
 * @throws TException
 */
protected <REQ, RESP> Future<RESP> sendBaseAsync(REQ request, TCommonBeanSerializer<REQ> requestSerializer, TCommonBeanSerializer<RESP> responseSerializer, long timeout) throws TException {
  InvocationContext context = InvocationContext.Factory.getCurrentInstance();
  SoaHeader soaHeader = context.getHeader();
  soaHeader.setAsyncCall(true);
  final StubFilterChain stubFilterChain = new StubFilterChain();
  stubFilterChain.setLastFilter(new SendMessageFilter());
  stubFilterChain.setAttribute(StubFilterChain.ATTR_KEY_CONTEXT, context);
  stubFilterChain.setAttribute(StubFilterChain.ATTR_KEY_HEADER, soaHeader);
  stubFilterChain.setAttribute(StubFilterChain.ATTR_KEY_REQUEST, request);
  stubFilterChain.setAttribute(SendMessageFilter.ATTR_KEY_SENDMESSAGE, (SendMessageFilter.SendMessageAction) (chain) -> {
    SoaCommonConnection conn = connectionPool.getCommonConnection();
    Future<RESP> resp = conn.sendAsync(request, requestSerializer, responseSerializer, timeout);
    chain.setAttribute(StubFilterChain.ATTR_KEY_RESPONSE, resp);
  });
  stubFilterChain.doFilter();
  return (Future<RESP>) stubFilterChain.getAttribute(StubFilterChain.ATTR_KEY_RESPONSE);
}
com.isuwang.dapeng.coreInvocationContextgetHeader

Popular methods of InvocationContext

  • getCalleeIp
  • getCalleePort
  • getCalleeTimeout
  • getSeqid
  • setCalleeTimeout
  • setHeader
  • setSeqid
  • <init>
  • getFailedTimes
  • isSoaTransactionProcess
  • setCalleeIp
  • setCalleePort
  • setCalleeIp,
  • setCalleePort,
  • setFailedTimes,
  • setSoaTransactionProcess

Popular in Java

  • Reading from database using SQL prepared statement
  • runOnUiThread (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • compareTo (BigDecimal)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Top 12 Jupyter Notebook extensions
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