本文整理汇总了Java中org.apache.axis2.context.MessageContext.setCurrentPhaseIndex方法的典型用法代码示例。如果您正苦于以下问题:Java MessageContext.setCurrentPhaseIndex方法的具体用法?Java MessageContext.setCurrentPhaseIndex怎么用?Java MessageContext.setCurrentPhaseIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.axis2.context.MessageContext
的用法示例。
在下文中一共展示了MessageContext.setCurrentPhaseIndex方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: flowComplete
import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
public void flowComplete(MessageContext msgContext) {
if (isDebugEnabled) {
log.debug(msgContext.getLogIDString() + " Invoking flowComplete() in Phase \"" +
phaseName + "\"");
}
// This will be non-zero if we failed during execution of one of the
// handlers in this phase
int currentHandlerIndex = msgContext.getCurrentPhaseIndex();
if (currentHandlerIndex == 0) {
currentHandlerIndex = handlers.size();
} else {
/*We need to set it to 0 so that any previous phases will execute all
* of their handlers.*/
msgContext.setCurrentPhaseIndex(0);
}
for (; currentHandlerIndex > 0; currentHandlerIndex--) {
Handler handler = (Handler) handlers.get(currentHandlerIndex - 1);
if (isDebugEnabled) {
log.debug(msgContext.getLogIDString() + " Invoking flowComplete() for Handler '" +
handler.getName() + "' in Phase '" + phaseName + "'");
}
handler.flowComplete(msgContext);
}
}
示例2: invoke
import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
/**
* Invoke all the handlers in this Phase
*
* @param msgctx the current MessageContext
* @return An InvocationResponse that indicates what
* the next step in the message processing should be.
* @throws org.apache.axis2.AxisFault
*/
public final InvocationResponse invoke(MessageContext msgctx) throws AxisFault {
if (isDebugEnabled) {
log.debug(msgctx.getLogIDString() + " Checking pre-condition for Phase \"" + phaseName +
"\"");
}
int currentIndex = msgctx.getCurrentPhaseIndex();
if (currentIndex == 0) {
checkPreconditions(msgctx);
}
if (isDebugEnabled) {
log.debug(msgctx.getLogIDString() + " Invoking phase \"" + phaseName + "\"");
}
int handlersSize = handlers.size();
for (int i= currentIndex; i < handlersSize; i++) {
Handler handler = (Handler) handlers.get(i);
InvocationResponse pi = invokeHandler(handler, msgctx);
if (!pi.equals(InvocationResponse.CONTINUE)) {
return pi;
}
// Set phase index to the next handler
msgctx.setCurrentPhaseIndex(i+1);
}
if (isDebugEnabled) {
log.debug(msgctx.getLogIDString() + " Checking post-conditions for phase \"" +
phaseName + "\"");
}
msgctx.setCurrentPhaseIndex(0);
checkPostConditions(msgctx);
return InvocationResponse.CONTINUE;
}