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


Java FastMap.Entry方法代码示例

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


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

示例1: processXmlCAPDialog

import javolution.util.FastMap; //导入方法依赖的package包/类
protected void processXmlCAPDialog(XmlCAPDialog xmlCAPDialog, CAPDialog capDialog, boolean isScf, FastList<Long> sentInvokeIds)
		throws CAPException {

    // marking of incoming Invokes for which there will not be responses / errors
	FastList<Long> processInvokeWithoutAnswerIds = xmlCAPDialog.getProcessInvokeWithoutAnswerIds();
	for (FastList.Node<Long> 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<Long, CAPErrorMessage> errorMessages = xmlCAPDialog.getErrorComponents().getErrorComponents();
       for (FastMap.Entry<Long, CAPErrorMessage> 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<CAPMessage> capMessages = xmlCAPDialog.getCAPMessages();
       for (FastList.Node<CAPMessage> 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
}
 
开发者ID:RestComm,项目名称:camelgateway,代码行数:63,代码来源:CamelBaseSbb.java


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