当前位置: 首页>>代码示例>>Java>>正文


Java MessageContext.setFailureReason方法代码示例

本文整理汇总了Java中org.apache.axis2.context.MessageContext.setFailureReason方法的典型用法代码示例。如果您正苦于以下问题:Java MessageContext.setFailureReason方法的具体用法?Java MessageContext.setFailureReason怎么用?Java MessageContext.setFailureReason使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.axis2.context.MessageContext的用法示例。


在下文中一共展示了MessageContext.setFailureReason方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createOtherError

import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
/**
 * Creates a new Error Signal message with one <i>Other</i> error that indicates that an internal error occurred
 * while processing the received message unit(s). As we don't know exactly what was the cause of the error the ebMS
 * error does not reference any other message unit.
 *
 * @param mc    The current message context to which the error is added
 */
private void createOtherError(final MessageContext mc) {
    final OtherContentError   otherError = new OtherContentError();
    otherError.setErrorDetail("An internal error occurred while processing the message.");
    otherError.setSeverity(IEbmsError.Severity.WARNING);
    ErrorMessage errorMessage = new ErrorMessage();
    errorMessage.addError(otherError);
    try {
        log.debug("Create the Error signal message");
        IErrorMessageEntity storedError = (IErrorMessageEntity) HolodeckB2BCore.getStorageManager()
                                                                            .storeOutGoingMessageUnit(errorMessage);
        log.debug("Created a new Error signal message");
        mc.setProperty(MessageContextProperties.OUT_ERRORS, Collections.singletonList(storedError));
        log.debug("Set the Error signal as the only ebMS message to return");
    } catch (final PersistenceException dbe) {
        // (Still) a problem with the database, create the Error signal message without storing it
        log.fatal("Could not store error signal message in database! Details: " + dbe.getMessage());
        log.debug("Set the non-persisted ErrorMessage in message context");
        errorMessage.setMessageId(MessageIdGenerator.createMessageId());
        mc.setProperty(MessageContextProperties.OUT_ERRORS, Collections.singletonList(errorMessage));
    }
    // Remove the error condition from the context as we handled the error here
    mc.setFailureReason(null);
}
 
开发者ID:holodeck-b2b,项目名称:Holodeck-B2B,代码行数:31,代码来源:CatchAxisFault.java

示例2: validate_action

import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
public void validate_action(MessageContext msgContext, MessageContext newmsgContext) {
	String in_action = msgContext.getWSAAction();
	
	String out_action = SoapActionFactory.getResponseAction(in_action);
	if (out_action == null) {
		newmsgContext.setFailureReason(new Exception("Unknown action <" + in_action + ">"));
		return;
	}
	newmsgContext.setWSAAction(out_action);
}
 
开发者ID:jembi,项目名称:openxds,代码行数:11,代码来源:XDSRawXMLInOutMessageReceiver.java

示例3: send

import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
/**
 * This methods represents the outflow of the Axis, this could be either at the server side or the client side.
 * Here the <code>ExecutionChain</code> is created using the Phases. The Handlers at the each Phases is ordered in
 * deployment time by the deployment module
 *
 * @param msgContext
 * @throws AxisFault
 * @see MessageContext
 * @see Phase
 * @see Handler
 */
public static void send(MessageContext msgContext) throws AxisFault {
    if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
        log.trace(msgContext.getLogIDString() + " send:" + msgContext.getMessageID());
    }
    // find and invoke the Phases
    OperationContext operationContext = msgContext.getOperationContext();
    ArrayList executionChain = operationContext.getAxisOperation().getPhasesOutFlow();
    //rather than having two steps added both oparation and global chain together
    ArrayList outPhases = new ArrayList();
    outPhases.addAll(executionChain);
    outPhases.addAll(msgContext.getConfigurationContext().getAxisConfiguration().getOutFlowPhases());
    msgContext.setExecutionChain(outPhases);
    msgContext.setFLOW(MessageContext.OUT_FLOW);
    try {
        InvocationResponse pi = invoke(msgContext, NOT_RESUMING_EXECUTION);

        if (pi.equals(InvocationResponse.CONTINUE)) {
            // write the Message to the Wire
            TransportOutDescription transportOut = msgContext.getTransportOut();
            if (transportOut == null) {
                throw new AxisFault("Transport out has not been set");
            }
            TransportSender sender = transportOut.getSender();
            // This boolean property only used in client side fireAndForget invocation
            //It will set a property into message context and if some one has set the
            //property then transport sender will invoke in a diffrent thread
            if (Utils.isClientThreadNonBlockingPropertySet(msgContext)) {
                msgContext.getConfigurationContext().getThreadPool().execute(
                        new TransportNonBlockingInvocationWorker(msgContext, sender));
            } else {
                sender.invoke(msgContext);
            }
            //REVIEW: In the case of the TransportNonBlockingInvocationWorker, does this need to wait until that finishes?
            flowComplete(msgContext);
        } else if (pi.equals(InvocationResponse.SUSPEND)) {
        } else if (pi.equals(InvocationResponse.ABORT)) {
            flowComplete(msgContext);
        } else {
            String errorMsg =
                    "Unrecognized InvocationResponse encountered in AxisEngine.send()";
            log.error(msgContext.getLogIDString() + " " + errorMsg);
            throw new AxisFault(errorMsg);
        }
    } catch (AxisFault e) {
        msgContext.setFailureReason(e);
        flowComplete(msgContext);
        throw e;
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:61,代码来源:AxisEngine.java


注:本文中的org.apache.axis2.context.MessageContext.setFailureReason方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。