Search in sources :

Example 1 with ContainerDisconnectedEvent

use of org.eclipse.ecf.core.events.ContainerDisconnectedEvent in project ecf by eclipse.

the class XMPPChatRoomContainer method disconnect.

public void disconnect() {
    final ID groupID = getConnectedID();
    fireContainerEvent(new ContainerDisconnectingEvent(this.getID(), groupID));
    synchronized (getConnectLock()) {
        // If we are currently connected
        if (isConnected()) {
            try {
                multiuserchat.leave();
            } catch (final Exception e) {
                // $NON-NLS-1$
                traceStack("Exception in multi user chat.leave", e);
            }
        }
        connectionState = DISCONNECTED;
        remoteServerID = null;
        if (containerHelper != null)
            containerHelper.disconnect();
        this.connection = null;
    }
    // notify listeners
    fireContainerEvent(new ContainerDisconnectedEvent(this.getID(), groupID));
}
Also used : XMPPRoomID(org.eclipse.ecf.provider.xmpp.identity.XMPPRoomID) ID(org.eclipse.ecf.core.identity.ID) ContainerDisconnectingEvent(org.eclipse.ecf.core.events.ContainerDisconnectingEvent) ECFException(org.eclipse.ecf.core.util.ECFException) ConnectionCreateException(org.eclipse.ecf.provider.comm.ConnectionCreateException) XMPPException(org.jivesoftware.smack.XMPPException) IDCreateException(org.eclipse.ecf.core.identity.IDCreateException) IOException(java.io.IOException) ContainerConnectException(org.eclipse.ecf.core.ContainerConnectException) SharedObjectAddException(org.eclipse.ecf.core.sharedobject.SharedObjectAddException) ContainerDisconnectedEvent(org.eclipse.ecf.core.events.ContainerDisconnectedEvent)

Example 2 with ContainerDisconnectedEvent

use of org.eclipse.ecf.core.events.ContainerDisconnectedEvent in project ecf by eclipse.

the class RSExampleContainer 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));
}
Also used : ID(org.eclipse.ecf.core.identity.ID) IRemoteServiceID(org.eclipse.ecf.remoteservice.IRemoteServiceID) ContainerDisconnectingEvent(org.eclipse.ecf.core.events.ContainerDisconnectingEvent) ContainerDisconnectedEvent(org.eclipse.ecf.core.events.ContainerDisconnectedEvent)

Example 3 with ContainerDisconnectedEvent

use of org.eclipse.ecf.core.events.ContainerDisconnectedEvent in project ecf by eclipse.

the class MSNContainer method disconnect.

public void disconnect() {
    if (client != null) {
        fireContainerEvent(new ContainerDisconnectingEvent(guid, connectID));
        client.disconnect();
        fireContainerEvent(new ContainerDisconnectedEvent(guid, connectID));
        for (Iterator it = chatSessions.values().iterator(); it.hasNext(); ) {
            ((ChatSession) it.next()).close();
        }
        chatSessions.clear();
        connectID = null;
        client = null;
        Activator.getDefault().unregisterService(this);
    }
}
Also used : Iterator(java.util.Iterator) ContainerDisconnectingEvent(org.eclipse.ecf.core.events.ContainerDisconnectingEvent) ChatSession(org.eclipse.ecf.protocol.msn.ChatSession) ContainerDisconnectedEvent(org.eclipse.ecf.core.events.ContainerDisconnectedEvent)

Example 4 with ContainerDisconnectedEvent

use of org.eclipse.ecf.core.events.ContainerDisconnectedEvent in project ecf by eclipse.

the class DnsSdDiscoveryContainerAdapter method disconnect.

/* (non-Javadoc)
	 * @see org.eclipse.ecf.core.IContainer#disconnect()
	 */
public void disconnect() {
    fireContainerEvent(new ContainerDisconnectingEvent(this.getID(), getConnectedID()));
    targetID = null;
    fireContainerEvent(new ContainerDisconnectedEvent(this.getID(), getConnectedID()));
}
Also used : ContainerDisconnectingEvent(org.eclipse.ecf.core.events.ContainerDisconnectingEvent) ContainerDisconnectedEvent(org.eclipse.ecf.core.events.ContainerDisconnectedEvent)

Example 5 with ContainerDisconnectedEvent

use of org.eclipse.ecf.core.events.ContainerDisconnectedEvent 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));
}
Also used : ID(org.eclipse.ecf.core.identity.ID) ContainerDisconnectingEvent(org.eclipse.ecf.core.events.ContainerDisconnectingEvent) ContainerDisconnectedEvent(org.eclipse.ecf.core.events.ContainerDisconnectedEvent)

Aggregations

ContainerDisconnectedEvent (org.eclipse.ecf.core.events.ContainerDisconnectedEvent)6 ContainerDisconnectingEvent (org.eclipse.ecf.core.events.ContainerDisconnectingEvent)6 ID (org.eclipse.ecf.core.identity.ID)4 IOException (java.io.IOException)1 Iterator (java.util.Iterator)1 ContainerConnectException (org.eclipse.ecf.core.ContainerConnectException)1 IDCreateException (org.eclipse.ecf.core.identity.IDCreateException)1 SharedObjectAddException (org.eclipse.ecf.core.sharedobject.SharedObjectAddException)1 ECFException (org.eclipse.ecf.core.util.ECFException)1 ChatSession (org.eclipse.ecf.protocol.msn.ChatSession)1 ConnectionCreateException (org.eclipse.ecf.provider.comm.ConnectionCreateException)1 ISynchAsynchConnection (org.eclipse.ecf.provider.comm.ISynchAsynchConnection)1 XMPPID (org.eclipse.ecf.provider.xmpp.identity.XMPPID)1 XMPPRoomID (org.eclipse.ecf.provider.xmpp.identity.XMPPRoomID)1 IRemoteServiceID (org.eclipse.ecf.remoteservice.IRemoteServiceID)1 XMPPException (org.jivesoftware.smack.XMPPException)1