org.apache.tuscany.sca.invocation.Message.setOperation()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(217)

本文整理了Java中org.apache.tuscany.sca.invocation.Message.setOperation()方法的一些代码示例,展示了Message.setOperation()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.setOperation()方法的具体详情如下:
包路径:org.apache.tuscany.sca.invocation.Message
类名称:Message
方法名:setOperation

Message.setOperation介绍

[英]Sets the operation that created the message.
[中]设置创建消息的操作。

代码示例

代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime

public void invokeAsync(Operation operation, Message msg){
  msg.setOperation(operation);
  invoker.invokeAsync(msg);
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime

public void invokeAsync(Operation operation, Message msg){
  msg.setOperation(operation);
  invoker.invokeAsync(msg);
} // end method invokeAsync(Operation, Message)

代码示例来源:origin: org.apache.tuscany.sca/tuscany-binding-http-runtime

@Override
public Message invoke(Message msg) {
  HTTPContext context = msg.getBindingContext();
  HttpServletRequest request = context.getHttpRequest();
  String path = request.getPathInfo();
  if (path.startsWith("/")) {
    path = path.substring(1);
  }
  for (Operation op : operations) {
    if (op.getName().equals(path)) {
      msg.setOperation(op);
      return next.invoke(msg);
    }
  }
  
  throw new ServiceRuntimeException("No matching operation: " + path);
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-binding-jms-runtime

public Message invokeRequest(Message msg) {
    // get the jms context
    JMSBindingContext context = msg.getBindingContext();
    javax.jms.Message jmsMsg = context.getJmsMsg();
        Operation operation = getTargetOperation(jmsMsg);
    msg.setOperation(operation);
    return msg;
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-binding-jms-runtime

public Message invokeRequest(Message msg) {           
  //  TODO - could probably optimize this better 
  String operationName = msg.getOperation().getName();
  String operationNameOverride = jmsBinding.getOpNameFromNativeOperationName(operationName);
  
  if (operationNameOverride != null) {
    for (Operation op : serviceOperations) {
      if (op.getName().equals(operationNameOverride)) {
        msg.setOperation(op);
        break;
      }
    }
  }
  return msg;
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-binding-http-runtime

@Override
public Message invoke(Message msg) {
  HTTPContext context = msg.getBindingContext();
  HttpServletRequest request = context.getHttpRequest();
  
  Operation operation = findOperation(request.getMethod());
  if(operation == null) {
    operation = findOperation("service");
  }
  
  if(operation == null) {
    throw new ServiceRuntimeException("No matching operation for " + request.getMethod());
  }
  msg.setOperation(operation);
  return next.invoke(msg);        
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-binding-jms-runtime

public Message invokeRequest(Message msg) { 
    // get the jms context
    JMSBindingContext context = msg.getBindingContext();
    javax.jms.Message jmsMsg = context.getJmsMsg();
    
    String operationName = requestMessageProcessor.getOperationName(jmsMsg);
    Operation operation = getTargetOperation(operationName, jmsMsg);
    msg.setOperation(operation);
    return msg;
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-binding-jms-runtime

public Message processResponse(Message msg) {
  // When the response message arrives, there may be information about the 
  // operation and the related request message ID in the headers - extract it into the
  // Tuscany message
  
  javax.jms.Message responseMsg = msg.getBody();
  try {
    // Operation name...
    String operationName = responseMsg.getStringProperty("scaOperationName");
    for( Operation op : operations ) {
      if( operationName.equals(op.getName())) {
        msg.setOperation(op);
        break;
      } // end if
    } // end for
    
    // Relates to header...
    String relatesTo = responseMsg.getStringProperty("RELATES_TO");
    if( relatesTo != null ) {
      msg.getHeaders().put("RELATES_TO", relatesTo);
    } // end if
  } catch (JMSException e) {
    // TODO Auto-generated catch block
  } // end try
  return msg;
} // end method processResponse

代码示例来源:origin: org.apache.tuscany.sca/tuscany-binding-rest-runtime

msg.setOperation(operation);

代码示例来源:origin: org.apache.tuscany.sca/tuscany-binding-rest-runtime

msg.setOperation(operation);

代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime

public Message invoke(InvocationChain chain, Message msg) {
  if (invocable instanceof Endpoint) {
    msg.setTo((Endpoint)invocable);
  } else if (invocable instanceof EndpointReference) {
    msg.setFrom((EndpointReference)invocable);
  }
  Invoker headInvoker = chain.getHeadInvoker();
  Operation operation = chain.getTargetOperation();
  msg.setOperation(operation);
  Message msgContext = ThreadMessageContext.setMessageContext(msg);
  try {
    return headInvoker.invoke(msg);
  } finally {
    ThreadMessageContext.setMessageContext(msgContext);
  }
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime

msg.setOperation(getOperation( args ));

代码示例来源:origin: org.apache.tuscany.sca/tuscany-binding-ws-runtime-axis2

msg.setOperation(operation);
WSAxis2BindingContext bindingContext = new WSAxis2BindingContext();
bindingContext.setAxisInMessageContext(inMC);

代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime

operation = chain.getTargetOperation();
msg.setOperation(operation);
msg.setBody(args);

代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime

msg.setOperation(operation);
msg.setBody(args);

代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime

operation = chain.getTargetOperation();
msg.setOperation(operation);
msg.setBody(args);

代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime

Object[] body = new Object[]{root};
requestMsg.setBody(body);
requestMsg.setOperation(operation);

相关文章