final ClientEntry newClientEntry = new ClientEntry(containerType, newClient);
// Setup sharedobject container if the new instance supports
// this
ISharedObjectContainer sharedObjectContainer = (ISharedObjectContainer) newClient.getAdapter(ISharedObjectContainer.class);
SharedObjectContainerUI socui = new SharedObjectContainerUI(this, sharedObjectContainer);
socui.setup(sharedObjectContainer, newClientEntry, resource, username);
// Now connect
try {
newClient.connect(targetID, ConnectContextFactory.createUsernamePasswordConnectContext(username, connectData));
} catch (ContainerConnectException e) {
// If we have a connect exception then we remove any previously