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

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

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

Message.setFrom介绍

[英]Set the end point reference of the reference originating the message
[中]设置发起消息的引用的端点引用

代码示例

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

  1. public Message invokeRequest(Message msg) {
  2. EndpointReference from = assemblyFactory.createEndpointReference();
  3. Endpoint fromEndpoint = assemblyFactory.createEndpoint();
  4. from.setTargetEndpoint(fromEndpoint);
  5. from.setStatus(EndpointReference.Status.WIRED_TARGET_FOUND_AND_MATCHED);
  6. msg.setFrom(from);
  7. return msg;
  8. } // end method invokeRequest

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

  1. public void invokeAsyncResponse(Message msg) {
  2. msg = processResponse(msg);
  3. // Handle async response Relates_To message ID value
  4. @SuppressWarnings("unchecked")
  5. AsyncResponseInvoker<RuntimeEndpointReference> respInvoker =
  6. (AsyncResponseInvoker<RuntimeEndpointReference>)msg.getHeaders().get("ASYNC_RESPONSE_INVOKER");
  7. // TODO - this deals with the Local case only - not distributed
  8. if( respInvoker != null && "SCA_LOCAL".equals(respInvoker.getBindingType()) ) {
  9. RuntimeEndpointReference responseEPR = respInvoker.getResponseTargetAddress();
  10. msg.setFrom(responseEPR);
  11. String msgID = respInvoker.getRelatesToMsgID();
  12. msg.getHeaders().put("RELATES_TO", msgID);
  13. } // end if
  14. InvokerAsyncResponse thePrevious = (InvokerAsyncResponse)getPrevious();
  15. if (thePrevious != null ) thePrevious.invokeAsyncResponse(msg);
  16. } // end method invokeAsyncResponse

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

  1. public void invokeAsyncResponse(Message msg) {
  2. msg = processResponse(msg);
  3. // Handle async response Relates_To message ID value
  4. @SuppressWarnings("unchecked")
  5. AsyncResponseInvoker<RuntimeEndpointReference> respInvoker =
  6. (AsyncResponseInvoker<RuntimeEndpointReference>)msg.getHeaders().get("ASYNC_RESPONSE_INVOKER");
  7. // TODO - this deals with the Local case only - not distributed
  8. if( respInvoker != null && "SCA_LOCAL".equals(respInvoker.getBindingType()) ) {
  9. RuntimeEndpointReference responseEPR = respInvoker.getResponseTargetAddress();
  10. msg.setFrom(responseEPR);
  11. String msgID = respInvoker.getRelatesToMsgID();
  12. msg.getHeaders().put("RELATES_TO", msgID);
  13. } // end if
  14. InvokerAsyncResponse thePrevious = (InvokerAsyncResponse)getPrevious();
  15. if (thePrevious != null ) thePrevious.invokeAsyncResponse(msg);
  16. } // end method invokeAsyncResponse

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

  1. msg.setFrom(responseEPR);

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

  1. msg.setFrom(responseEPR);

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

  1. /**
  2. * Creates a message with a mocked EndpointReference in the 'from' field to
  3. * simulate a comet reference (because requests are coming from browsers).
  4. * This is needed by the callback mechanism to have a source for the
  5. * request.
  6. *
  7. * @param args
  8. * arguments for the method invocation
  9. * @param sessionId
  10. * the session id of the client
  11. * @param callbackMethod
  12. * method to call once a response is available
  13. * @return an invocation message
  14. */
  15. private Message createMessageWithMockedCometReference(Object[] args, String sessionId, String callbackMethod) {
  16. Message msg = new MessageImpl();
  17. msg.getHeaders().put(Constants.MESSAGE_ID, sessionId);
  18. msg.setBody(args);
  19. EndpointReference re = new RuntimeEndpointReferenceImpl();
  20. RuntimeEndpointImpl callbackEndpoint = new RuntimeEndpointImpl();
  21. callbackEndpoint.setURI(callbackMethod);
  22. re.setCallbackEndpoint(callbackEndpoint);
  23. msg.setFrom(re);
  24. return msg;
  25. }

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

  1. public Message invoke(InvocationChain chain, Message msg) {
  2. if (invocable instanceof Endpoint) {
  3. msg.setTo((Endpoint)invocable);
  4. } else if (invocable instanceof EndpointReference) {
  5. msg.setFrom((EndpointReference)invocable);
  6. }
  7. Invoker headInvoker = chain.getHeadInvoker();
  8. Operation operation = chain.getTargetOperation();
  9. msg.setOperation(operation);
  10. Message msgContext = ThreadMessageContext.setMessageContext(msg);
  11. try {
  12. return headInvoker.invoke(msg);
  13. } finally {
  14. ThreadMessageContext.setMessageContext(msgContext);
  15. }
  16. }

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

  1. epr.rebuild();
  2. msg.setFrom(epr);
  3. msg.setTo(epr.getTargetEndpoint());

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

  1. msg.setFrom(responseEndpointReference);

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

  1. Message msg = messageFactory.createMessage();
  2. if (invocable instanceof RuntimeEndpointReference) {
  3. msg.setFrom((RuntimeEndpointReference)invocable);

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

  1. Message msg = messageFactory.createMessage();
  2. if (source instanceof RuntimeEndpointReference) {
  3. msg.setFrom((RuntimeEndpointReference)source);

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

  1. Message msg = messageFactory.createMessage();
  2. if (source instanceof RuntimeEndpointReference) {
  3. msg.setFrom((RuntimeEndpointReference)source);

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

  1. /**
  2. * If there is a callback address, create an EPR for the callback with a referenced endpoint that contains
  3. * the binding and the target callback address
  4. * @param callbackAddress - the callback address - may be null
  5. * @param inMC - the Axis incoming message context
  6. * @param msg - the Tuscany message
  7. * @throws AxisFault - if the callback address has any of the disallowed forms of callback address
  8. */
  9. private void createCallbackEPR( String callbackAddress, MessageContext inMC, Message msg ) throws AxisFault {
  10. if (callbackAddress != null ) {
  11. // Check for special (& not allowed!) WS_Addressing values
  12. checkCallbackAddress( callbackAddress, inMC );
  13. //
  14. EndpointReference from = assemblyFactory.createEndpointReference();
  15. Endpoint fromEndpoint = assemblyFactory.createEndpoint();
  16. from.setTargetEndpoint(fromEndpoint);
  17. from.setStatus(EndpointReference.Status.WIRED_TARGET_FOUND_AND_MATCHED);
  18. msg.setFrom(from);
  19. RuntimeEndpoint callbackEndpoint = (RuntimeEndpoint)assemblyFactory.createEndpoint();
  20. //
  21. WebServiceBinding cbBinding = webServiceBindingFactory.createWebServiceBinding();
  22. cbBinding.setURI(callbackAddress);
  23. callbackEndpoint.setBinding(cbBinding);
  24. //
  25. callbackEndpoint.setURI(callbackAddress);
  26. callbackEndpoint.setUnresolved(true);
  27. from.setCallbackEndpoint(callbackEndpoint);
  28. } // end if
  29. } // end method createCallbackEPR

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

  1. from.setTargetEndpoint(fromEndpoint);
  2. from.setStatus(EndpointReference.Status.WIRED_TARGET_FOUND_AND_MATCHED);
  3. requestMsg.setFrom(from);
  4. RuntimeEndpoint callbackEndpoint = (RuntimeEndpoint)assemblyFactory.createEndpoint();

相关文章