throw new ContainerConnectException("Already connected"); //$NON-NLS-1$
targetID = IDFactory.getDefault().createID(namespace,
bot.getConnectID());
IChatRoomManager manager = (IChatRoomManager) container
.getAdapter(IChatRoomManager.class);
if (manager == null)
throw new ECFException("No chat room manager available"); //$NON-NLS-1$
firePreConnect();
String password = bot.getPassword();
IConnectContext context = (password == null) ? null
: ConnectContextFactory
.createPasswordConnectContext(password);
container.connect(targetID, context);
String[] roomNames = bot.getChatRooms();
String[] roomPasswords = bot.getChatRoomPasswords();
for (int i = 0; i < roomNames.length; i++) {
IChatRoomInfo room = manager.getChatRoomInfo(roomNames[i]);
roomContainer = room.createChatRoomContainer();
roomID = room.getRoomID();
firePreRoomConnect();