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


Java AbstractConnectionListener类代码示例

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


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

示例1: connectionCreated

import org.jivesoftware.smack.AbstractConnectionListener; //导入依赖的package包/类
public void connectionCreated(final Connection connection) {
    // create the manager for this connection
    InBandBytestreamManager.getByteStreamManager(connection);

    // register shutdown listener
    connection.addConnectionListener(new AbstractConnectionListener() {

        @Override
        public void connectionClosed() {
            InBandBytestreamManager.getByteStreamManager(connection).disableService();
        }

        @Override
        public void connectionClosedOnError(Exception e) {
            InBandBytestreamManager.getByteStreamManager(connection).disableService();
        }

        @Override
        public void reconnectionSuccessful() {
            // re-create the manager for this connection
            InBandBytestreamManager.getByteStreamManager(connection);
        }
    });

}
 
开发者ID:CJC-ivotten,项目名称:androidPN-client.,代码行数:26,代码来源:InBandBytestreamManager.java

示例2: connectionCreated

import org.jivesoftware.smack.AbstractConnectionListener; //导入依赖的package包/类
public void connectionCreated(final Connection connection) {
    // create the manager for this connection
    Socks5BytestreamManager.getBytestreamManager(connection);

    // register shutdown listener
    connection.addConnectionListener(new AbstractConnectionListener() {

        @Override
        public void connectionClosed() {
            Socks5BytestreamManager.getBytestreamManager(connection).disableService();
        }

        @Override
        public void connectionClosedOnError(Exception e) {
            Socks5BytestreamManager.getBytestreamManager(connection).disableService();
        }

        @Override
        public void reconnectionSuccessful() {
            // re-create the manager for this connection
            Socks5BytestreamManager.getBytestreamManager(connection);
        }
    });
}
 
开发者ID:CJC-ivotten,项目名称:androidPN-client.,代码行数:25,代码来源:Socks5BytestreamManager.java

示例3: connectionCreated

import org.jivesoftware.smack.AbstractConnectionListener; //导入依赖的package包/类
public void connectionCreated(Connection connection) {
	final InBandBytestreamManager manager;
	manager = InBandBytestreamManager
			.getByteStreamManager(connection);

	// register shutdown listener
	connection
			.addConnectionListener(new AbstractConnectionListener() {

				public void connectionClosed() {
					manager.disableService();
				}

			});

}
 
开发者ID:ikantech,项目名称:xmppsupport_v2,代码行数:17,代码来源:InBandBytestreamManager.java

示例4: connectionCreated

import org.jivesoftware.smack.AbstractConnectionListener; //导入依赖的package包/类
public void connectionCreated(final Connection connection) {
	final Socks5BytestreamManager manager;
	manager = Socks5BytestreamManager
			.getBytestreamManager(connection);

	// register shutdown listener
	connection
			.addConnectionListener(new AbstractConnectionListener() {

				public void connectionClosed() {
					manager.disableService();
				}

				public void connectionClosedOnError(
						Exception e) {
					manager.disableService();
				}

				public void reconnectionSuccessful() {
					managers.put(connection, manager);
				}

			});
}
 
开发者ID:ikantech,项目名称:xmppsupport_v2,代码行数:25,代码来源:Socks5BytestreamManager.java

示例5: connectionCreated

import org.jivesoftware.smack.AbstractConnectionListener; //导入依赖的package包/类
public void connectionCreated(final Connection connection) {
    final Socks5BytestreamManager manager;
    manager = Socks5BytestreamManager.getBytestreamManager(connection);

    // register shutdown listener
    connection.addConnectionListener(new AbstractConnectionListener() {

        public void connectionClosed() {
            manager.disableService();
        }
        
        public void connectionClosedOnError(Exception e) {
            manager.disableService();
        }
        
        public void reconnectionSuccessful() {
            managers.put(connection, manager);
        }

    });
}
 
开发者ID:jtietema,项目名称:telegraph,代码行数:22,代码来源:Socks5BytestreamManager.java

示例6: XMPPTCPConnection

import org.jivesoftware.smack.AbstractConnectionListener; //导入依赖的package包/类
/**
 * Creates a new XMPP connection over TCP (optionally using proxies).
 * <p>
 * Note that XMPPTCPConnection constructors do not establish a connection to the server
 * and you must call {@link #connect()}.
 * </p>
 *
 * @param config the connection configuration.
 */
public XMPPTCPConnection(XMPPTCPConnectionConfiguration config) {
    super(config);
    this.config = config;
    addConnectionListener(new AbstractConnectionListener() {
        @Override
        public void connectionClosedOnError(Exception e) {
            if (e instanceof XMPPException.StreamErrorException) {
                dropSmState();
            }
        }
    });
}
 
开发者ID:TTalkIM,项目名称:Smack,代码行数:22,代码来源:XMPPTCPConnection.java

示例7: connectionCreated

import org.jivesoftware.smack.AbstractConnectionListener; //导入依赖的package包/类
public void connectionCreated(Connection connection) {
    final InBandBytestreamManager manager;
    manager = InBandBytestreamManager.getByteStreamManager(connection);

    // register shutdown listener
    connection.addConnectionListener(new AbstractConnectionListener() {

        public void connectionClosed() {
            manager.disableService();
        }

    });

}
 
开发者ID:ice-coffee,项目名称:EIM,代码行数:15,代码来源:InBandBytestreamManager.java

示例8: connectionCreated

import org.jivesoftware.smack.AbstractConnectionListener; //导入依赖的package包/类
public void connectionCreated(Connection connection) {
    final Socks5BytestreamManager manager;
    manager = Socks5BytestreamManager.getBytestreamManager(connection);

    // register shutdown listener
    connection.addConnectionListener(new AbstractConnectionListener() {

        public void connectionClosed() {
            manager.disableService();
        }

    });
}
 
开发者ID:ice-coffee,项目名称:EIM,代码行数:14,代码来源:Socks5BytestreamManager.java

示例9: XMPPTCPConnection

import org.jivesoftware.smack.AbstractConnectionListener; //导入依赖的package包/类
/**
 * Creates a new XMPP connection over TCP (optionally using proxies).
 * <p>
 * Note that XMPPTCPConnection constructors do not establish a connection to the server
 * and you must call {@link #connect()}.
 * </p>
 *
 * @param config the connection configuration.
 */
public XMPPTCPConnection(XMPPTCPConnectionConfiguration config) {
    super(config);
    this.config = config;
    addConnectionListener(new AbstractConnectionListener() {
        @Override
        public void connectionClosedOnError(Exception e) {
            if (e instanceof XMPPException.StreamErrorException || e instanceof StreamManagementException) {
                dropSmState();
            }
        }
    });
}
 
开发者ID:kontalk,项目名称:androidclient,代码行数:22,代码来源:XMPPTCPConnection.java


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