org.universAAL.middleware.modules
Interface CommunicationModule

Package class diagram package CommunicationModule
All Superinterfaces:
Module
All Known Subinterfaces:
ConfigurableCommunicationModule
All Known Implementing Classes:
CommunicationModuleImpl

public interface CommunicationModule
extends Module

The interface for the Communication Module. This interface is invoked from the brokerage layer

Author:
Michele Girolami, Francesco Furfari

Method Summary
 void addMessageListener(MessageListener listener, String channelName)
          Method used by the brokerage layer to add message listener
 MessageListener getListenerByNameAndType(String name, Class clz)
          Returns the first MessageListener that is an instance of the given clz and has been registered under the given name.
 boolean hasChannel(String channelName)
          Determines whether a channel with the specified name exists.
 void messageReceived(ChannelMessage channelMessage)
          This method is invoked by the Connector layer as soon as a message arrives.
 void removeMessageListener(MessageListener listener, String channelName)
          Method used by the upper layer to un-register themselves as message listener
 void send(ChannelMessage message, MessageListener listener, PeerCard receiver)
          Unicast send
 void send(ChannelMessage message, PeerCard receiver)
          Unicast send to the AALSpace Coordinator for joining operation
 void sendAll(ChannelMessage message)
          Broadcast implementation of the send
 void sendAll(ChannelMessage message, List<PeerCard> receivers)
          Multicast implementation of the send.
 void sendAll(ChannelMessage message, List<PeerCard> receivers, MessageListener listener)
          Multicast send
 void sendAll(ChannelMessage message, MessageListener listener)
          Broadcast implementation of the send
 
Methods inherited from interface org.universAAL.middleware.modules.Module
dispose, getDescription, getName, getProvider, getVersion, init, loadConfigurations
 

Method Detail

messageReceived

void messageReceived(ChannelMessage channelMessage)
This method is invoked by the Connector layer as soon as a message arrives.

Parameters:
channelMessage -

sendAll

void sendAll(ChannelMessage message,
             List<PeerCard> receivers,
             MessageListener listener)
             throws CommunicationModuleException
Multicast send

Parameters:
message - Message to send
receivers - A list of receivers
listener - The listener manages failures during the message send
Throws:
CommunicationModuleException

sendAll

void sendAll(ChannelMessage message,
             List<PeerCard> receivers)
             throws CommunicationModuleException
Multicast implementation of the send. This signature does not require any MessageListener

Parameters:
message -
receivers -
Throws:
CommunicationModuleException

sendAll

void sendAll(ChannelMessage message,
             MessageListener listener)
             throws CommunicationModuleException
Broadcast implementation of the send

Parameters:
message -
listener - The listener that will manage failures during the message send
Throws:
CommunicationModuleException

sendAll

void sendAll(ChannelMessage message)
             throws CommunicationModuleException
Broadcast implementation of the send

Parameters:
message -
Throws:
CommunicationModuleException

send

void send(ChannelMessage message,
          MessageListener listener,
          PeerCard receiver)
          throws CommunicationModuleException
Unicast send

Parameters:
message -
recipient -
listener - that will manage message failures
Throws:
CommunicationModuleException

send

void send(ChannelMessage message,
          PeerCard receiver)
          throws CommunicationModuleException
Unicast send to the AALSpace Coordinator for joining operation

Parameters:
message -
coordinatorID -
listener -
Throws:
CommunicationModuleException

addMessageListener

void addMessageListener(MessageListener listener,
                        String channelName)
Method used by the brokerage layer to add message listener

Parameters:
listener -
ChannelMessage -

removeMessageListener

void removeMessageListener(MessageListener listener,
                           String channelName)
Method used by the upper layer to un-register themselves as message listener

Parameters:
listener -
ChannelMessage -

getListenerByNameAndType

MessageListener getListenerByNameAndType(String name,
                                         Class clz)
Returns the first MessageListener that is an instance of the given clz and has been registered under the given name.

Parameters:
name -
Returns:

hasChannel

boolean hasChannel(String channelName)
Determines whether a channel with the specified name exists.

Parameters:
channelName - name of the channel.
Returns:
true, iff the channel exists.


Copyright © 2014 universAAL Consortium. All Rights Reserved.