try { myInstantMessenger = myFactory.createInstantMessenger(myScreenName, myPassword); myInstantMessenger.addMessageListener(this); myInstantMessenger.connect();  if (myWatcherFactory != null) { myWatcherInstantMessenger = myWatcherFactory.createInstantMessenger(myWatcherScreenName, myWatcherPassword); myWatcherInstantMessenger.connect();  myWatcherThread = new Thread(new IMConnectionTester(myWatcherInstantMessenger, myInstantMessenger, 60000, 30000)); myWatcherThread.start();    }  myRunning = true; Thread conversationExpiration = new Thread(new ConversationExpirationRunnable()); conversationExpiration.start(); } catch (IMConnectionException e) { NSLog.out.appendln(e); e.printStackTrace();
myInstantMessenger = myFactory.createInstantMessenger(myScreenName, myPassword); if (myAutoLogin) { connect();
  public void registerForEvents() {    try {      myInstantMessenger = myFactory.createInstantMessenger(myScreenName, myPassword);      myInstantMessenger.addMessageListener(this);      myInstantMessenger.connect();      if (myWatcherFactory != null) {        myWatcherInstantMessenger = myWatcherFactory.createInstantMessenger(myWatcherScreenName, myWatcherPassword);        myWatcherInstantMessenger.connect();        myWatcherThread = new Thread(new IMConnectionTester(myWatcherInstantMessenger, myInstantMessenger, 60000, 30000));        myWatcherThread.start();        //myWatchedThread = new Thread(new IMConnectionTester(myInstantMessenger, myWatcherInstantMessenger, 60000, 30000));        //myWatchedThread.start();      }      myRunning = true;      Thread conversationExpiration = new Thread(new ConversationExpirationRunnable());      conversationExpiration.start();    }    catch (IMConnectionException e) {      NSLog.out.appendln(e);      e.printStackTrace();    }  }