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


Java FastList.add方法代码示例

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


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

示例1: setSctpExtraHostAddresses

import javolution.util.FastList; //导入方法依赖的package包/类
public void setSctpExtraHostAddresses(String val) {
    if (val == null)
        return;

    String[] ss = val.split(" ");
    FastList<String> fl = new FastList<String>();
    for (String s : ss) {
        if (s.length() != 0) {
            fl.add(s);
        }
    }
    extraHostAddresses = new String[fl.size()];
    fl.toArray(extraHostAddresses);
}
 
开发者ID:RestComm,项目名称:phone-simulator,代码行数:15,代码来源:M3uaConfigurationData.java

示例2: processXmlCAPDialog

import javolution.util.FastList; //导入方法依赖的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

示例3: run

import javolution.util.FastList; //导入方法依赖的package包/类
@Override
public void run() {
    if (logger.isInfoEnabled()) {
        logger.info("SmppServerOpsThread started.");
    }

    while (this.started) {

        FastList<Esme> pendingList = new FastList<Esme>();

        try {
            synchronized (this.esmesServer) {
                for (String esmeServerName : this.esmesServer.keySet()) {
                    Esme nextServer = this.esmeManagement.getEsmeByName(esmeServerName);

                    if (!nextServer.isStarted()) {
                        nextServer.setServerBound(false);
                    }

                    /* check server is dropped by link */
                    if ((!nextServer.getLinkDropServerEnabled() && !nextServer.getEnquireServerEnabled())
                            || !nextServer.isServerBound()) {
                        continue;
                    }

                    // server is always in the list, let send enquire message
                    Long delay = this.esmesServer.get(nextServer.getName());

                    if (delay <= System.currentTimeMillis()) {
                        pendingList.add(nextServer);
                    }
                } // for
            }

            // Sending Enquire messages
            Iterator<Esme> changes = pendingList.iterator();
            while (changes.hasNext()) {
                Esme change = changes.next();

                if (change.getLinkDropServerEnabled()) {
                    this.serverLinkDown(change);
                } else {
                    this.enquireLink(change);
                }
            }

            synchronized (this.waitObject) {
                this.waitObject.wait(5000);
            }

        } catch (Exception e) {
            logger.error("Error while looping SmpServerOpsThread thread", e);
        }

    } // while

    if (logger.isInfoEnabled()) {
        logger.info("SmppServerOpsThread for stopped.");
    }
}
 
开发者ID:RestComm,项目名称:smpp-extensions,代码行数:61,代码来源:SmppServerOpsThread.java


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