概述
import javolution.util.FastMap; //导入方法依赖的package包/类
protected void processXmlCAPDialog(XmlCAPDialog xmlCAPDialog, CAPDialog capDialog, boolean isScf, FastList sentInvokeIds)
throws CAPException {
// marking of incoming Invokes for which there will not be responses / errors
FastList processInvokeWithoutAnswerIds = xmlCAPDialog.getProcessInvokeWithoutAnswerIds();
for (FastList.Node n = processInvokeWithoutAnswerIds.head(), end = processInvokeWithoutAnswerIds.tail(); (n = n
.getNext()) != end;) {
capDialog.processInvokeWithoutAnswer(n.getValue());
}
int addedMsgs = 0;
Boolean prearrangedEnd = xmlCAPDialog.getPrearrangedEnd();
// sending of errors
FastMap errorMessages = xmlCAPDialog.getErrorComponents().getErrorComponents();
for (FastMap.Entry n = errorMessages.head(), end = errorMessages.tail(); (n = n.getNext()) != end;) {
Long invokeId = n.getKey();
CAPErrorMessage capError = n.getValue();
capDialog.sendErrorComponent(invokeId, capError);
addedMsgs++;
}
// sending of Invokes / RRL
FastList capMessages = xmlCAPDialog.getCAPMessages();
for (FastList.Node n = capMessages.head(), end = capMessages.tail(); (n = n.getNext()) != end;) {
camelStatAggregator.updateMessagesSent();
camelStatAggregator.updateMessagesAll();
CAPMessage capMessage = n.getValue();
if (addedMsgs > 0) {
// we need to test if we have enough free space to send a component in the same massage
int encodedSize;
if (prearrangedEnd != null) {
encodedSize = capDialog.getMessageUserDataLengthOnClose(prearrangedEnd);
} else {
encodedSize = capDialog.getMessageUserDataLengthOnSend();
}
CAPAsnPrimitive asnPrimitive = (CAPAsnPrimitive) capMessage;
AsnOutputStream asnOs = new AsnOutputStream();
int nextMessageSize = 10; // 10 = max component encoding header size
try {
asnPrimitive.encodeAll(asnOs);
nextMessageSize += asnOs.size(); // 10 = max component encoding header size
} catch (CAPException e) {
// ignore it: this means that a message does not have a parameter body
}
if (encodedSize + nextMessageSize + 5 > capDialog.getMaxUserDataLength()) {
capDialog.send();
addedMsgs = 0;
}
}
ProcessComponentResult ps = this.processCAPMessageFromApplication(capMessage, capDialog, isScf);
if (ps.componentAdded)
addedMsgs++;
if (ps.invokeId != null && sentInvokeIds != null) {
sentInvokeIds.add(ps.invokeId);
}
}// for loop
}
最后
以上就是可耐唇彩为你收集整理的java中entry_Java FastMap.Entry方法代码示例的全部内容,希望文章能够帮你解决java中entry_Java FastMap.Entry方法代码示例所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复