
public class CommunicationModuleImpl extends Object implements CommunicationModule, ConfigurableCommunicationModule, SharedObjectListener, RejectedExecutionHandler
| Constructor and Description |
|---|
CommunicationModuleImpl(ModuleContext context) |
| Modifier and Type | Method and Description |
|---|---|
void |
addMessageListener(MessageListener listener,
String channelName)
Method used by the brokerage layer to add message listener
|
void |
configureChannels(List<ChannelDescriptor> channels,
String peerName)
This method allows to configure the CommunicationModule with a List of
channels
|
void |
dispose()
Routine in order to release resources
|
void |
dispose(List<ChannelDescriptor> channels)
This method allows to reset the Communication module
|
String |
getDescription() |
List<String> |
getGroupMembers(String group)
* This method fetches the set of members that join to the group
|
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.
|
String |
getName() |
String |
getProvider() |
String |
getVersion() |
boolean |
hasChannel(String channelName)
Determines whether a channel with the specified name exists.
|
boolean |
init()
This method configures the CommunicationModule: -to obtain the reference
to all the CommunicationConnector present in the fw
|
void |
loadConfigurations(Dictionary configurations) |
void |
messageReceived(ChannelMessage channelMessage)
This method is invoked by the Connector layer as soon as a message
arrives.
|
void |
rejectedExecution(Runnable r,
ThreadPoolExecutor executor) |
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
|
void |
send(ChannelMessage message,
PeerCard receiver)
Unicast
|
void |
sendAll(ChannelMessage message)
Broadcast
|
void |
sendAll(ChannelMessage message,
List<PeerCard> recipients)
Multicast
|
void |
sendAll(ChannelMessage message,
List<PeerCard> receivers,
MessageListener listener)
Multicast
|
void |
sendAll(ChannelMessage message,
MessageListener listener)
Broadcast with message listener
|
void |
sharedObjectAdded(Object sharedObj,
Object removeHook) |
void |
sharedObjectRemoved(Object removeHook) |
public CommunicationModuleImpl(ModuleContext context)
public boolean init()
public void dispose(List<ChannelDescriptor> channels)
ConfigurableCommunicationModuledispose in interface ConfigurableCommunicationModulepublic void dispose()
Modulepublic void messageReceived(ChannelMessage channelMessage)
CommunicationModulemessageReceived in interface CommunicationModulepublic void addMessageListener(MessageListener listener, String channelName)
CommunicationModuleaddMessageListener in interface CommunicationModulepublic MessageListener getListenerByNameAndType(String name, Class clz)
CommunicationModulegetListenerByNameAndType in interface CommunicationModulepublic void removeMessageListener(MessageListener listener, String channelName)
CommunicationModuleremoveMessageListener in interface CommunicationModulepublic String getDescription()
getDescription in interface Modulepublic String getProvider()
getProvider in interface Modulepublic String getVersion()
getVersion in interface Modulepublic void loadConfigurations(Dictionary configurations)
loadConfigurations in interface Modulepublic void rejectedExecution(Runnable r, ThreadPoolExecutor executor)
rejectedExecution in interface RejectedExecutionHandlerpublic void configureChannels(List<ChannelDescriptor> channels, String peerName)
ConfigurableCommunicationModuleconfigureChannels in interface ConfigurableCommunicationModulepublic void send(ChannelMessage message, MessageListener listener, PeerCard receiver)
send in interface CommunicationModulelistener - that will manage message failurespublic void send(ChannelMessage message, PeerCard receiver)
send in interface CommunicationModulepublic void sendAll(ChannelMessage message, List<PeerCard> receivers, MessageListener listener)
sendAll in interface CommunicationModulemessage - Message to sendreceivers - A list of receiverslistener - The listener manages failures during the message sendpublic void sendAll(ChannelMessage message, List<PeerCard> recipients)
sendAll in interface CommunicationModulepublic void sendAll(ChannelMessage message)
sendAll in interface CommunicationModulepublic void sendAll(ChannelMessage message, MessageListener listener)
sendAll in interface CommunicationModulelistener - The listener that will manage failures during the message sendpublic void sharedObjectAdded(Object sharedObj, Object removeHook)
sharedObjectAdded in interface SharedObjectListenerpublic void sharedObjectRemoved(Object removeHook)
sharedObjectRemoved in interface SharedObjectListenerpublic List<String> getGroupMembers(String group)
ConfigurableCommunicationModulegetGroupMembers in interface ConfigurableCommunicationModulepublic boolean hasChannel(String channelName)
CommunicationModulehasChannel in interface CommunicationModulechannelName - name of the channel.Copyright © 2018 universAAL Consortium. All rights reserved.