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


Java StreamError.getCode方法代码示例

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


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

示例1: connectionClosedOnError

import org.jivesoftware.smack.packet.StreamError; //导入方法依赖的package包/类
public void connectionClosedOnError(Exception e) {
    done = false;
    if (e instanceof XMPPException) {
        XMPPException xmppEx = (XMPPException) e;
        StreamError error = xmppEx.getStreamError();

        // Make sure the error is not null
        if (error != null) {
            String reason = error.getCode();

            if ("conflict".equals(reason)) {
                return;
            }
        }
    }

    if (this.isReconnectionAllowed()) {
        this.reconnect();
    }
}
 
开发者ID:ice-coffee,项目名称:EIM,代码行数:21,代码来源:ReconnectionManager.java

示例2: connectionClosedOnError

import org.jivesoftware.smack.packet.StreamError; //导入方法依赖的package包/类
public void connectionClosedOnError(Exception e) {
	done = false;
	if (e instanceof XMPPException) {
		XMPPException xmppEx = (XMPPException) e;
		StreamError error = xmppEx.getStreamError();

		// Make sure the error is not null
		if (error != null) {
			String reason = error.getCode();

			if ("conflict".equals(reason)) {
				return;
			}
		}
	}

	if (this.isReconnectionAllowed()) {
		this.reconnect();
	}
}
 
开发者ID:ikantech,项目名称:xmppsupport_v2,代码行数:21,代码来源:ReconnectionManager.java

示例3: connectionClosedOnError

import org.jivesoftware.smack.packet.StreamError; //导入方法依赖的package包/类
public void connectionClosedOnError(Exception e)
{
	done = false;
	if (e instanceof XMPPException)
	{
		XMPPException xmppEx = (XMPPException) e;
		StreamError error = xmppEx.getStreamError();

		// Make sure the error is not null
		if (error != null)
		{
			String reason = error.getCode();

			if ("conflict".equals(reason))
			{
				return;
			}
		}
	}

	if (this.isReconnectionAllowed())
	{
		this.reconnect();
	}
}
 
开发者ID:jonathangerbaud,项目名称:KlyphMessenger,代码行数:26,代码来源:MessengerService.java

示例4: connectionClosedOnError

import org.jivesoftware.smack.packet.StreamError; //导入方法依赖的package包/类
public void connectionClosedOnError(Exception ex) {
    handleDisconnect();

    String message = Res.getString("message.disconnected.error");

    if (ex instanceof XMPPException) {
        XMPPException xmppEx = (XMPPException)ex;
        StreamError error = xmppEx.getStreamError();
        String reason = error.getCode();
        if ("conflict".equals(reason)) {
            message = Res.getString("message.disconnected.conflict.error");
        }
    }

    getTranscriptWindow().insertNotificationMessage(message, ChatManager.ERROR_COLOR);
}
 
开发者ID:visit,项目名称:spark-svn-mirror,代码行数:17,代码来源:ChatRoomImpl.java

示例5: connectionClosedOnError

import org.jivesoftware.smack.packet.StreamError; //导入方法依赖的package包/类
public void connectionClosedOnError(final Exception ex) {
String errorMessage = Res.getString("message.disconnected.error");

if (ex != null && ex instanceof XMPPException) {
    XMPPException xmppEx = (XMPPException) ex;
    StreamError error = xmppEx.getStreamError();
    String reason = error.getCode();

    if ("conflict".equals(reason)) {
	errorMessage = Res
		.getString("message.disconnected.conflict.error");
    } else if ("system-shutdown".equals(reason)) {
	errorMessage = Res.getString("message.disconnected.shutdown");
    } else {
	errorMessage = Res.getString("message.general.error", reason);
    }
}

switch (localPreferences.getReconnectPanelType()) {
case 0:
    final String message = errorMessage;
    SwingUtilities.invokeLater(new Runnable() {
	public void run() {
	    _reconnectPanel.setClosedOnError(true);
	    reconnect(message);
	}
    });
    break;
case 1:
    switchAllUserOffline(true);
    _reconnectpanelsmall.setReconnectText(errorMessage);
    break;

case 2:
    switchAllUserOfflineNoGroupEntry(true);
    _reconnectpanelicon.setReconnectText(errorMessage);
    break;

}
   }
 
开发者ID:visit,项目名称:spark-svn-mirror,代码行数:41,代码来源:ContactList.java


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