public Message receiveMessage ( ) { Message message = null ; try { message = m_receiveQueue . receiveRemoteMessage ( ) ; // Hang until a message comes through } catch ( RemoteException ex ) { ex . printStackTrace ( ) ; return null ; // Remote exception = I'm done! } if ( message instanceof BaseMessage ) ( ( BaseMessage ) message ) . setProcessedByServer ( true ) ; // Don't send the message back down. return message ; }
Block until a message is received . Hangs on the remote receive message call .