use of org.eclipse.ecf.core.events.IContainerConnectedEvent 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.IContainerConnectedEvent in project ecf by eclipse.
the class XMPPConnectWizard method performFinish.
public boolean performFinish() {
final String connectID = page.getConnectID();
final String password = page.getPassword();
// Save combo text even if we don't successfully login
page.saveComboText();
connectContext = createConnectContext();
try {
targetID = IDFactory.getDefault().createID(container.getConnectNamespace(), connectID);
} catch (final IDCreateException e) {
new IDCreateErrorDialog(null, connectID, e).open();
return false;
}
// Save combo items if targetID created successfully
page.saveComboItems();
final IPresenceContainerAdapter adapter = (IPresenceContainerAdapter) container.getAdapter(IPresenceContainerAdapter.class);
container.addListener(new IContainerListener() {
public void handleEvent(IContainerEvent event) {
if (event instanceof IContainerConnectedEvent) {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
openView();
}
});
}
}
});
final IChatManager icm = adapter.getChatManager();
icms = icm.getChatMessageSender();
itms = icm.getTypingMessageSender();
icm.addMessageListener(new IIMMessageListener() {
public void handleMessageEvent(IIMMessageEvent e) {
if (e instanceof IChatMessageEvent) {
displayMessage((IChatMessageEvent) e);
} else if (e instanceof ITypingMessageEvent) {
displayTypingNotification((ITypingMessageEvent) e);
}
}
});
final ISendFileTransferContainerAdapter ioftca = (ISendFileTransferContainerAdapter) container.getAdapter(ISendFileTransferContainerAdapter.class);
ioftca.addListener(requestListener);
// Connect
new AsynchContainerConnectAction(container, targetID, connectContext, null, new Runnable() {
public void run() {
cachePassword(connectID, password);
}
}).run();
return true;
}
Aggregations