Java 类org.jivesoftware.smack.AbstractConnectionClosedListener 实例源码

项目:Smack    文件:InBandBytestreamManager.java   
public void connectionCreated(final XMPPConnection connection) {
    // create the manager for this connection
    InBandBytestreamManager.getByteStreamManager(connection);

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

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

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

    });

}
项目:Smack    文件:JingleSession.java   
/**
 * Configure a session, setting some action listeners...
 * 
 * @param connection
 *            The connection to set up
 */
private void installConnectionListeners(final XMPPConnection connection) {
    if (connection != null) {
        connectionListener = new AbstractConnectionClosedListener() {
            @Override
            public void connectionTerminated() {
                unregisterInstanceFor(connection);
            }
        };
        connection.addConnectionListener(connectionListener);
    }
}