use of org.eclipse.ecf.core.events.ContainerDisconnectingEvent in project ecf by eclipse.
the class TrivialContainer method disconnect.
/*
* (non-Javadoc)
*
* @see org.eclipse.ecf.core.IContainer#disconnect()
*/
public void disconnect() {
fireContainerEvent(new ContainerDisconnectingEvent(getID(), targetID));
final ID oldID = targetID;
// XXX disconnect here
fireContainerEvent(new ContainerDisconnectedEvent(getID(), oldID));
}
use of org.eclipse.ecf.core.events.ContainerDisconnectingEvent 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