本文整理汇总了Java中org.jivesoftware.openfire.nio.XMLLightweightParser.areThereMsgs方法的典型用法代码示例。如果您正苦于以下问题:Java XMLLightweightParser.areThereMsgs方法的具体用法?Java XMLLightweightParser.areThereMsgs怎么用?Java XMLLightweightParser.areThereMsgs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jivesoftware.openfire.nio.XMLLightweightParser
的用法示例。
在下文中一共展示了XMLLightweightParser.areThereMsgs方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doDecode
import org.jivesoftware.openfire.nio.XMLLightweightParser; //导入方法依赖的package包/类
@Override
public boolean doDecode(IoSession session, IoBuffer in,
ProtocolDecoderOutput out) throws Exception {
// log.debug("doDecode(...)...");
XMLLightweightParser parser = (XMLLightweightParser) session
.getAttribute(XmppIoHandler.XML_PARSER);
parser.read(in);
// 如果有消息
if (parser.areThereMsgs()) {
for (String stanza : parser.getMsgs()) {
out.write(stanza);
}
}
// 是否还有剩余
return !in.hasRemaining();
}
示例2: doDecode
import org.jivesoftware.openfire.nio.XMLLightweightParser; //导入方法依赖的package包/类
@Override
public boolean doDecode(IoSession session, IoBuffer in,
ProtocolDecoderOutput out) throws Exception {
// log.debug("doDecode(...)...");
XMLLightweightParser parser = (XMLLightweightParser) session
.getAttribute(XmppIoHandler.XML_PARSER);
parser.read(in);
if (parser.areThereMsgs()) {
for (String stanza : parser.getMsgs()) {
out.write(stanza);
}
}
return !in.hasRemaining();
}
示例3: doDecode
import org.jivesoftware.openfire.nio.XMLLightweightParser; //导入方法依赖的package包/类
@Override
public boolean doDecode(IoSession session, IoBuffer in,
ProtocolDecoderOutput out) throws Exception {
log.debug("doDecode(...)...");
// Get the XML light parser from the IoSession
XMLLightweightParser parser = (XMLLightweightParser) session
.getAttribute("XML-PARSER");
// Parse as many stanzas as possible from the received data
parser.read(in);
if (parser.areThereMsgs()) {
for (String stanza : parser.getMsgs()) {
out.write(stanza);
}
}
return !in.hasRemaining();
}
示例4: doDecode
import org.jivesoftware.openfire.nio.XMLLightweightParser; //导入方法依赖的package包/类
@Override
public boolean doDecode(IoSession session, IoBuffer in,
ProtocolDecoderOutput out) throws Exception {
log.debug("doDecode(...)...");
XMLLightweightParser parser = (XMLLightweightParser) session
.getAttribute("XML_PARSER");
parser.read(in);
if (parser.areThereMsgs()) {
for (String stanza : parser.getMsgs()) {
out.write(stanza);
}
}
return !in.hasRemaining();
}