• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java UnknownStanzaException类的典型用法和代码示例

java 2次浏览

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

UnknownStanzaException类属于org.jivesoftware.openfire.multiplex包,在下文中一共展示了UnknownStanzaException类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: route

点赞 3

import org.jivesoftware.openfire.multiplex.UnknownStanzaException; //导入依赖的package包/类
public void route(Element wrappedElement)
        throws UnknownStanzaException {
    String tag = wrappedElement.getName();
    if ("auth".equals(tag) || "response".equals(tag)) {
        SASLAuthentication.handle(session, wrappedElement);
    }
    else if ("iq".equals(tag)) {
        route(getIQ(wrappedElement));
    }
    else if ("message".equals(tag)) {
        route(new Message(wrappedElement, skipJIDValidation));
    }
    else if ("presence".equals(tag)) {
        route(new Presence(wrappedElement, skipJIDValidation));
    }
    else {
        throw new UnknownStanzaException();
    }
}
 

开发者ID:igniterealtime,
项目名称:Openfire,
代码行数:20,
代码来源:SessionPacketRouter.java

示例2: sendPendingPackets

点赞 3

import org.jivesoftware.openfire.multiplex.UnknownStanzaException; //导入依赖的package包/类
/**
 * This methods sends any pending packets in the session. If no packets are
 * pending, this method simply returns. The method is internally synchronized
 * to avoid simultaneous sending operations on this Session. If two
 * threads try to run this method simultaneously, the first one will trigger
 * the pending packets to be sent, while the second one will simply return
 * (as there are no packets left to send).
 */
protected void sendPendingPackets() {
    // access blocked only on send to prevent deadlocks
    synchronized (packetsToSend) {
        if (packetsToSend.isEmpty()) {
            return;
        }

        if (router == null) {
            router = new SessionPacketRouter(this);
        }

        for (Element packet : packetsToSend.remove()) {
            try {
                router.route(packet);
            }
            catch (UnknownStanzaException e) {
                Log.error("Client provided unknown packet type", e);
            }
        }
    }
}
 

开发者ID:igniterealtime,
项目名称:Openfire,
代码行数:30,
代码来源:HttpSession.java

示例3: route

点赞 3

import org.jivesoftware.openfire.multiplex.UnknownStanzaException; //导入依赖的package包/类
public void route(Element wrappedElement)
        throws UnsupportedEncodingException, UnknownStanzaException {
    String tag = wrappedElement.getName();
    if ("auth".equals(tag) || "response".equals(tag)) {
        SASLAuthentication.handle(session, wrappedElement);
    }
    else if ("iq".equals(tag)) {
        route(getIQ(wrappedElement));
    }
    else if ("message".equals(tag)) {
        route(new Message(wrappedElement, skipJIDValidation));
    }
    else if ("presence".equals(tag)) {
        route(new Presence(wrappedElement, skipJIDValidation));
    }
    else {
        throw new UnknownStanzaException();
    }
}
 

开发者ID:coodeer,
项目名称:g3server,
代码行数:20,
代码来源:SessionPacketRouter.java

示例4: route

点赞 2

import org.jivesoftware.openfire.multiplex.UnknownStanzaException; //导入依赖的package包/类
@Override
public void route(Element wrappedElement) throws UnknownStanzaException {

    if (StreamManager.NAMESPACE_V3.equals(wrappedElement.getNamespace().getStringValue())) {
        session.getStreamManager().process( wrappedElement );
    } else {
        super.route(wrappedElement);
        if (isUnsolicitedAckExpected()) {
            session.getStreamManager().sendServerAcknowledgement();
        }
    }
}
 

开发者ID:igniterealtime,
项目名称:Openfire,
代码行数:13,
代码来源:StreamManagementPacketRouter.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)