org.apache.axis2.context.MessageContext.getFLOW()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(10.1k)|赞(0)|评价(0)|浏览(82)

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

MessageContext.getFLOW介绍

暂无

代码示例

代码示例来源:origin: org.apache.sandesha2/sandesha2-core

public int getFlow () {
  return msgContext.getFLOW();
}

代码示例来源:origin: org.wso2.carbon.commons/org.wso2.carbon.statistics

public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
  if (msgContext.getEnvelope() == null) {
    return InvocationResponse.CONTINUE;
  }
  if (msgContext.getFLOW() != MessageContext.IN_FLOW &&
    msgContext.getFLOW() != MessageContext.IN_FAULT_FLOW) {
    log.error("InOnlyMEPHandler not deployed in IN/IN_FAULT flow. Flow: " +
         msgContext.getFLOW());
    return InvocationResponse.CONTINUE;
  }
  try {
    msgContext.setProperty(StatisticsConstants.REQUEST_RECEIVED_TIME,
                "" + System.currentTimeMillis());
  } catch (Throwable e) { // Catching Throwable since exceptions here should not be propagated up
    log.error("Could not call InOnlyMEPHandler.invoke", e);
  }
  return InvocationResponse.CONTINUE;
}

代码示例来源:origin: holodeck-b2b/Holodeck-B2B

/**
   * Gets all User Message message units from the message.
   *
   * @param mc    The current message context
   * @return      All User Message message units in the message
   * @since 4.0.0
   */
  public static Collection<IUserMessage> getUserMessagesFromMessage(final MessageContext mc) {
    Collection<IUserMessage> userMessages = new ArrayList<>();
    Collection<IMessageUnitEntity> allMsgUnits;
    if (mc.getFLOW() == MessageContext.IN_FLOW || mc.getFLOW() == MessageContext.IN_FAULT_FLOW)
      allMsgUnits = getReceivedMessageUnits(mc);
    else
      allMsgUnits = getSentMessageUnits(mc);
    allMsgUnits.stream().filter(mu -> (mu instanceof IUserMessage))
              .forEachOrdered(mu -> userMessages.add((IUserMessage) mu));
    return userMessages;
  }
}

代码示例来源:origin: holodeck-b2b/Holodeck-B2B

/**
 * Gets the primary message unit from a message. The primary message unit determines which settings must be used for
 * message wide P-Mode parameters, i.e. parameters that do not relate to the content of a specific message unit.
 * Examples are the destination URL for a message and the WS-Security settings.
 * <p>The primary message unit is determined by the type of message unit, but differs depending on whether the
 * message is sent or received by Holodeck B2B. The following table lists the priority of message unit types for
 * each direction, the first message unit with the highest classified type is considered to be the primary message
 * unit of the message:
 * <table border="1">
 * <tr><th>Prio</th><th>Received</th><th>Sent</th></tr>
 * <tr><td>1</td><td>User message</td><td>Pull request</td></tr>
 * <tr><td>2</td><td>Receipt</td><td>User message</td></tr>
 * <tr><td>3</td><td>Error</td><td>Receipt</td></tr>
 * <tr><td>4</td><td>Pull request</td><td>Error</td></tr>
 * </table>
 *
 * @param mc    The {@link MessageContext} of the message
 * @return      The entity object of the primary message unit if one was found, or
 *              <code>null</code> if no message unit could be found in the message context
 */
public static IMessageUnitEntity getPrimaryMessageUnit(final MessageContext mc) {
  if (mc.getFLOW() == MessageContext.IN_FLOW || mc.getFLOW() == MessageContext.IN_FAULT_FLOW)
    return getPrimaryMessageUnitFromInFlow(mc);
  else
    return getPrimaryMessageUnitFromOutFlow(mc);
}

代码示例来源:origin: wso2/wso2-synapse

if (messageContext.getFLOW() == MessageContext.IN_FLOW) {
  available = concurrentAccessController.getAndDecrement();
  canAccess = available > 0;
} else if (messageContext.getFLOW() == MessageContext.OUT_FLOW) {
  available = concurrentAccessController.incrementAndGet();
  if (debugOn) {

代码示例来源:origin: org.apache.synapse/synapse-extensions

/**
 * Extract Hessian bytes from the received SOAP message and write it onto the wire
 *
 * @param msgCtx message from which the Hessian message has to be extracted
 * @param format message format to be written
 * @param out stream to which the message is written
 * @param preserve whether to preserve the indentations
 * 
 * @throws AxisFault in case of a failure in writing the message to the provided stream
 */
public void writeTo(MessageContext msgCtx, OMOutputFormat format, OutputStream out,
    boolean preserve) throws AxisFault {
  if (log.isDebugEnabled()) {
    log.debug("Start writing the Hessian message to OutputStream");
  }
  
  // Check whether the message to be written is a fault message
  if (msgCtx.getFLOW() == MessageContext.OUT_FAULT_FLOW || msgCtx.getEnvelope().hasFault()) {
    
    SOAPFault soapFault = msgCtx.getEnvelope().getBody().getFault();
    convertAndWriteHessianFault(soapFault, out);
  } else {
    
    // no differentiation between normal reply and fault (pass the original message through)
    writeHessianMessage(msgCtx, out);
  }
  if (log.isDebugEnabled()) {
    log.debug("Writing message as a Hessian message is successful");
  }
}

代码示例来源:origin: wso2/wso2-synapse

/**
 * Extract Hessian bytes from the received SOAP message and write it onto the wire
 *
 * @param msgCtx message from which the Hessian message has to be extracted
 * @param format message format to be written
 * @param out stream to which the message is written
 * @param preserve whether to preserve the indentations
 * 
 * @throws AxisFault in case of a failure in writing the message to the provided stream
 */
public void writeTo(MessageContext msgCtx, OMOutputFormat format, OutputStream out,
    boolean preserve) throws AxisFault {
  if (log.isDebugEnabled()) {
    log.debug("Start writing the Hessian message to OutputStream");
  }
  
  // Check whether the message to be written is a fault message
  if (msgCtx.getFLOW() == MessageContext.OUT_FAULT_FLOW || msgCtx.getEnvelope().hasFault()) {
    
    SOAPFault soapFault = msgCtx.getEnvelope().getBody().getFault();
    convertAndWriteHessianFault(soapFault, out);
  } else {
    
    // no differentiation between normal reply and fault (pass the original message through)
    writeHessianMessage(msgCtx, out);
  }
  if (log.isDebugEnabled()) {
    log.debug("Writing message as a Hessian message is successful");
  }
}

代码示例来源:origin: org.apache.axis2/axis2-kernel

log.debug("start getBytes()");
log.debug("  fault flow=" + 
     (messageContext.getFLOW() == MessageContext.OUT_FAULT_FLOW));
if (messageContext.getFLOW() == MessageContext.OUT_FAULT_FLOW) {
  SOAPFault fault = messageContext.getEnvelope().getBody().getFault();
  SOAPFaultDetail soapFaultDetail = fault.getDetail();

代码示例来源:origin: org.apache.axis2/axis2-kernel

/**
 * Resume processing of a message.
 *
 * @param msgctx
 * @return An InvocationResponse allowing the invoker to perhaps determine
 *         whether or not the message processing will ever succeed.
 * @throws AxisFault
 */
public static InvocationResponse resume(MessageContext msgctx) throws AxisFault {
  if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
    log.trace(msgctx.getLogIDString() + " resume:" + msgctx.getMessageID());
  }
  msgctx.setPaused(false);
  if (msgctx.getFLOW() == MessageContext.IN_FLOW) {
    return resumeReceive(msgctx);
  } else {
    return resumeSend(msgctx);
  }
}

代码示例来源:origin: apache/axis2-java

/**
 * Resume processing of a message.
 *
 * @param msgctx
 * @return An InvocationResponse allowing the invoker to perhaps determine
 *         whether or not the message processing will ever succeed.
 * @throws AxisFault
 */
public static InvocationResponse resume(MessageContext msgctx) throws AxisFault {
  if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
    log.trace(msgctx.getLogIDString() + " resume:" + msgctx.getMessageID());
  }
  msgctx.setPaused(false);
  if (msgctx.getFLOW() == MessageContext.IN_FLOW) {
    return resumeReceive(msgctx);
  } else {
    return resumeSend(msgctx);
  }
}

代码示例来源:origin: apache/axis2-java

OMElement omElement = null;
if (messageContext.getFLOW() == MessageContext.OUT_FAULT_FLOW) {
  SOAPFault fault = messageContext.getEnvelope().getBody().getFault();
  SOAPFaultDetail soapFaultDetail = fault.getDetail();

代码示例来源:origin: org.apache.axis2/axis2-kernel

OMElement omElement = null;
if (messageContext.getFLOW() == MessageContext.OUT_FAULT_FLOW) {
  SOAPFault fault = messageContext.getEnvelope().getBody().getFault();
  SOAPFaultDetail soapFaultDetail = fault.getDetail();

代码示例来源:origin: holodeck-b2b/Holodeck-B2B

/**
 * Helper method to retrieve a property from a specific message context of the operation the given message context
 * is part of.
 *
 * @param currentMsgCtx     The current {@link MessageContext}
 * @param key               The name of the property to get the value for
 * @param flow              The flow from which the property should be retrieved as integer represented using the
 *                          {@link MessageContext#IN_FLOW} and {@link MessageContext#OUT_FLOW} constants
 * @return          The value of the requested property if it exists in the out flow message context,or <br>
 *                   <code>null</code> otherwise.
 */
private static Object getPropertyFromMsgCtx(final MessageContext currentMsgCtx, final String key,
                      final int flow) {
  if (currentMsgCtx == null || key == null)
    return null;
  try {
    final OperationContext opContext = currentMsgCtx.getOperationContext();
    final MessageContext targetMsgContext = currentMsgCtx.getFLOW() == flow ? currentMsgCtx :
                        opContext.getMessageContext(flow == MessageContext.IN_FLOW ?
                                      WSDLConstants.MESSAGE_LABEL_IN_VALUE :
                                      WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
    return targetMsgContext.getProperty(key);
  } catch (final Exception ex) {
    return null;
  }
}

代码示例来源:origin: holodeck-b2b/Holodeck-B2B

currentFlowName = "INITIATOR_";
switch (mc.getFLOW()) {
  case MessageContext.IN_FLOW :
    currentFlowName += "IN_FLOW"; currentFlow |= IN_FLOW;

代码示例来源:origin: org.wso2.carbon.commons/org.wso2.carbon.statistics

return InvocationResponse.CONTINUE;
if (outMsgContext.getFLOW() != MessageContext.OUT_FLOW &&
  outMsgContext.getFLOW() != MessageContext.OUT_FAULT_FLOW) {
  log.error("InOutMEPHandler not deployed in OUT/OUT_FAULT flow. Flow: " +
       outMsgContext.getFLOW());
  return InvocationResponse.CONTINUE;

代码示例来源:origin: org.wso2.carbon.identity.framework/org.wso2.carbon.security.mgt

if (msgCtx.isFault() && Integer.valueOf(MessageContext.OUT_FAULT_FLOW).equals(msgCtx.getFLOW()) && isBasicAuth) {

代码示例来源:origin: wso2/wso2-synapse

if (messageContext.getFLOW() == MessageContext.IN_FLOW) {

代码示例来源:origin: wso2/wso2-synapse

cac = cache.get(key);
if (messageContext.getFLOW() == MessageContext.IN_FLOW) {

代码示例来源:origin: wso2/wso2-synapse

String soapEnvelope = msgCtx.getEnvelope().toString();
axis2msg.setSoapEnvelope(soapEnvelope);
axis2msg.setFLOW(msgCtx.getFLOW());
if (msgCtx.getTransportIn() != null) {
  axis2msg.setTransportInName(msgCtx.getTransportIn().getName());

代码示例来源:origin: org.apache.rampart/rampart-core

if (rmd.isInitiator() && (msgCtx.getFLOW() == MessageContext.IN_FLOW ||
    msgCtx.getFLOW() == MessageContext.IN_FAULT_FLOW)) {
  tokenCallbackHandler.removeEncryptedToken();

相关文章

微信公众号

最新文章

更多

MessageContext类方法