use of org.eclipse.ecf.core.events.ContainerDisconnectedEvent in project ecf by eclipse.
the class XMPPContainer method disconnect.
/*
* (non-Javadoc)
*
* @see org.eclipse.ecf.provider.generic.ClientSOContainer#disconnect()
*/
public void disconnect() {
final ID groupID = getConnectedID();
fireContainerEvent(new ContainerDisconnectingEvent(this.getID(), groupID));
synchronized (getConnectLock()) {
// If we are currently connected
if (isConnected()) {
XmppPlugin.getDefault().unregisterService(this);
final ISynchAsynchConnection conn = getConnection();
synchronized (conn) {
synchronized (getGroupMembershipLock()) {
handleLeave(groupID, conn);
}
}
}
this.connection = null;
remoteServerID = null;
accountManager.setConnection(null);
chatRoomManager.setConnection(null, null, null);
outgoingFileTransferContainerAdapter.setConnection(null);
presenceHelper.disconnect();
getSharedObjectManager().removeSharedObject(presenceHelperID);
}
// notify listeners
fireContainerEvent(new ContainerDisconnectedEvent(this.getID(), groupID));
}
Aggregations