org.robokind.api.messaging
Interface MessageAsyncReceiver<Msg>

Type Parameters:
Msg - type of Message received
All Superinterfaces:
org.jflux.api.core.Notifier<Msg>
All Known Implementing Classes:
DefaultMessageAsyncReceiver

public interface MessageAsyncReceiver<Msg>
extends org.jflux.api.core.Notifier<Msg>

High-Level Message Receiver. Contains a RecordAsyncReceiver for receiving Records. Contains an Adapter for converting Records back to Messages. Notifies Listeners of Messages Received.

Author:
Matthew Stevenson

Method Summary
 void addListener(org.jflux.api.core.Listener<Msg> listener)
          Adds a Listener to be notified when a Message has been received.
 void pause()
          Pauses a MessageAsyncReceiver.
 void removeListener(org.jflux.api.core.Listener<Msg> listener)
          Removes a Listener from being notified.
 void resume()
          Resumes a paused MessageAsyncReceiver.
 void start()
          Initializes and connects the MessageAsyncReceiver, and begins receiving Messages.
 void stop()
          Stops the MessageAsyncReceiver, making it unable to receive Messages.
 
Methods inherited from interface org.jflux.api.core.Notifier
notifyListeners
 

Method Detail

start

void start()
           throws Exception
Initializes and connects the MessageAsyncReceiver, and begins receiving Messages.

Throws:
Exception - if there is an error starting

pause

void pause()
Pauses a MessageAsyncReceiver.


resume

void resume()
Resumes a paused MessageAsyncReceiver.


stop

void stop()
Stops the MessageAsyncReceiver, making it unable to receive Messages.


addListener

void addListener(org.jflux.api.core.Listener<Msg> listener)
Adds a Listener to be notified when a Message has been received.

Specified by:
addListener in interface org.jflux.api.core.Notifier<Msg>
Parameters:
listener - the Listener to be notified

removeListener

void removeListener(org.jflux.api.core.Listener<Msg> listener)
Removes a Listener from being notified.

Specified by:
removeListener in interface org.jflux.api.core.Notifier<Msg>
Parameters:
listener - the Listener to remove


Copyright © 2011-2013. All Rights Reserved.