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


Java FastList.Node方法代码示例

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


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

示例1: findOptionalParameter

import javolution.util.FastList; //导入方法依赖的package包/类
protected int findOptionalParameter(short tag) {
	if (this.optionalParameters == null) {
		return -1;
	}
	int i = 0;
	for (FastList.Node<Tlv> node = this.optionalParameters.head(), end = this.optionalParameters.tail(); (node = node
			.getNext()) != end;) {
		Tlv tlv = node.getValue();
		if (tlv.getTag() == tag) {
			return i;
		}
		i++;
	}
	// if we get here, we didn't find the parameter by tag
	return -1;
}
 
开发者ID:RestComm,项目名称:smpp-extensions,代码行数:17,代码来源:TlvSet.java

示例2: run

import javolution.util.FastList; //导入方法依赖的package包/类
@Override
public void run() {
    boolean needDay = false;
    boolean needHour = false;
    boolean needMinute = false;
    Date tm = new Date();
    if (lastDay != tm.getDay()) {
        lastDay = tm.getDay();
        needDay = true;
    }
    if (lastHour != tm.getHours()) {
        lastHour = tm.getHours();
        needHour = true;
    }
    if (lastMinute != tm.getMinutes()) {
        lastMinute = tm.getMinutes();
        needMinute = true;
    }

    for (FastList.Node<Esme> n = esmes.head(), end = esmes.tail(); (n = n.getNext()) != end;) {
        Esme esme = n.getValue();
        if (needDay) {
            esme.clearDayMsgCounter();
        } else if (needHour) {
            esme.clearHourMsgCounter();
        } else if (needMinute) {
            esme.clearMinuteMsgCounter();
        } else {
            esme.clearSecondMsgCounter();
        }
    }
}
 
开发者ID:RestComm,项目名称:smpp-extensions,代码行数:33,代码来源:EsmeManagement.java

示例3: getNetworkRoutingRule

import javolution.util.FastList; //导入方法依赖的package包/类
@Override
public NetworkRoutingRule getNetworkRoutingRule(int networkId) {
	for (FastList.Node<NetworkRoutingRule> n = this.scRoutingRuleList.head(), end = this.scRoutingRuleList.tail(); (n = n
			.getNext()) != end;) {
		NetworkRoutingRule rule = n.getValue();

		if (rule.getNetworkId() == networkId) {
			return rule;
		}
	}
	return null;
}
 
开发者ID:RestComm,项目名称:camelgateway,代码行数:13,代码来源:NetworkRoutingRuleManagement.java

示例4: getEsmeByName

import javolution.util.FastList; //导入方法依赖的package包/类
@Override
public Esme getEsmeByName(String esmeName) {
    for (FastList.Node<Esme> n = esmes.head(), end = esmes.tail(); (n = n.getNext()) != end;) {
        Esme esme = n.getValue();
        if (esme.getName().equals(esmeName)) {
            return esme;
        }
    }
    return null;
}
 
开发者ID:RestComm,项目名称:smpp-extensions,代码行数:11,代码来源:EsmeManagement.java

示例5: getEsmeByPrimaryKey

import javolution.util.FastList; //导入方法依赖的package包/类
protected Esme getEsmeByPrimaryKey(String SystemId, String host, int port, SmppBindType smppBindType) {

        // Check for actual SystemId, host and port
        for (FastList.Node<Esme> n = esmes.head(), end = esmes.tail(); (n = n.getNext()) != end;) {
            Esme esme = n.getValue();

            if (esme.getSystemId().equals(SystemId) && esme.getSmppBindType() == smppBindType) {
                // discoveredEsme = esme;
                if (esme.getHost().equals(host) && esme.getPort() == port) {
                    // exact match found
                    return esme;
                }

                if (esme.getHost().equals(host) && esme.getPort() == -1) {
                    // Hosts match but port is any
                    if (esme.getLocalStateName().equals(com.cloudhopper.smpp.SmppSession.STATES[SmppSession.STATE_CLOSED])) {
                        return esme;
                    }
                }

                if (esme.getHost().equals("-1") && esme.getPort() == port) {
                    // Host is any but port matches
                    if (esme.getLocalStateName().equals(com.cloudhopper.smpp.SmppSession.STATES[SmppSession.STATE_CLOSED])) {
                        return esme;
                    }
                }

                if (esme.getHost().equals("-1") && esme.getPort() == -1) {
                    // Host is any and port is also any
                    if (esme.getLocalStateName().equals(com.cloudhopper.smpp.SmppSession.STATES[SmppSession.STATE_CLOSED])) {
                        return esme;
                    }
                }

            } // esme.getSystemId().equals(SystemId) && esme.getSmppBindType() ==
              // smppBindType
        }

        return null;
    }
 
开发者ID:RestComm,项目名称:smpp-extensions,代码行数:41,代码来源:EsmeManagement.java

示例6: stop

import javolution.util.FastList; //导入方法依赖的package包/类
public void stop() throws Exception {
    this.clearMessageClearTimer();

    this.store();

    for (FastList.Node<Esme> n = esmes.head(), end = esmes.tail(); (n = n.getNext()) != end;) {
        Esme esme = n.getValue();
        this.stopWrappedSession(esme);
        this.unregisterEsmeMbean(esme.getName());
    }
}
 
开发者ID:RestComm,项目名称:smpp-extensions,代码行数:12,代码来源:EsmeManagement.java

示例7: doPost

import javolution.util.FastList; //导入方法依赖的package包/类
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
	ServletInputStream is = request.getInputStream();
	try {
		XmlCAPDialog original = factory.deserialize(is);
		HttpSession session = request.getSession(true);
		if (logger.isInfoEnabled()) {
			logger.info("doPost. HttpSession=" + session.getId() + " Dialog = " + original);
		}

		FastList<CAPMessage> capMessages = original.getCAPMessages();

		for (FastList.Node<CAPMessage> n = capMessages.head(), end = capMessages.tail(); (n = n.getNext()) != end;) {

			CAPMessage capMessage = n.getValue();
			switch (capMessage.getMessageType()) {
			case initialDP_Request:
				InitialDPRequestImpl initialDPRequest = (InitialDPRequestImpl) capMessage;
				this.handleIdp(original, initialDPRequest);
				break;
			case applyChargingReport_Request:
				ApplyChargingReportRequestImpl applyChargingReportRequest = (ApplyChargingReportRequestImpl) capMessage;
				logger.info(String.format("Received applyChargingReportRequest=%s", applyChargingReportRequest));
				break;
			case eventReportBCSM_Request:
				EventReportBCSMRequestImpl eventReportBCSMRequest = (EventReportBCSMRequestImpl) capMessage;
				logger.info(String.format("Received eventReportBCSMRequest=%s", eventReportBCSMRequest));
				break;
			default:
				logger.info(String.format("unrecognized capMessage=%s", capMessage));
				break;

			}
		}

		// send response
		this.sendResponse(response, original);
	} catch (XMLStreamException e) {
		logger.error("Error while processing received XML", e);
	}

}
 
开发者ID:RestComm,项目名称:camelgateway,代码行数:43,代码来源:TestServlet.java

示例8: doPost

import javolution.util.FastList; //导入方法依赖的package包/类
@Override
	public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
		ServletInputStream is = request.getInputStream();
		try {
			XmlCAPDialog original = factory.deserialize(is);
			HttpSession session = request.getSession(true);
			if (logger.isInfoEnabled()) {
				logger.info("doPost. HttpSession=" + session.getId() + " Dialog = " + original);
			}

			FastList<CAPMessage> capMessages = original.getCAPMessages();

			for (FastList.Node<CAPMessage> n = capMessages.head(), end = capMessages.tail(); (n = n.getNext()) != end;) {

				CAPMessage capMessage = n.getValue();
				switch (capMessage.getMessageType()) {
//				case initialDP_Request:
//					InitialDPRequestImpl initialDPRequest = (InitialDPRequestImpl) capMessage;
//					this.handleIdp(original, initialDPRequest);
//					break;
//				case continue_Request:
//					ContinueRequestImpl continueRequest = (ContinueRequestImpl) capMessage;
//					this.handleContinueRequest(original, continueRequest);
//					break;
				case applyChargingReport_Request:
					ApplyChargingReportRequestImpl applyChargingReportRequest = (ApplyChargingReportRequestImpl) capMessage;
					logger.info(String.format("Received applyChargingReportRequest=%s", applyChargingReportRequest));
					break;
				case eventReportBCSM_Request:
					EventReportBCSMRequestImpl eventReportBCSMRequest = (EventReportBCSMRequestImpl) capMessage;
					logger.info(String.format("Received eventReportBCSMRequest=%s", eventReportBCSMRequest));
					break;
				default:
					logger.info(String.format("unrecognized capMessage=%s", capMessage));
					break;

				}
			}

			// send response
			this.sendResponse(response, original);
		} catch (XMLStreamException e) {
			logger.error("Error while processing received XML", e);
		}

	}
 
开发者ID:RestComm,项目名称:camelgateway,代码行数:47,代码来源:TestForwardServlet.java

示例9: 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

示例10: start

import javolution.util.FastList; //导入方法依赖的package包/类
public void start() throws Exception {

		// for monitoring thread use, it's preferable to create your own
		// instance of an executor and cast it to a ThreadPoolExecutor from
		// Executors.newCachedThreadPool() this permits exposing thinks like
		// executor.getActiveCount() via JMX possible no point renaming the
		// threads in a factory since underlying Netty framework does not easily
		// allow you to customize your thread names
		this.executor = (ThreadPoolExecutor) Executors.newCachedThreadPool();

		// to enable automatic expiration of requests, a second scheduled
		// executor is required which is what a monitor task will be executed
		// with - this is probably a thread pool that can be shared with between
		// all client bootstraps
		this.monitorExecutor = (ScheduledThreadPoolExecutor) Executors.newScheduledThreadPool(1, new ThreadFactory() {
			private AtomicInteger sequence = new AtomicInteger(0);

			@Override
			public Thread newThread(Runnable r) {
				Thread t = new Thread(r);
				t.setName("SmppServer-SessionWindowMonitorPool-" + sequence.getAndIncrement());
				return t;
			}
		});

		// a single instance of a client bootstrap can technically be shared
		// between any sessions that are created (a session can go to any
		// different number of SMSCs) - each session created under a client
		// bootstrap will use the executor and monitorExecutor set in its
		// constructor - just be *very* careful with the "expectedSessions"
		// value to make sure it matches the actual number of total concurrent
		// open sessions you plan on handling - the underlying netty library
		// used for NIO sockets essentially uses this value as the max number of
		// threads it will ever use, despite the "max pool size", etc. set on
		// the executor passed in here

		// Setting expected session to be 25. May be this should be
		// configurable?
		this.clientBootstrap = new DefaultSmppClient(this.executor, 25, monitorExecutor);

		this.smppClientOpsThread = new SmppClientOpsThread(this.clientBootstrap, this.smppSessionHandlerInterface, this.esmeManagement);

		(new Thread(this.smppClientOpsThread)).start();

		FastList<Esme> esmes = this.esmeManagement.esmes;
		for (FastList.Node<Esme> n = esmes.head(), end = esmes.tail(); (n = n.getNext()) != end;) {
			Esme esme = n.getValue();

			if (esme.getSmppSessionType() == SmppSession.Type.CLIENT) {
				this.startSmppClientSession(esme);
			}
		}

	}
 
开发者ID:RestComm,项目名称:smpp-extensions,代码行数:55,代码来源:SmppClientManagement.java

示例11: load

import javolution.util.FastList; //导入方法依赖的package包/类
/**
 * Load and create LinkSets and Link from persisted file
 *
 * @throws Exception
 */
public void load() throws FileNotFoundException {

    // backward compatibility: rename old file name to new one
    if (persistDir != null) {
        TextBuilder oldFileName = new TextBuilder();
        oldFileName.append(persistDir).append(File.separator).append("SmscManagement").append("_")
                .append(PERSIST_FILE_NAME);

        Path oldPath = FileSystems.getDefault().getPath(oldFileName.toString());
        Path newPath = FileSystems.getDefault().getPath(persistFile.toString());

        if (Files.exists(oldPath) && Files.notExists(newPath)) {
            try {
                Files.move(oldPath, newPath);
            } catch (IOException e) {
                logger.warn("Exception when trying to rename old config file", e);
            }
        }
    }

    XMLObjectReader reader = null;
    try {
        reader = XMLObjectReader.newInstance(new FileInputStream(persistFile.toString()));

        reader.setBinding(binding);
        this.esmes = reader.read(ESME_LIST, FastList.class);

        // Populate cluster
        for (FastList.Node<Esme> n = this.esmes.head(), end = this.esmes.tail(); (n = n.getNext()) != end;) {
            Esme esme = n.getValue();

            esme.esmeManagement = this;

            String esmeClusterName = esme.getClusterName();
            EsmeCluster esmeCluster = this.esmeClusters.get(esmeClusterName);
            if (esmeCluster == null) {
                esmeCluster = new EsmeCluster(esmeClusterName, esme.getNetworkId());
                this.esmeClusters.put(esmeClusterName, esmeCluster);
            } else {
                esme.setNetworkId(esmeCluster.getNetworkId());
            }
            esmeCluster.addEsme(esme);
        }

        reader.close();
    } catch (XMLStreamException ex) {
        // this.logger.info(
        // "Error while re-creating Linksets from persisted file", ex);
    }
}
 
开发者ID:RestComm,项目名称:smpp-extensions,代码行数:56,代码来源:EsmeManagement.java


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