本文整理汇总了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);
}
});
}
示例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);
}
});
}
示例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();
}
});
}
示例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);
}
});
}
示例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);
}
});
}
示例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();
}
}
});
}
示例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();
}
});
}
示例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();
}
});
}
示例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();
}
}
});
}