Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 9. Instant Messenger Application > The RemoteServiceServlet Class

The RemoteServiceServlet Class

A server-side class implements the MessengerService interface. In our implementation we have a servlet called MessengerServiceImpl that implements the MessengerService interface, and instead of extending HttpServlet to get the functionality to run in a servlet container, the class extends GWT’s RemoveServiceServlet. The RemoteServiceServlet class is an HttpServlet that does some extra work to translate the RPC calls from a client to invoke method implementations on the class. This class makes implementing the MessengerService on the server very simple and clean without any RPC code. The following example shows an empty server-side RPC implementation:

public class MessengerServiceImpl
extends RemoteServiceServlet implements MessengerService {
   public void signIn( String name ){
   }

   public void signOut(){
   }

   public void sendMessage( Contact to, Message message ){
   }
}


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial