use of org.eclipse.ecf.core.events.IContainerDisconnectedEvent in project ecf by eclipse.
the class ClientContainerConnectTest method createServerAndClients.
/*
* (non-Javadoc)
*
* @see org.eclipse.ecf.tests.connect.ContainerConnectTestCase#createServerAndClients()
*/
protected void createServerAndClients() throws Exception {
clientCount = 5;
super.createServerAndClients();
getServer().addListener(new IContainerListener() {
public void handleEvent(IContainerEvent event) {
if (event instanceof IContainerConnectedEvent)
serverConnectEvents.add(event);
if (event instanceof IContainerDisconnectedEvent)
serverDisconnectEvents.add(event);
}
});
}
use of org.eclipse.ecf.core.events.IContainerDisconnectedEvent in project ecf by eclipse.
the class ClientContainerConnectTest method testListenerDisconnected.
public void testListenerDisconnected() throws Exception {
final IContainer client = getClients()[0];
client.addListener(createListener());
client.connect(createServerID(), null);
client.disconnect();
final Object o = clientDisconnectedEvents.get(0);
assertTrue(o instanceof IContainerDisconnectedEvent);
final IContainerDisconnectedEvent cco = (IContainerDisconnectedEvent) o;
assertTrue(cco.getLocalContainerID().equals(client.getID()));
assertTrue(cco.getTargetID().equals(createServerID()));
}
use of org.eclipse.ecf.core.events.IContainerDisconnectedEvent in project ecf by eclipse.
the class SSLClientContainerConnectTest method createServerAndClients.
/*
* (non-Javadoc)
*
* @see org.eclipse.ecf.tests.connect.ContainerConnectTestCase#createServerAndClients()
*/
protected void createServerAndClients() throws Exception {
clientCount = 5;
super.createServerAndClients();
getServer().addListener(new IContainerListener() {
public void handleEvent(IContainerEvent event) {
if (event instanceof IContainerConnectedEvent)
serverConnectEvents.add(event);
if (event instanceof IContainerDisconnectedEvent)
serverDisconnectEvents.add(event);
}
});
}
use of org.eclipse.ecf.core.events.IContainerDisconnectedEvent in project ecf by eclipse.
the class UserSearchView method addMultiRosterAccount.
/**
* Add the MultiRosterAccount for add user contact
* @param multiRosterAccount
* @return boolean
*/
public boolean addMultiRosterAccount(MultiRosterAccount multiRosterAccount) {
Assert.isNotNull(multiRosterAccount);
this.account = multiRosterAccount;
listener = new IContainerListener() {
public void handleEvent(IContainerEvent event) {
if (event instanceof IContainerDisconnectedEvent) {
users.clear();
showMessage(Messages.MultiRosterView_HELP_MESSAGE);
}
}
};
account.container.addListener(listener);
return true;
}
Aggregations