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


Java XMLLightweightParser类代码示例

本文整理汇总了Java中org.jivesoftware.openfire.nio.XMLLightweightParser的典型用法代码示例。如果您正苦于以下问题:Java XMLLightweightParser类的具体用法?Java XMLLightweightParser怎么用?Java XMLLightweightParser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


XMLLightweightParser类属于org.jivesoftware.openfire.nio包,在下文中一共展示了XMLLightweightParser类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
  }
 
开发者ID:lijian17,项目名称:androidpn-server,代码行数:20,代码来源:XmppDecoder.java

示例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();
}
 
开发者ID:elphinkuo,项目名称:Androidpn,代码行数:17,代码来源:XmppDecoder.java

示例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();
}
 
开发者ID:elphinkuo,项目名称:Androidpn,代码行数:19,代码来源:XmppDecoder.java

示例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();
}
 
开发者ID:elphinkuo,项目名称:Androidpn,代码行数:17,代码来源:XmppDecoder.java

示例5: sessionOpened

import org.jivesoftware.openfire.nio.XMLLightweightParser; //导入依赖的package包/类
/**
 * 当一个连接被打开时,将被调用
 */
public void sessionOpened(IoSession session) throws Exception {
	log.debug("sessionOpened()...");
	log.debug("remoteAddress=" + session.getRemoteAddress());
	// 创建一个新的XML解析器
	XMLLightweightParser parser = new XMLLightweightParser("UTF-8");
	session.setAttribute(XML_PARSER, parser);
	// 创建一个新的连接
	Connection connection = new Connection(session);
	session.setAttribute(CONNECTION, connection);
	session.setAttribute(STANZA_HANDLER, new StanzaHandler(serverName,
			connection));
}
 
开发者ID:lijian17,项目名称:androidpn-server,代码行数:16,代码来源:XmppIoHandler.java

示例6: sessionOpened

import org.jivesoftware.openfire.nio.XMLLightweightParser; //导入依赖的package包/类
/**
 * Invoked when a connection has been opened.
 */
public void sessionOpened(IoSession session) throws Exception {
    log.debug("sessionOpened()...");
    log.debug("remoteAddress=" + session.getRemoteAddress());
    // Create a new XML parser
    XMLLightweightParser parser = new XMLLightweightParser("UTF-8");
    session.setAttribute(XML_PARSER, parser);
    // Create a new connection
    Connection connection = new Connection(session);
    session.setAttribute(CONNECTION, connection);
    session.setAttribute(STANZA_HANDLER, new StanzaHandler(serverName,
            connection));
}
 
开发者ID:elphinkuo,项目名称:Androidpn,代码行数:16,代码来源:XmppIoHandler.java

示例7: sessionOpened

import org.jivesoftware.openfire.nio.XMLLightweightParser; //导入依赖的package包/类
public void sessionOpened(IoSession session) throws Exception {
    log.debug("sessionOpened()...");
    log.debug("remoteAddress=" + session.getRemoteAddress());
    // Create a new XML parser for the new connection
    XMLLightweightParser parser = new XMLLightweightParser(CHARSET);
    session.setAttribute(XML_PARSER, parser);
    // Create a new Connection for the new session
    Connection connection = new Connection(session);
    session.setAttribute(CONNECTION, connection);
    session.setAttribute(STANZA_HANDLER, new ClientStanzaHandler(
            serverName, connection));
}
 
开发者ID:elphinkuo,项目名称:Androidpn,代码行数:13,代码来源:XmppIoHandler.java

示例8: sessionOpened

import org.jivesoftware.openfire.nio.XMLLightweightParser; //导入依赖的package包/类
public void sessionOpened(IoSession session) throws Exception {
    log.debug("sessionOpened()...");
    log.debug("remoteAddress=" + session.getRemoteAddress());
    // Create a new XML parser
    XMLLightweightParser parser = new XMLLightweightParser(CHARSET);
    session.setAttribute(XML_PARSER, parser);
    // Create a new connection
    Connection connection = new Connection(session);
    session.setAttribute(CONNECTION, connection);
    session.setAttribute(STANZA_HANDLER, new StanzaHandler(
            serverName, connection));
}
 
开发者ID:elphinkuo,项目名称:Androidpn,代码行数:13,代码来源:XmppIoHandler.java

示例9: sessionOpened

import org.jivesoftware.openfire.nio.XMLLightweightParser; //导入依赖的package包/类
public void sessionOpened(IoSession session) throws Exception {
    log.debug("sessionOpened()...");
    log.debug("remoteAddress=" + session.getRemoteAddress());
    // Create a new XML parser
    XMLLightweightParser parser = new XMLLightweightParser(CHARSET);
    session.setAttribute(XML_PARSER, parser);
    // Create a new connection
    Connection connection = new Connection(session);
    session.setAttribute(CONNECTION, connection);
    session.setAttribute(STANZA_HANDLER, new ClientStanzaHandler(
            serverName, connection));
}
 
开发者ID:elphinkuo,项目名称:Androidpn,代码行数:13,代码来源:XmppIoHandler.java

示例10: sessionOpened

import org.jivesoftware.openfire.nio.XMLLightweightParser; //导入依赖的package包/类
public void sessionOpened(IoSession session) throws Exception {
	log.debug("sessionOpened()...");
	// Create a new XML parser for the new connection. The parser will be
	// used by the XMPPDecoder filter.
	XMLLightweightParser parser = new XMLLightweightParser(CHARSET);
	session.setAttribute(XML_PARSER, parser);
	// // Create a new Connection for the new session
	// Connection connection = new Connection(session);
	// session.setAttribute(CONNECTION, connection);
	// session.setAttribute(STANZA_HANDLER, new ClientStanzaHandler(
	// serverName, connection));
}
 
开发者ID:elphinkuo,项目名称:Androidpn,代码行数:13,代码来源:XmppIoHandler.java


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