BenQ Mobile

javax.wireless.messaging
Interface MessageListener


public interface MessageListener

The MessageListener interface provides a mechanism for the application to be notified of incoming messages.

When an incoming message arrives, the notifyIncomingMessage() method is called. The application must retrieve the message using the receive() method of the MessageConnection.

The listener mechanism allows applications to receive incoming messages without needing to have a thread blocked in the receive() method call.

If multiple messages arrive very closely together in time, the implementation has the option of calling this listener from multiple threads in parallel. Applications must be prepared to handle this and implement any necessary synchronization as part of the application code, while obeying the requirements set for the listener method.


Method Summary
 void notifyIncomingMessage(MessageConnection conn)
          Called by the platform when an incoming message arrives to a MessageConnection where the application has registered this listener object.
 

Method Detail

notifyIncomingMessage

void notifyIncomingMessage(MessageConnection conn)
Called by the platform when an incoming message arrives to a MessageConnection where the application has registered this listener object.

This method is called once for each incoming message to the MessageConnection.

NOTE: The implementation of this method must return quickly and must not perform any extensive operations. The application should not receive and handle the message during this method call. Instead, it should act only as a trigger to start the activity in the application's own thread.

Parameters:
conn - the MessageConnection where the incoming message has arrived

BenQ Mobile

Copyright © 2006 BenQ Mobile GmbH & Co. OHG or respective copyright owner.
All Rights Reserved.
BenQ Corp. is a trademark licensee of Siemens AG.


For further information about Mobility Toolkit (MTK) visit our Developer Portal.