10.07.2015 Views

Lotus Instant Messaging/ Web Conferencing ... - IBM Redbooks

Lotus Instant Messaging/ Web Conferencing ... - IBM Redbooks

Lotus Instant Messaging/ Web Conferencing ... - IBM Redbooks

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

}}while (m_bFinished == false);m_watchList.removeStatusListener(this);m_watchList.close();m_communityService.logout();boolean logoutExpired = false;int logoutAttempts = 0;do{if(++logoutAttempts > 1000){logoutExpired = true;}try{Thread.sleep(5);}catch (InterruptedException ie){ie.printStackTrace();}}while (isLoggedIn() == true && logoutExpired == false);}m_session.stop();m_session.unloadSession();The ResolveListener interface defines three methods: the UserStatus applicationis only interested in the resolved() method (Example 4-8). In this method, theString user name has been resolved into an STUser object. The StUser object isthe primary object used by Sametime to represent a valid, logged in user. TheWatchList object uses the STUser object to monitor the object’s status. Theapplication adds the STUser object to the WatchList object and sets them_bResolved variable so the resolve() method can continue.Example 4-8 UserStatus resolved() methodpublic void resolved(ResolveEvent event){System.out.println("resolved()");if(event.getName().compareTo(m_strUserName) == 0){Chapter 4. <strong>Web</strong> services 93

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!